O'Reilly logo

Babylon.js Essentials by Julien Moreau-Mathis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Simulate physics

Physics simulation is pretty different from the collisions system since it does not occur on the cameras but on the objects of the scene itself. In other words, if physics is enabled (and configured) on a box, the box will interact with other meshes in the scene and try to represent the real physical movements.

For example, let's take a sphere in the air. If you apply physics to the sphere, the sphere will fall until it collides with another mesh and according to the given parameters, it will bounce and roll in the scene.

Note

The example files reproduce the behavior of a sphere that falls on the box in the middle of the scene.

Enable physics in Babylon.js

In Babylon.js, physics simulations can be only done using plugins. Two plugins ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required