If I’m importing models (.gltf
, .glb
, .babylon
etc) into Babylon, then I have to use Ammo right!?
I haven’t tried any other plugins based on this section of the docs.
Or, is there an example of how to create the colliders in code instead of in Blender? I know there’s the skull example in the docs, but that doesn’t need to scale, rotate or position the colliders so will only take me so far down the road…
Or, am I just going about this all wrong?
Should I import (and position) each object separately in the scene, rather than importing everything as a single glTF?
In other words, import cylinder.gltf
, sphere.gltf
, torus.gltf
, … instead of test.gltf
. To give a slightly more realistic example, this could be house.gltf
, wall.gltf
, tree.gltf
, … instead of my-home.gltf
!?
Regarding the open issue about negatively scaled meshes. Is there something I might have done or missed when exporting the model from Blender?
Should I try exporting as .babylon
instead of .gltf
?
I’ve created another version of the playground where the ball DOES stop, BUT it still doesn’t stop on the imported model. I had to create a ground plane underneath, only on there do these functions to work:
// Check if the ball's impostor is moving up or down.
const isMovingUpDown = function(ballImpostor) {
return Math.abs(ballImpostor.getLinearVelocity().y) >
BABYLON.PhysicsEngine.Epsilon;
}
// Check if the ball's impostor is static/stationary.
const isStatic = function(ballImpostor) {
return ballImpostor.getLinearVelocity().length() <
BABYLON.PhysicsEngine.Epsilon;
}
Hopefully that all made sense!