C4 Engine Terathon Software C4 Engine API Documentation

• World Manager

API Links
Developer Links

class Trigger

Defined in:  C4Triggers.h
The Trigger class represents a trigger node in a world.
Definition

class Trigger : public Node, public ListElement<Trigger>

Member Functions
Trigger::GetTriggerType Returns the specific type of a trigger.
Trigger::GetNodeConnector Returns the node to which the trigger is connected.
Trigger::SetNodeConnector Sets the node to which the trigger is connected.
Constructor

Trigger(TriggerType type);

The constructor has protected access. A Trigger class can only exist as the base class for a more specific type of trigger.
Parameters
type The type of the trigger. See below for a list of possible types.
Description
The Trigger class represents a trigger node in a world. Triggers are typically activated by calling the World::ActivateTriggers function to test a swept sphere against all trigger volumes in the world.

A trigger node has a built-in connector of type TARG, and the node to which it is connected can be accessed using the Trigger::GetNodeConnector and Trigger::SetNodeConnector functions. When a trigger is activated, if the trigger itself does not have a controller assigned to it, then the controller assigned to the node connected through the TARG connector is activated.

See the World::ActivateTriggers function for the exact trigger activation behavior.
kTriggerBox A box trigger.
kTriggerCylinder A cylinder trigger.
kTriggerSphere A sphere trigger.
Base Classes
Node A Trigger node is a scene graph node.
ListElement<Trigger> Used internally by the World Manager.
See Also

TriggerObject