Compound Bodies
The Skull as a Compound Body
The skull is an interesting shape to try to turn into a compound body, and you can see it in all its magnificence here: Skull As A Compound Body
It is roughly composed of a sphere for most of it, with a box around the jaw area. A bit of work is needed to position the sphere and box as well as possible. The skull is compounded from these two covering meshes.

Note Center of mass is at the origin of the compound object.
Compound to Empty Mesh
- Create an empty mesh to be used as a parent for the compound body;
- Create a range of appropriately shaped standard meshes to fit over the irregular mesh;
- Parent the standard meshes and the irregular mesh to the empty mesh;
- Calculate or estimate the mass for each standard mesh;
- Create physics impostors for each standard mesh with zero mass;
- Create a physics impostor for the empty mesh, using the
NoImpostorproperty, with the total mass of all the standard meshes.
Note Step 3 MUST come before step 4 and step 5 before step 6.
Skull As A Compound Body 1Compound Covering Meshes to The Complex Mesh
- Create a range of appropriately shaped standard meshes to fit over the irregular mesh;
- Parent the standard meshes to the irregular mesh;
- Calculate or estimate the mass for each standard mesh;
- Create physics impostors for each standard mesh with zero mass;
- Create a physics impostor for the irregular mesh, using the
NoImpostorproperty, with the total mass of all the standard meshes.
Note Steps 2, 4 and 5 must be in that order.
Skull As A Compound Body 2Compound to One of the Covering Meshes
- Create a range of appropriately shaped standard meshes to fit over the irregular mesh;
- Choose one standard mesh and parent the other standard meshes and the irregular mesh to this mesh;
- Calculate or estimate the mass for each standard mesh;
- Create physics impostors for each standard mesh with the assumed mass;
Note Step 2 MUST come before step 4.
Skull As A Compound Body 3Further reading
Using A Physics Engine
Learn how to use one of the available physics engines in Babylon.js.

Forces
Learn all about applying physical forces in Babylon.js.

Joints
Learn all about using joints in physics engines within Babylon.js.

Pivots and Axes
Learn all about physics pivots and axes in Babylon.js.

Soft Bodies
Learn all about physics soft bodies in Babylon.js.

Advanced Physics Features
Unlock the full potential of physics with advanced physics features in Babylon.js.
