Torque 3D - Script Manual: Trigger Class Reference

TorqueScript

Main   Class List   Namespace List   Online

Trigger Class Reference
[Game Objects]

A Trigger is a volume of space that initiates script callbacks when objects pass through the Trigger. More...

Inheritance diagram for Trigger:

List of all members.

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  ) 

Called when the Trigger is being created.

Parameters:
objectId the object id of the Trigger being created
void Trigger::onRemove ( int  objectId  ) 

Called just before the Trigger is deleted.

Parameters:
objectId the object id of the Trigger being deleted

Member Data Documentation

The command to execute when an object enters this trigger. Object id stored in %obj. Maximum 1023 characters.

The command to execute when an object leaves this trigger. Object id stored in %obj. Maximum 1023 characters.

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.

The command to execute while an object is inside this trigger. Maximum 1023 characters.



Copyright © GarageGames, LLC. All Rights Reserved.