# Set the currently displayed model
fun model=(model: Model)
do
+ if model isa ModelAsset then print "Model: {model.path}"
+
var actor = new Actor(model, new Point3d[Float](0.0, 0.0, 0.0))
- model = model.leaves.first
- actor.center.x -= model.mesh.center.x
- actor.center.y -= model.mesh.center.y
- actor.center.z -= model.mesh.center.z
+ # Align on Y only
+ actor.center.y -= model.center.y
- var height = model.mesh.dimensions.y
- world_camera.reset_height(height * 2.5)
+ # Fit in viewport
+ var height = model.dimensions.x
+ height = height.max(model.dimensions.y)
+ height = height.max(model.dimensions.z)
+ world_camera.reset_height(height * 1.5)
actors.clear
actors.add actor
else if event.is_arrow_left then
cycle_model -1
end
- else if event isa PointerEvent and event.depressed then
+ else if event isa PointerEvent and not event.is_move and event.depressed then
if event.x.to_i > display.width / 2 then
cycle_model 1
else cycle_model -1