Preparing your scenes for Physics

Using the Force or Physicalize Behaviors requires a few steps in order to enable physic in the scene.

Physics computation needs a Physics Locator to be present in the scene, The Physics Locator will be created automaticaly as soon as you drag and Drop a Physalize Behavior or a Force Behavior on the Behavior Flow. You may also create one Physicalize Behavior by clicking the icon  in the Golaem Shelf.
 
Physics Locator Attributes
 
The Physics locator let you set the environment mode to Default Plane , File or None.
The environment is set to Plane by Default you may adjust the physics attributes of this Default Physics Plane (Static Friction, Dynamic Friction, Restitution) inside the Physics Locator attributes.
 

CREATING A CUSTOM PHYSICS ENVIRONMENT

Since Golaem 4.2.2 creating a custom physics environment has never been so easy.
 
1. Select the desired mesh you want to Physicalize.
 
 2. Click the Crowd Rigid Body icon  in the Golaem Shelf, your new Rigid Body will be automatically mapped into the Physics locator.
 
3. Go inside the attributes of the Rigid Body to change its Shape type and Physics properties if needed.
Rigid Body of a terrain set to Triangle mesh
 
 

CREATING A PHYSX ENVIRONMENT FILE (.xml)

If you want to optimize your scene by deleting the source of your environment Rigid Bodies and/or share the environment through multiple scenes you may want to save your PhysX environment as an xml.  

Notice that the xml file is not suitable for Kinematic Rigid Bodies. As xml environment files are not dynamic it wont be possible to use them as collision triggers for your Behaviors.

To transform your environment in a PhysX environment file, just click the icon "Save Rigid Body as" and save it to the desired location.

 

LOADING A PHYSX ENVIRONMENT FILE (.xml)

When creating your simulation with Golaem Crowd, set the Environment Mode to File, and set your previously exported PhysX environment file in the PhysX Envrionment File attribute.

PhysX .xml file loading

If you need to check that the environment file is correctly loaded, make sure that at least 1 CrowdField is active and running, and check the Draw Collision Shapes attribute:


Draw PhysX environment

 

Creating Physics Simulation Behaviors

See the Physics Simulation Basic Worflow

Good usage of physics

Physics is a complex system, and often misused because misunderstood. The base of a physics engine is the collision computation, and it is important to understand that the cost and efficiency of collision computation depends on the shapes used by the rigid bodies.

Please read the documentation on how to get better collisions with your environment.