Gravity Engine 12.0
Unity Asset for Gravity
Loading...
Searching...
No Matches
GETriggerMgr Class Reference

Handle any GETrigger requests that have been registered with GE. More...

Classes

class  Trigger
 

Public Member Functions

delegate bool TriggerFunction (GravityState gs, System.Object data)
 Function to be run at each engineDt cycle.
 
 GETriggerMgr (GETriggerMgr from)
 
void AddTrigger (Trigger t)
 
void RemoveTrigger (Trigger t)
 
void Clear ()
 
bool HaveTriggers ()
 
void RunTriggers (GravityState gs)
 Run all the registered triggers. If any ask to be removed, take them out of the list.
 

Detailed Description

Handle any GETrigger requests that have been registered with GE.

GETrigger allows user code to insert a condition check (e.g. is ship within 100 units of the target) into the main evolution loop of gravity engine. This is better than have user code check the condition itself in FixedUpdate if the time zoom capability is being used (then the time jumps per fixed update can be large). By using a GETrigger the condition is checked every engineDt cycle.

This does directly impact the time required by the core loop in GE.

If any triggers are present this also prevents the use of time jumps in all-on-rails cases.

A trigger consists of a delegate function and an opaque data reference.

Member Function Documentation

◆ RunTriggers()

void GETriggerMgr.RunTriggers ( GravityState  gs)

Run all the registered triggers. If any ask to be removed, take them out of the list.

Parameters
gs

◆ TriggerFunction()

delegate bool GETriggerMgr.TriggerFunction ( GravityState  gs,
System.Object  data 
)

Function to be run at each engineDt cycle.

  • this function is given the attached GravityState
  • the function should refer to GE internal positions/velocities (the engine loop has NOT updated transform positions)
  • trigger functions can check if the GravityState is for a trajectory prediction by checking gs.isCopy
Parameters
gs
Returns

The documentation for this class was generated from the following file: