C4 Engine Terathon Software C4 Engine API Documentation

• World Manager

API Links
Developer Links

World::ActivateTriggers

Defined in:  C4World.h
Activates all triggers through which a given segment passes.
Prototype

void ActivateTriggers(const Point3D& p1, const Point3D& p2, float radius, Node *activator = nullptr);

Parameters
p1 The beginning of the line segment in world space.
p2 The end of the line segment in world space.
radius The radius of the line segment.
activator The node that is assigned to be a trigger's activator.
Description
The ActivateTriggers function finds all trigger nodes in the world that intersect the line segment specified by the p1 and p2 parameters and activates them. If the radius parameter is greater than zero, then the line segment is actually a swept sphere, and intersections are tested with its volume instead of an infinitely thin line segment.

When a trigger node is activated, it searches for a controller to activate in the following order and performs exactly one of the following actions.

1. If the trigger node itself has a controller, then that controller is activated.
2. If there is a node connected to the trigger's TARG connector, and it has a controller, then that controller is activated.
3. If there is a node connected to the trigger's TARG connector, but it does not have a controller, then its immediate subnodes are examined. Every controller belonging to this set of subnodes is activated.
See Also
Trigger