![]() |
|
Trigger Class Reference
[Game Objects]
A Trigger is a volume of space that initiates script callbacks when objects pass through the Trigger. More...

Public Member Functions | |
int | getNumObjects () |
Get the number of objects that are within the Trigger's bounds. | |
int | getObject (int index) |
Retrieve the requested object that is within the Trigger's bounds. | |
Callbacks | |
void | onAdd (int objectId) |
Called when the Trigger is being created. | |
void | onRemove (int objectId) |
Called just before the Trigger is deleted. | |
Public Attributes | |
string | enterCommand |
The command to execute when an object enters this trigger. Object id stored in %obj. Maximum 1023 characters. | |
string | leaveCommand |
The command to execute when an object leaves this trigger. Object id stored in %obj. Maximum 1023 characters. | |
floatList | polyhedron |
Defines a non-rectangular area for the trigger. | |
string | tickCommand |
The command to execute while an object is inside this trigger. Maximum 1023 characters. | |
Static Public Attributes | |
static bool | isRenderable |
Disables rendering of all instances of this type. | |
static bool | isSelectable |
Disables selection of all instances of this type. | |
static bool | renderTriggers |
Forces all Trigger's to render. |
Detailed Description
A Trigger is a volume of space that initiates script callbacks when objects pass through the Trigger.
TriggerData provides the callbacks for the Trigger when an object enters, stays inside or leaves the Trigger's volume.
- See also:
- TriggerData
Member Function Documentation
int Trigger::getNumObjects | ( | ) |
Get the number of objects that are within the Trigger's bounds.
- See also:
- getObject()
int Trigger::getObject | ( | int | index | ) |
Retrieve the requested object that is within the Trigger's bounds.
- Parameters:
-
index Index of the object to get (range is 0 to getNumObjects()-1)
- Returns:
- The SimObjectID of the object, or -1 if the requested index is invalid.
- See also:
- getNumObjects()
void Trigger::onAdd | ( | int | objectId | ) |
void Trigger::onRemove | ( | int | objectId | ) |
Member Data Documentation
string Trigger::enterCommand |
The command to execute when an object enters this trigger. Object id stored in %obj. Maximum 1023 characters.
string Trigger::leaveCommand |
The command to execute when an object leaves this trigger. Object id stored in %obj. Maximum 1023 characters.
floatList Trigger::polyhedron |
Defines a non-rectangular area for the trigger.
Rather than the standard rectangular bounds, this optional parameter defines a quadrilateral trigger area. The quadrilateral is defined as a corner point followed by three vectors representing the edges extending from the corner.
string Trigger::tickCommand |
The command to execute while an object is inside this trigger. Maximum 1023 characters.