Physics Collision Trigger
The Physics Collision Trigger enables to start or stop a behavior when a collision with another physicalized entity or a Crowd Rigid Body occurs.
The trigger only works when two entities are colliding and physicalized thanks to the Physicalize Behavior, or when a physicalized entity is colliding with a Crowd Rigid Body that is listed in the list of Rigid Bodies of the Physics Locator.
For Crowd Rigid Bodies using the Triangle Mesh shape, only the Convex Hull will be used in the collision trigger.
Creation
- Behavior Editor / Trigger Library:
- Golaem Menu: Crowd Triggers / Triggers / CrowdTri Collision Node
- MEL command: glmCrowdTriCollisionCmd;
Configuration
Physics Collision Attributes
By default, a physics collision triggers returns true whenever a physics collision occurs with the entity. But it's possible to define filters on the collision to ensure the trigger returns true only for a given type of collisions.
Add Filter on |
Select the filter to add:
And click on the + button to add the filter in the list of filters. |
You can add as many filters as desired, but keep in mind that the trigger will return true only when all of them are valid for the same collision. See the explanation at the end of this page.
Physics Mode filter
Collision Side |
Side of the collision on which checking the physics mode:
|
Physics Mode |
|
ID filter
Collision Side |
Side of the collision on which checking the physics mode:
|
ID Mode | Select the ID mode. |
Operator | Comparison operator (equal, greater than…) |
ID Value | Depending on the collision mode set an ID (to see how to set an ID, check the EntityType , the Crowd Rigid Body and the Physicalize Behavior). |
Color filter
Collision Side |
Side of the collision on which checking the physics mode:
|
Color Mode |
Select the color mode:
|
Operator | Comparison operator (equal, greater than…) |
Color Value | Depending on the collision mode set a color (to see how to set a color, check the EntityType, the Bone Physics Properties part of the character maker, and the Crowd Rigid Body). |
Kinetic value filter
Collision Side |
Side of the collision on which checking the physics mode:
|
Kinetic Mode | Select the kinetic mode. |
Operator | Comparison operator (equal, greater than…) |
Kinetic Value | Kinetic value to compare the collision side object with |
Single trigger with multiple filter versus multiple triggers with single filters
Any number of filters can be added on the trigger, it's just important to remember that the trigger will return true only if all the filters are true for the same physics' collision. For instance, the following triggers may have different results:
A single trigger with 2 filters
Two triggers with 1 filter each
The first one will return true only if a collision occurs with a collider that is both red and has an ID 13, while the second trigger might also return true if a collision occurs with a red rigid body and another collision occurs at the same time with a rigid body that has an ID 13.