Add Collisions
Physicalize a part means adding a rigid body and a joint to it. Interaction between two rigid bodies can be set for collision or interference detection.
Configuring Rigid Bodies
You can configure properties of a rigid body in the inspector tab in the XdeRigidBody component :
- Has weight: defines whether of not the object is affected by gravity
- Mass: the mass of the object in kg
- Overwrite COG: by default, the center of gravity of the object is located at its center.
This can be changed with this property - Custom Moment of Inertia: to manually define the matrix of inertia
- Composite Offset
Set up collisions
One of the key feature of INTERACT's XDE Physics Engine lies in its precise collision detection.
Using and configuring collision detection is really easy, you just have to set how groups of objects behave when a collision occurs.
In INTERACT, the notion of ‘Group of objects’ is called ‘Collision Groups’. (ex: the Collision Group ‘Mobile’ contains all the mobile objects in the scene).
It is important to carefully define your Collision Groups in order to optimize the collision detection.
-
To assign a RigidBody to a particular Collision Group: Use the XdeRigidBody component in the inspector tab and select the Collision Group you want in the dropdown list.
-
If you want to define a new Collision Group: Use INTERACT > Physics > Show Collision Matrix menu. This will open the active XdeCollisionRule. Click on Create new group and name the New Collision Group asset accordingly.
The Collision Matrix allows you to define the possible interactions between Collision Groups. It is presented in the form of a matrix. At the intersection of 2 Collision Groups (Rows and Columns), you can select between three types of interaction:
- None (N): no collision will be monitored between these two Collision Groups
- Contact ( C ): the contact detection will be activated.
- Interference ( I ): the two objects will be allowed to penetrate each other but the interference will be monitored.
Ex: Collision between a capsule and a cube
Ex: Interference between a capsule and a cube
Collision feedback arrows size
The size of contact arrows can be configured in the [PhysicsManager] under XdeContactsDisplay.
Display interferences
Switch the monitoring type to MONITORING_INTERFERENCE
or MONITORING_BOTH
in the [PhysicsManager] under XdeCollisionGroupsMonitor.
Improve pre-processing time
In order to improve launch time for your simulation, you can serialize pre-computation into specific assets. You can achieve this using the Mesh Collider persistence file option on XdeRigidbody component and then click on Generate persistence data. If you modify mesh geometry or physics parameters, you might need to regenerate this file.
Not allowed to access triangles/indices on mesh
If you encounter the following error when starting the simulation Not allowed to access triangles/indices on mesh (isReadable is false; Read/Write must be enabled in import settings)
, double-check that your model has the Read/Write
flag enabled on your Model tab.
Collisions not detected
If you configured the collision group of your object and established your collision matrix right but the collisions don't appear, it could be a problem with the speed of your object, to high comparing to the time needed to establish the collision between objects. Go to the advanced collisions parameters.