Main   Class List   Namespace List   Wiki

TriggerData Class Reference
[Game Objects]

Defines shared properties for Trigger objects. More...

Inheritance diagram for TriggerData:
Inheritance graph
[legend]

List of all members.

Callbacks



bool clientSide
 Forces Trigger callbacks to only be called on clients.
int tickPeriodMS
 Time in milliseconds between calls to onTickTrigger() while at least one object is within a Trigger's bounds.
void onEnterTrigger (Trigger trigger, GameBase obj)
 Called when an object enters the volume of the Trigger instance using this TriggerData.
void onLeaveTrigger (Trigger trigger, GameBase obj)
 Called when an object leaves the volume of the Trigger instance using this TriggerData.
void onTickTrigger (Trigger trigger)
 Called every tickPeriodMS number of milliseconds (as specified in the TriggerData) whenever one or more objects are inside the volume of the trigger.

Detailed Description

Defines shared properties for Trigger objects.

The primary focus of the TriggerData datablock is the callbacks it provides when an object is within or leaves the Trigger bounds.

See also:
Trigger.

Member Function Documentation

void TriggerData::onEnterTrigger ( Trigger  trigger,
GameBase  obj 
)

Called when an object enters the volume of the Trigger instance using this TriggerData.

Parameters:
trigger the Trigger instance whose volume the object entered
obj the object that entered the volume of the Trigger instance
void TriggerData::onLeaveTrigger ( Trigger  trigger,
GameBase  obj 
)

Called when an object leaves the volume of the Trigger instance using this TriggerData.

Parameters:
trigger the Trigger instance whose volume the object left
obj the object that left the volume of the Trigger instance
void TriggerData::onTickTrigger ( Trigger  trigger  ) 

Called every tickPeriodMS number of milliseconds (as specified in the TriggerData) whenever one or more objects are inside the volume of the trigger.

The Trigger has methods to retrieve the objects that are within the Trigger's bounds if you want to do something with them in this callback.

Parameters:
trigger the Trigger instance whose volume the object is inside
See also:
tickPeriodMS
Trigger::getNumObjects()
Trigger::getObject()

Member Data Documentation

Forces Trigger callbacks to only be called on clients.

Time in milliseconds between calls to onTickTrigger() while at least one object is within a Trigger's bounds.

See also:
onTickTrigger()


Copyright © GarageGames, LLC. All Rights Reserved.