Hey there.
Any idea why some meshes would fall through the ground created by heightmap… but only if they’re moved quickly? And moreover, how to prevent that case?
Two screenshots here where you can see the behavior.
All good here.
Oops! Where are you going pink brick??? Right to the bottom of the sea, it seems.
And video here: Dropbox - fallingthrough.mov - Simplify your life
Key bit of the code is is:
g.ground1 = BABYLON.Mesh.CreateGroundFromHeightMap("ground", "/assets/textures/water.jpg", 200, 200, 10, 0, 10, g.scene, false, function() { g.ground1.physicsImpostor = new BABYLON.PhysicsImpostor(g.ground1, BABYLON.PhysicsImpostor.MeshImpostor, { mass:0, restitution: 0.1, friction: 0.5 }, g.scene); }); g.bricks.forEach(brick => { brick.physicsImpostor = new BABYLON.PhysicsImpostor(brick, BABYLON.PhysicsImpostor.BoxImpostor, { mass: 13, restitution: 0.2, friction: 12 }); });