Divooka Reference

Liquid Session

22 nodes

On this page 22

Add Liquid Box

Function

Pours a box of liquid into the tank now; returns how many particles it became.

Signature
AddLiquidBox -> Integer
    Liquid Session: Liquid Session
    position: Vector3d
    size: Vector3d
    velocity: Vector3d
int AddLiquidBox(
    LiquidSession Liquid Session,
    Vector3d position,
    Vector3d size,
    Vector3d velocity)

Parameters

nametypedefaultdescription
Liquid SessionLiquid Session—
positionVector3d—The box's centre (m).
sizeVector3d—The box's size (m) along X, Y and Z.
velocityVector3d—The velocity it starts with (m/s).

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Liquid Session
Package
Physics Simulation

Add Liquid Sphere

Function

Pours a ball of liquid into the tank now; returns how many particles it became. The tank holds about twice the liquid it started with.

Signature
AddLiquidSphere -> Integer
    Liquid Session: Liquid Session
    position: Vector3d
    radius: Number
    velocity: Vector3d
int AddLiquidSphere(
    LiquidSession Liquid Session,
    Vector3d position,
    double radius,
    Vector3d velocity)

Parameters

nametypedefaultdescription
Liquid SessionLiquid Session—
positionVector3d—The ball's centre (m).
radiusNumber—The ball's radius (m).
velocityVector3d—The velocity it starts with (m/s).

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Liquid Session
Package
Physics Simulation

Advance

Function

Advances the liquid by a span of simulated time (s), in steps of at most a sixtieth of a second.

Signature
Advance(Liquid Session: Liquid Session, seconds: Number)
void Advance(LiquidSession Liquid Session, double seconds)

Parameters

nametypedefaultdescription
Liquid SessionLiquid Session—
secondsNumber—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Liquid Session
Package
Physics Simulation

Aim Tap

Function

Gives a tap's liquid another velocity (m/s): its direction, and with a full jet how much it pours.

Signature
AimTap
    Liquid Session: Liquid Session
    name: Text
    velocity: Vector3d
void AimTap(
    LiquidSession Liquid Session,
    string name,
    Vector3d velocity)

Parameters

nametypedefaultdescription
Liquid SessionLiquid Session—
nameText—The tap's name.
velocityVector3d—The velocity the liquid leaves with (m/s).
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Liquid Session
Package
Physics Simulation

Body Position

Function

Where a body or a solid is now (m).

Signature
BodyPosition -> Vector3d
    Liquid Session: Liquid Session
    name: Text
Vector3d BodyPosition(LiquidSession Liquid Session, string name)

Parameters

nametypedefaultdescription
Liquid SessionLiquid Session—
nameText—Its name.

Returns

resultVector3d
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Liquid Session
Package
Physics Simulation

Body Rotation

Function

How a body is turned now.

Signature
BodyRotation -> Quaterniond
    Liquid Session: Liquid Session
    name: Text
Quaterniond BodyRotation(
    LiquidSession Liquid Session,
    string name)

Parameters

nametypedefaultdescription
Liquid SessionLiquid Session—
nameText—Its name.

Returns

resultQuaterniond
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Liquid Session
Package
Physics Simulation

Body Velocity

Function

How fast a body moves now (m/s).

Signature
BodyVelocity -> Vector3d
    Liquid Session: Liquid Session
    name: Text
Vector3d BodyVelocity(LiquidSession Liquid Session, string name)

Parameters

nametypedefaultdescription
Liquid SessionLiquid Session—
nameText—Its name.

Returns

resultVector3d
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Liquid Session
Package
Physics Simulation

Capture Bodies

Function

The scene's bodies and solids as they are now, as a moment the 3D view draws.

Signature
CaptureBodies(Liquid Session: Liquid Session) -> Simulation Frame
SimulationFrame CaptureBodies(LiquidSession Liquid Session)

Parameters

nametypedefaultdescription
Liquid SessionLiquid Session—

Returns

resultSimulation Frame
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Liquid Session
Package
Physics Simulation

Dispose

Function

Ends the session and gives its memory on the graphics card back.

Signature
Dispose(Liquid Session: Liquid Session)
void Dispose(LiquidSession Liquid Session)

Parameters

nametypedefaultdescription
Liquid SessionLiquid Session—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Liquid Session
Package
Physics Simulation

Frame

Function

How many frames Step Frame has stepped.

Signature
Frame(Liquid Session: Liquid Session) -> Integer
int Frame(LiquidSession Liquid Session)

Parameters

nametypedefaultdescription
Liquid SessionLiquid Session—

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Liquid Session
Package
Physics Simulation

Particle Count

Function

How many particles the liquid is now.

Signature
ParticleCount(Liquid Session: Liquid Session) -> Integer
int ParticleCount(LiquidSession Liquid Session)

Parameters

nametypedefaultdescription
Liquid SessionLiquid Session—

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Liquid Session
Package
Physics Simulation

Scene

Function

The scene the session started from (what was poured in or moved since is not in it).

Signature
Scene(Liquid Session: Liquid Session) -> Liquid Scene Description
LiquidSceneDescription Scene(LiquidSession Liquid Session)

Parameters

nametypedefaultdescription
Liquid SessionLiquid Session—

Returns

resultLiquid Scene Description
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Liquid Session
Package
Physics Simulation

Time

Function

Simulated time (s).

Signature
Time(Liquid Session: Liquid Session) -> Number
double Time(LiquidSession Liquid Session)

Parameters

nametypedefaultdescription
Liquid SessionLiquid Session—

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Liquid Session
Package
Physics Simulation

Move Solid

Function

Moves a solid, or a kinematic body, to a new place (m). It gets there over the next step and pushes the liquid, and the bodies, in its way as it goes.

Signature
MoveSolid
    Liquid Session: Liquid Session
    name: Text
    position: Vector3d
void MoveSolid(
    LiquidSession Liquid Session,
    string name,
    Vector3d position)

Parameters

nametypedefaultdescription
Liquid SessionLiquid Session—
nameText—The solid's name.
positionVector3d—Its new centre (m).
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Liquid Session
Package
Physics Simulation

Move Tap

Function

Moves a tap's mouth to a new place (m); it pours from there on. A hose swung about.

Signature
MoveTap
    Liquid Session: Liquid Session
    name: Text
    position: Vector3d
void MoveTap(
    LiquidSession Liquid Session,
    string name,
    Vector3d position)

Parameters

nametypedefaultdescription
Liquid SessionLiquid Session—
nameText—The tap's name.
positionVector3d—The new middle of its mouth (m).
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Liquid Session
Package
Physics Simulation

Push Body

Function

Gives a moving body a push at its centre: an impulse (N·s), its mass times the change of velocity.

Signature
PushBody
    Liquid Session: Liquid Session
    name: Text
    impulse: Vector3d
void PushBody(
    LiquidSession Liquid Session,
    string name,
    Vector3d impulse)

Parameters

nametypedefaultdescription
Liquid SessionLiquid Session—
nameText—The body's name.
impulseVector3d—The impulse (N·s).
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Liquid Session
Package
Physics Simulation

Render

Function

A picture of the scene as it is now: the ground, the solids and the liquid with its whitewater, lit by the sun.

Signature
Render -> Pixel Image
    Liquid Session: Liquid Session
    eye: Vector3d
    target: Vector3d
    width: Integer
    height: Integer
    fieldOfView: Number
PixelImage Render(
    LiquidSession Liquid Session,
    Vector3d eye,
    Vector3d target,
    int width = 640,
    int height = 480,
    double fieldOfView = 40)

Parameters

nametypedefaultdescription
Liquid SessionLiquid Session—
eyeVector3d—Where the camera stands (m).
targetVector3d—What it looks at (m).
widthInteger640The picture's width in pixels.
heightInteger480The picture's height in pixels.
fieldOfViewNumber40The camera's vertical field of view in degrees.

Returns

resultPixel Image
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Liquid Session
Package
Physics Simulation

Step Frame

Function

Advances the liquid by one frame of a frame rate.

Signature
StepFrame
    Liquid Session: Liquid Session
    framesPerSecond: Number
void StepFrame(
    LiquidSession Liquid Session,
    double framesPerSecond = 30)

Parameters

nametypedefaultdescription
Liquid SessionLiquid Session—
framesPerSecondNumber30
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Liquid Session
Package
Physics Simulation

Surface

Function

The liquid's surface as it was at the last step, as a mesh: closed where it meets the tank, its triangles facing outwards.

Signature
Surface -> Streamed Vertex Mesh Data
    Liquid Session: Liquid Session
    smoothing: Integer
StreamedVertexMeshData Surface(
    LiquidSession Liquid Session,
    int smoothing = 2)

Parameters

nametypedefaultdescription
Liquid SessionLiquid Session—
smoothingInteger2How often the surface is smoothed before it is meshed.

Returns

resultStreamed Vertex Mesh Data
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Liquid Session
Package
Physics Simulation

Switch Tap

Function

Opens or closes a tap.

Signature
SwitchTap
    Liquid Session: Liquid Session
    name: Text
    open: Truth
void SwitchTap(
    LiquidSession Liquid Session,
    string name,
    bool open = true)

Parameters

nametypedefaultdescription
Liquid SessionLiquid Session—
nameText—The tap's name.
openTruthTrueOpen: it pours. Closed: it does not.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Liquid Session
Package
Physics Simulation

Take Events

Function

What the scene's triggers have done since the last call, oldest first: an event for each time one fired, with its time, its place and the body it was about. Empty when nothing fired, or the scene has no triggers.

Signature
TakeEvents(Liquid Session: Liquid Session) -> Simulation Event Array
SimulationEvent[] TakeEvents(LiquidSession Liquid Session)

Parameters

nametypedefaultdescription
Liquid SessionLiquid Session—

Returns

resultSimulation Event Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Liquid Session
Package
Physics Simulation

Start

Function

Starts a session from a liquid scene.

Signature
Start(scene: Liquid Scene Description) -> Liquid Session
LiquidSession Start(LiquidSceneDescription scene)

Parameters

nametypedefaultdescription
sceneLiquid Scene Description—The scene.

Returns

resultLiquid Session
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Liquid Session
Package
Physics Simulation