Triggers
17 nodes
On this page 17
Above
FunctionWhen a body's centre rises above a height (m).
Above(body: Text, height: Number) -> Trigger Condition
TriggerCondition Above(string body, double height)
Parameters
| name | type | default | description |
|---|---|---|---|
| body | Text | — | |
| height | Number | — |
Returns
| result | Trigger Condition |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Triggers
- Package
- Physics Simulation
Also
FunctionThe trigger with one more action, taken after the ones it has.
Also -> Trigger Description
trigger: Trigger Description
action: Trigger ActionTriggerDescription Also(
TriggerDescription trigger,
TriggerAction action)Parameters
| name | type | default | description |
|---|---|---|---|
| trigger | Trigger Description | — | |
| action | Trigger Action | — |
Returns
| result | Trigger Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Triggers
- Package
- Physics Simulation
At Time
FunctionWhen the simulated time reaches a moment.
AtTime(time: Number) -> Trigger Condition
TriggerCondition AtTime(double time)
Parameters
| name | type | default | description |
|---|---|---|---|
| time | Number | — | The moment (s). |
Returns
| result | Trigger Condition |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Triggers
- Package
- Physics Simulation
Below
FunctionWhen a body's centre falls below a height (m).
Below(body: Text, height: Number) -> Trigger Condition
TriggerCondition Below(string body, double height)
Parameters
| name | type | default | description |
|---|---|---|---|
| body | Text | — | |
| height | Number | — |
Returns
| result | Trigger Condition |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Triggers
- Package
- Physics Simulation
Detonate
FunctionSet off a charge of TNT; its blast pushes bodies, cloth and water and shatters breakable bodies.
Detonate -> Trigger Action
position: Vector3d
TNT (kg): Number
atEvent: TruthTriggerAction Detonate(
Vector3d position,
double tntKg,
bool atEvent = false)Parameters
| name | type | default | description |
|---|---|---|---|
| position | Vector3d | — | Where (m); with At Event, the offset from where the trigger fired. |
| TNT (kg) | Number | — | Charge (kg TNT equivalent). |
| atEvent | Truth | False | Place the charge at the event: the contact point, or the watched body. |
Returns
| result | Trigger Action |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Triggers
- Package
- Physics Simulation
Every
FunctionEvery interval of simulated time, from a start until an end.
Every -> Trigger Condition
interval: Number
start: Number
until: NumberTriggerCondition Every(
double interval,
double start = 0,
double until = double.PositiveInfinity)Parameters
| name | type | default | description |
|---|---|---|---|
| interval | Number | — | The interval (s); a firing per coupling step at most is guaranteed only for intervals no shorter than the coupling step. |
| start | Number | 0 | The first firing (s). |
| until | Number | Infinity | No firing after this (s). |
Returns
| result | Trigger Condition |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Triggers
- Package
- Physics Simulation
Faster Than
FunctionWhen a body moves faster than a speed (m/s).
FasterThan(body: Text, speed: Number) -> Trigger Condition
TriggerCondition FasterThan(string body, double speed)
Parameters
| name | type | default | description |
|---|---|---|---|
| body | Text | — | |
| speed | Number | — |
Returns
| result | Trigger Condition |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Triggers
- Package
- Physics Simulation
On Contact
FunctionWhen a body starts touching another body, or anything.
OnContact -> Trigger Condition
body: Text
other: Text
minSpeed: NumberTriggerCondition OnContact(
string body,
string other = "",
double minSpeed = 0)Parameters
| name | type | default | description |
|---|---|---|---|
| body | Text | — | The body (or a spawned body's template name). |
| other | Text | — | The other body; empty for anything. |
| minSpeed | Number | 0 | Only contacts that approach faster than this (m/s); 0 for any touch. |
Returns
| result | Trigger Condition |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Triggers
- Package
- Physics Simulation
Push
FunctionGive a body an impulse (N·s), as a kick or a thrust.
Push(body: Text, impulse: Vector3d) -> Trigger Action
TriggerAction Push(string body, Vector3d impulse)
Parameters
| name | type | default | description |
|---|---|---|---|
| body | Text | — | |
| impulse | Vector3d | — |
Returns
| result | Trigger Action |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Triggers
- Package
- Physics Simulation
Release
FunctionMake a static or kinematic body (and the copies spawned from it) dynamic, so it starts to fall and be pushed.
Release(body: Text) -> Trigger Action
TriggerAction Release(string body)
Parameters
| name | type | default | description |
|---|---|---|---|
| body | Text | — |
Returns
| result | Trigger Action |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Triggers
- Package
- Physics Simulation
Remove
FunctionTake bodies out of the scene: every body named Body (and its spawned copies), or with At Event only the one the event is about, such as the raindrop that just landed.
Remove(body: Text, atEvent: Truth) -> Trigger Action
TriggerAction Remove(string body, bool atEvent = false)
Parameters
| name | type | default | description |
|---|---|---|---|
| body | Text | — | The body, or the template whose copies are removed. |
| atEvent | Truth | False | Remove only the event's own body (the one that touched, crossed the height or went too fast), if it is one of these. |
Returns
| result | Trigger Action |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Triggers
- Package
- Physics Simulation
Set Wind
FunctionChange the steady wind (m/s).
SetWind(velocity: Vector3d) -> Trigger Action
TriggerAction SetWind(Vector3d velocity)
Parameters
| name | type | default | description |
|---|---|---|---|
| velocity | Vector3d | — |
Returns
| result | Trigger Action |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Triggers
- Package
- Physics Simulation
Spawn
FunctionAdd a copy of a body, named after it with a running number ("drop#1").
Spawn -> Trigger Action
body: Body Description
atEvent: Truth
scatter: Vector3dTriggerAction Spawn(
BodyDescription body,
bool atEvent = false,
Vector3d scatter)Parameters
| name | type | default | description |
|---|---|---|---|
| body | Body Description | — | The body to copy; its position is where copies appear. |
| atEvent | Truth | False | Place the copy at the event (offset by the body's position) instead. |
| scatter | Vector3d | — | Half-size of a box (m) the position is scattered in with the scene's seed; zero for none. |
Returns
| result | Trigger Action |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Triggers
- Package
- Physics Simulation
Unpin Cloth
FunctionLet go of a cloth's pinned vertices.
UnpinCloth(cloth: Text) -> Trigger Action
TriggerAction UnpinCloth(string cloth)
Parameters
| name | type | default | description |
|---|---|---|---|
| cloth | Text | — |
Returns
| result | Trigger Action |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Triggers
- Package
- Physics Simulation
Watch
FunctionA trigger that only records an event (for sampling, or for a procedural graph to react to), taking no action.
Watch -> Trigger Description
name: Text
condition: Trigger Condition
repeat: TruthTriggerDescription Watch(
string name,
TriggerCondition condition,
bool repeat = false)Parameters
| name | type | default | description |
|---|---|---|---|
| name | Text | — | |
| condition | Trigger Condition | — | |
| repeat | Truth | False |
Returns
| result | Trigger Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Triggers
- Package
- Physics Simulation
Water In Region
FunctionWhen at least a number of water particles are inside a box: a level sensor, a flood alarm, a splash detector.
WaterInRegion -> Trigger Condition
regionMin: Vector3d
regionMax: Vector3d
particles: IntegerTriggerCondition WaterInRegion(
Vector3d regionMin,
Vector3d regionMax,
int particles = 1)Parameters
| name | type | default | description |
|---|---|---|---|
| regionMin | Vector3d | — | Lower corner of the box (m). |
| regionMax | Vector3d | — | Upper corner of the box (m). |
| particles | Integer | 1 | How many particles must be inside. |
Returns
| result | Trigger Condition |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Triggers
- Package
- Physics Simulation
When
FunctionA trigger: when the condition holds, take the action.
When -> Trigger Description
name: Text
condition: Trigger Condition
action: Trigger Action
repeat: Truth
cooldown: NumberTriggerDescription When(
string name,
TriggerCondition condition,
TriggerAction action,
bool repeat = false,
double cooldown = 0)Parameters
| name | type | default | description |
|---|---|---|---|
| name | Text | — | The name its events carry. |
| condition | Trigger Condition | — | What to wait for. |
| action | Trigger Action | — | What to do. |
| repeat | Truth | False | Fire every time the condition holds again, not only the first time (an "every" condition always repeats). |
| cooldown | Number | 0 | A repeating trigger stays quiet this long after firing (s). |
Returns
| result | Trigger Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Triggers
- Package
- Physics Simulation