Divooka Reference

Triggers

17 nodes

On this page 17

Above

Function

When a body's centre rises above a height (m).

Signature
Above(body: Text, height: Number) -> Trigger Condition
TriggerCondition Above(string body, double height)

Parameters

nametypedefaultdescription
bodyText—
heightNumber—

Returns

resultTrigger Condition
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Triggers
Package
Physics Simulation

Also

Function

The trigger with one more action, taken after the ones it has.

Signature
Also -> Trigger Description
    trigger: Trigger Description
    action: Trigger Action
TriggerDescription Also(
    TriggerDescription trigger,
    TriggerAction action)

Parameters

nametypedefaultdescription
triggerTrigger Description—
actionTrigger Action—

Returns

resultTrigger Description
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Triggers
Package
Physics Simulation

At Time

Function

When the simulated time reaches a moment.

Signature
AtTime(time: Number) -> Trigger Condition
TriggerCondition AtTime(double time)

Parameters

nametypedefaultdescription
timeNumber—The moment (s).

Returns

resultTrigger Condition
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Triggers
Package
Physics Simulation

Below

Function

When a body's centre falls below a height (m).

Signature
Below(body: Text, height: Number) -> Trigger Condition
TriggerCondition Below(string body, double height)

Parameters

nametypedefaultdescription
bodyText—
heightNumber—

Returns

resultTrigger Condition
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Triggers
Package
Physics Simulation

Detonate

Function

Set off a charge of TNT; its blast pushes bodies, cloth and water and shatters breakable bodies.

Signature
Detonate -> Trigger Action
    position: Vector3d
    TNT (kg): Number
    atEvent: Truth
TriggerAction Detonate(
    Vector3d position,
    double tntKg,
    bool atEvent = false)

Parameters

nametypedefaultdescription
positionVector3d—Where (m); with At Event, the offset from where the trigger fired.
TNT (kg)Number—Charge (kg TNT equivalent).
atEventTruthFalsePlace the charge at the event: the contact point, or the watched body.

Returns

resultTrigger Action
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Triggers
Package
Physics Simulation

Every

Function

Every interval of simulated time, from a start until an end.

Signature
Every -> Trigger Condition
    interval: Number
    start: Number
    until: Number
TriggerCondition Every(
    double interval,
    double start = 0,
    double until = double.PositiveInfinity)

Parameters

nametypedefaultdescription
intervalNumber—The interval (s); a firing per coupling step at most is guaranteed only for intervals no shorter than the coupling step.
startNumber0The first firing (s).
untilNumberInfinityNo firing after this (s).

Returns

resultTrigger Condition
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Triggers
Package
Physics Simulation

Faster Than

Function

When a body moves faster than a speed (m/s).

Signature
FasterThan(body: Text, speed: Number) -> Trigger Condition
TriggerCondition FasterThan(string body, double speed)

Parameters

nametypedefaultdescription
bodyText—
speedNumber—

Returns

resultTrigger Condition
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Triggers
Package
Physics Simulation

On Contact

Function

When a body starts touching another body, or anything.

Signature
OnContact -> Trigger Condition
    body: Text
    other: Text
    minSpeed: Number
TriggerCondition OnContact(
    string body,
    string other = "",
    double minSpeed = 0)

Parameters

nametypedefaultdescription
bodyText—The body (or a spawned body's template name).
otherText—The other body; empty for anything.
minSpeedNumber0Only contacts that approach faster than this (m/s); 0 for any touch.

Returns

resultTrigger Condition
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Triggers
Package
Physics Simulation

Push

Function

Give a body an impulse (N·s), as a kick or a thrust.

Signature
Push(body: Text, impulse: Vector3d) -> Trigger Action
TriggerAction Push(string body, Vector3d impulse)

Parameters

nametypedefaultdescription
bodyText—
impulseVector3d—

Returns

resultTrigger Action
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Triggers
Package
Physics Simulation

Release

Function

Make a static or kinematic body (and the copies spawned from it) dynamic, so it starts to fall and be pushed.

Signature
Release(body: Text) -> Trigger Action
TriggerAction Release(string body)

Parameters

nametypedefaultdescription
bodyText—

Returns

resultTrigger Action
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Triggers
Package
Physics Simulation

Remove

Function

Take 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.

Signature
Remove(body: Text, atEvent: Truth) -> Trigger Action
TriggerAction Remove(string body, bool atEvent = false)

Parameters

nametypedefaultdescription
bodyText—The body, or the template whose copies are removed.
atEventTruthFalseRemove only the event's own body (the one that touched, crossed the height or went too fast), if it is one of these.

Returns

resultTrigger Action
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Triggers
Package
Physics Simulation

Set Wind

Function

Change the steady wind (m/s).

Signature
SetWind(velocity: Vector3d) -> Trigger Action
TriggerAction SetWind(Vector3d velocity)

Parameters

nametypedefaultdescription
velocityVector3d—

Returns

resultTrigger Action
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Triggers
Package
Physics Simulation

Spawn

Function

Add a copy of a body, named after it with a running number ("drop#1").

Signature
Spawn -> Trigger Action
    body: Body Description
    atEvent: Truth
    scatter: Vector3d
TriggerAction Spawn(
    BodyDescription body,
    bool atEvent = false,
    Vector3d scatter)

Parameters

nametypedefaultdescription
bodyBody Description—The body to copy; its position is where copies appear.
atEventTruthFalsePlace the copy at the event (offset by the body's position) instead.
scatterVector3d—Half-size of a box (m) the position is scattered in with the scene's seed; zero for none.

Returns

resultTrigger Action
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Triggers
Package
Physics Simulation

Unpin Cloth

Function

Let go of a cloth's pinned vertices.

Signature
UnpinCloth(cloth: Text) -> Trigger Action
TriggerAction UnpinCloth(string cloth)

Parameters

nametypedefaultdescription
clothText—

Returns

resultTrigger Action
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Triggers
Package
Physics Simulation

Watch

Function

A trigger that only records an event (for sampling, or for a procedural graph to react to), taking no action.

Signature
Watch -> Trigger Description
    name: Text
    condition: Trigger Condition
    repeat: Truth
TriggerDescription Watch(
    string name,
    TriggerCondition condition,
    bool repeat = false)

Parameters

nametypedefaultdescription
nameText—
conditionTrigger Condition—
repeatTruthFalse

Returns

resultTrigger Description
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Triggers
Package
Physics Simulation

Water In Region

Function

When at least a number of water particles are inside a box: a level sensor, a flood alarm, a splash detector.

Signature
WaterInRegion -> Trigger Condition
    regionMin: Vector3d
    regionMax: Vector3d
    particles: Integer
TriggerCondition WaterInRegion(
    Vector3d regionMin,
    Vector3d regionMax,
    int particles = 1)

Parameters

nametypedefaultdescription
regionMinVector3d—Lower corner of the box (m).
regionMaxVector3d—Upper corner of the box (m).
particlesInteger1How many particles must be inside.

Returns

resultTrigger Condition
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Triggers
Package
Physics Simulation

When

Function

A trigger: when the condition holds, take the action.

Signature
When -> Trigger Description
    name: Text
    condition: Trigger Condition
    action: Trigger Action
    repeat: Truth
    cooldown: Number
TriggerDescription When(
    string name,
    TriggerCondition condition,
    TriggerAction action,
    bool repeat = false,
    double cooldown = 0)

Parameters

nametypedefaultdescription
nameText—The name its events carry.
conditionTrigger Condition—What to wait for.
actionTrigger Action—What to do.
repeatTruthFalseFire every time the condition holds again, not only the first time (an "every" condition always repeats).
cooldownNumber0A repeating trigger stays quiet this long after firing (s).

Returns

resultTrigger Description
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Triggers
Package
Physics Simulation