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

A Physics Collision Trigger defines the following specific attributes. For common attributes see Trigger Common Attributes.

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:

  • Collider (other) to filter on either another entity or a Crowd Rigid Body
  • Collided (self) to filter on the entity on which the behavior is set
  • Any to filter on BOTH side of the collision (i.e. Collider AND Collidee should be using the same Physics mode selected below)
Physics Mode
  • Dynamic Rigid Body: keep only collisions occurring with a body in dynamic mode
  • Kinematic Rigid Body: keep only collisions occurring a body in kinematic mode
  • Local Servo Rigid Body: keep only collisions occurring with a body in Local Servo Rigid Body mode
  • World Servo Rigid Body: keep only collisions occurring with a body in World Servo Rigid Body mode
  • Any

ID filter

Collision Side

Side of the collision on which checking the physics mode:

  • Collider (other) to filter on either another entity or a Crowd Rigid Body
  • Collided (self) to filter on the entity on which the behavior is set
  • Any to filter on BOTH side of the collision (i.e. Collider AND Collidee should have the same ID selected below)
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:

  • Collider (other) to filter on either another entity or a Crowd Rigid Body
  • Collided (self) to filter on the entity on which the behavior is set
  • Any to filter on BOTH side of the collision (i.e. Collider AND Collidee should have the same color selected below)
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:

  • Collider (other) to filter on either another entity or a Crowd Rigid Body
  • Collided (self) to filter on the entity on which the behavior is set
  • Any to filter on BOTH side of the collision (i.e. Collider AND Collidee should have the same kinetic values selected below)
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.