Applying Collision Meshes

Collision meshes are used to improve the physics performance of an object in Sansar. They mitigate the chances of people getting stuck on complex meshes and generally smooth out player movement over complex shapes.

Collision_1.png
A teapot and its collision mesh. The collision mesh covers the volume of the teapot without the need for precise, intricate details.

Using collision meshes

To avoid issues in Sansar, we recommend the following when adding a collision mesh to your objects to avoid unnecessary loss of performance:

  • Never use your object ("render" mesh) as a collision mesh. 
  • Collision meshes should be very low-polygon cages that encapsulate the areas of an object that you don't want avatars to be able to walk through. Collision meshes should never be dense! 
Collision_2.png
The polygon-count difference between the collision mesh and the teapot mesh. This allows Sansar to avoid having to calculate every polygon from the original teapot mesh and simply stores the collision mesh in the model file with a specific "collision" material. Sansar then only calculates collisions against the optimized collision mesh. In most cases, this creates a smoother environment and it is more efficient.

When not to use collision meshes

Not everything in your scene may require a collision mesh. Generally, objects not requiring a collision mesh are things that people are not intended to interact with, based on the desired functionality of your experience. Items that are shown at a distance specifically for visual purposes do not require a collision mesh. Reducing the number of collision meshes can help prevent a scene from becoming too "heavy" with unnecessary mesh data, which can cause longer loading times.

Known issue: Currently, attaching collision meshes to multi-part objects and object animations is not recommended. Attaching collision meshes to these object types will break the object. A fix for this is underway. 

 

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.