Physics

Physics v2

You can use the Havok plugin for physics v2

When you declare your physics aggregate you need to set the type and pass in the appropriate options. Note the leading underscore due to how the babylon class was created.

<mesh ...>
<physicsAggregate type={PhysicsShapeType.BOX} _options={{ mass: 0, restitution: 0.9 }} />
</mesh>

Physics v1

You can use other supported libraries like AMMO.js - this example uses Cannon.

When you declare your physics impostor you need to set the type and pass in the appropriate options. Note the leading underscore due to how the babylon class was created.

<mesh ...>
<physicsImpostor type={PhysicsImpostor.BoxImpostor} _options={{ mass: 0, restitution: 0.9 }} />
</mesh>