![]() |
VR-Forces 4.2 Class Documentation
|
Trigger (DtSimTrigger, in simTrigger.h) objects are created by When statements (DtWhenStmt) when they are executed.
Triggers register with a DtPlan object so that they can get ticked. They keep a pointer to the plan so that they can unregister when they fire and are deleted.
When a DtSimTrigger is created, it saves a pointer to the When statement that created it. When DtSimTrigger::tick() is called, the trigger uses the DtWhenStmt statement pointer to get the conditional expression so that it can test it. When the trigger condition becomes true, the following occurs:
If the trigger is a "ReTask" trigger, the trigger tells the DtPlan to pushExecutionStack().
In a ReTask trigger, when the trigger fires, the entity stops executing the current task and begins to execute the trigger block. When the trigger is complete, the entity executes the first plan statement after the task it was executing at the time the trigger fired.
The ReTask option is the only option implemented by VR-Forces. A user cannot change the trigger type in the GUI.
[<< Conditional Expressions] [Home] [Top of Page]