C4 Engine
C4 Engine API Documentation

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 *initiator = 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.
initiator The node that is assigned to be a trigger's initiator.
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 the trigger object specifies an activation connector key, there is a node connected to the trigger through a connector having that key, and that node has a controller, then that controller is activated.
3. If a node connected through the activation connector key exists, but it does not have a controller, then its immediate subnodes are examined. Every controller belonging to that set of subnodes is activated.
See Also

Trigger