Divooka Reference

Simulation Session

29 nodes

On this page 29

Add Body

Function

Adds a body to the running scene.

Signature
AddBody
    Simulation Session: Simulation Session
    body: Body Description
void AddBody(
    SimulationSession Simulation Session,
    BodyDescription body)

Parameters

nametypedefaultdescription
Simulation SessionSimulation Session—
bodyBody Description—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Simulation Session
Package
Physics Simulation

Advance

Function

Advances the simulation by a span of simulated time (s), in coupling steps.

Signature
Advance(Simulation Session: Simulation Session, seconds: Number)
void Advance(
    SimulationSession Simulation Session,
    double seconds)

Parameters

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

Bodies Mesh

Function

Every body's surface now as one mesh, grounds left out.

Signature
BodiesMesh(Simulation Session: Simulation Session) -> Streamed Vertex Mesh Data
StreamedVertexMeshData BodiesMesh(SimulationSession Simulation Session)

Parameters

nametypedefaultdescription
Simulation SessionSimulation Session—

Returns

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

Body Names

Function

The names of the bodies now, in the order they were made.

Signature
BodyNames(Simulation Session: Simulation Session) -> Text Array
string[] BodyNames(SimulationSession Simulation Session)

Parameters

nametypedefaultdescription
Simulation SessionSimulation Session—

Returns

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

Body Position

Function

Where a body is now (m).

Signature
BodyPosition -> Vector3d
    Simulation Session: Simulation Session
    body: Text
Vector3d BodyPosition(
    SimulationSession Simulation Session,
    string body)

Parameters

nametypedefaultdescription
Simulation SessionSimulation Session—
bodyText—

Returns

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

Body Rotation

Function

A body's orientation now.

Signature
BodyRotation -> Quaterniond
    Simulation Session: Simulation Session
    body: Text
Quaterniond BodyRotation(
    SimulationSession Simulation Session,
    string body)

Parameters

nametypedefaultdescription
Simulation SessionSimulation Session—
bodyText—

Returns

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

Body Velocity

Function

A body's velocity now (m/s).

Signature
BodyVelocity -> Vector3d
    Simulation Session: Simulation Session
    body: Text
Vector3d BodyVelocity(
    SimulationSession Simulation Session,
    string body)

Parameters

nametypedefaultdescription
Simulation SessionSimulation Session—
bodyText—

Returns

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

Capture

Function

The state now as an immutable frame, for the functional nodes or to keep.

Signature
Capture -> Simulation Frame
    Simulation Session: Simulation Session
    recordWater: Truth
SimulationFrame Capture(
    SimulationSession Simulation Session,
    bool recordWater = true)

Parameters

nametypedefaultdescription
Simulation SessionSimulation Session—
recordWaterTruthTrue

Returns

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

Cloth Mesh

Function

A cloth's surface now, for rendering.

Signature
ClothMesh -> Streamed Vertex Mesh Data
    Simulation Session: Simulation Session
    cloth: Text
StreamedVertexMeshData ClothMesh(
    SimulationSession Simulation Session,
    string cloth)

Parameters

nametypedefaultdescription
Simulation SessionSimulation Session—
clothText—

Returns

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

Detonate

Function

Sets off a charge of TNT at a position (m) now.

Signature
Detonate
    Simulation Session: Simulation Session
    position: Vector3d
    TNT (kg): Number
void Detonate(
    SimulationSession Simulation Session,
    Vector3d position,
    double tntKg)

Parameters

nametypedefaultdescription
Simulation SessionSimulation Session—
positionVector3d—Where (m).
TNT (kg)Number—Charge (kg TNT equivalent).
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Simulation Session
Package
Physics Simulation

Dispose

Function

Ends the session and frees the engine's state.

Signature
Dispose(Simulation Session: Simulation Session)
void Dispose(SimulationSession Simulation Session)

Parameters

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

Garment Mesh

Function

A whole garment's surface now as one mesh: every piece ContinuumScene.AddGarment made for it.

Signature
GarmentMesh -> Streamed Vertex Mesh Data
    Simulation Session: Simulation Session
    garment: Text
StreamedVertexMeshData GarmentMesh(
    SimulationSession Simulation Session,
    string garment)

Parameters

nametypedefaultdescription
Simulation SessionSimulation Session—
garmentText—The garment's name.

Returns

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

Frame

Function

How many frames Step Frame has stepped.

Signature
Frame(Simulation Session: Simulation Session) -> Integer
int Frame(SimulationSession Simulation Session)

Parameters

nametypedefaultdescription
Simulation SessionSimulation Session—

Returns

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

Scene

Function

The description the session started from (changes made while running are not in it).

Signature
Scene(Simulation Session: Simulation Session) -> Scene Description
SceneDescription Scene(SimulationSession Simulation Session)

Parameters

nametypedefaultdescription
Simulation SessionSimulation Session—

Returns

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

Time

Function

Simulated time (s).

Signature
Time(Simulation Session: Simulation Session) -> Number
double Time(SimulationSession Simulation Session)

Parameters

nametypedefaultdescription
Simulation SessionSimulation Session—

Returns

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

Move Kinematic

Function

Moves a kinematic body to a position (m) over the next coupling step, so everything it touches is pushed with its velocity.

Signature
MoveKinematic
    Simulation Session: Simulation Session
    body: Text
    position: Vector3d
void MoveKinematic(
    SimulationSession Simulation Session,
    string body,
    Vector3d position)

Parameters

nametypedefaultdescription
Simulation SessionSimulation Session—
bodyText—
positionVector3d—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Simulation Session
Package
Physics Simulation

Move Kinematic Pose

Function

Moves a kinematic body to a position (m) and orientation over the next coupling step: a hammer swung by the graph, a door, a paddle. Everything it touches is pushed with its linear and angular velocity.

Signature
MoveKinematicPose
    Simulation Session: Simulation Session
    body: Text
    position: Vector3d
    rotation: Quaterniond
void MoveKinematicPose(
    SimulationSession Simulation Session,
    string body,
    Vector3d position,
    Quaterniond rotation)

Parameters

nametypedefaultdescription
Simulation SessionSimulation Session—
bodyText—
positionVector3d—
rotationQuaterniond—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Simulation Session
Package
Physics Simulation

Push

Function

Gives a dynamic body an impulse (N·s).

Signature
Push
    Simulation Session: Simulation Session
    body: Text
    impulse: Vector3d
void Push(
    SimulationSession Simulation Session,
    string body,
    Vector3d impulse)

Parameters

nametypedefaultdescription
Simulation SessionSimulation Session—
bodyText—
impulseVector3d—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Simulation Session
Package
Physics Simulation

Release

Function

Makes a static or kinematic body dynamic: it starts to fall and be pushed.

Signature
Release(Simulation Session: Simulation Session, body: Text)
void Release(SimulationSession Simulation Session, string body)

Parameters

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

Remove Body

Function

Takes a body out of the running scene.

Signature
RemoveBody(Simulation Session: Simulation Session, body: Text)
void RemoveBody(
    SimulationSession Simulation Session,
    string body)

Parameters

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

Report

Function

The engine's report of what the scene holds and what each solver costs.

Signature
Report(Simulation Session: Simulation Session) -> Text
string Report(SimulationSession Simulation Session)

Parameters

nametypedefaultdescription
Simulation SessionSimulation Session—

Returns

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

Save Preview

Function

Renders the scene now on the CPU (no GPU needed) and saves it as a PNG; returns the path.

Signature
SavePreview -> Text
    Simulation Session: Simulation Session
    path: Text
    eye: Vector3d
    target: Vector3d
    width: Integer
    height: Integer
string SavePreview(
    SimulationSession Simulation Session,
    string path,
    Vector3d eye,
    Vector3d target,
    int width = 960,
    int height = 540)

Parameters

nametypedefaultdescription
Simulation SessionSimulation Session—
pathText—The PNG file.
eyeVector3d—Camera position (m).
targetVector3d—Point the camera looks at (m).
widthInteger960Image width (pixels).
heightInteger540Image height (pixels).

Returns

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

Set Gravity

Function

Changes gravity (m/s²).

Signature
SetGravity
    Simulation Session: Simulation Session
    gravity: Vector3d
void SetGravity(
    SimulationSession Simulation Session,
    Vector3d gravity)

Parameters

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

Set Wind

Function

Changes the steady wind (m/s) and its gusts (m/s).

Signature
SetWind
    Simulation Session: Simulation Session
    velocity: Vector3d
    gusts: Number
void SetWind(
    SimulationSession Simulation Session,
    Vector3d velocity,
    double gusts = 0)

Parameters

nametypedefaultdescription
Simulation SessionSimulation Session—
velocityVector3d—
gustsNumber0
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Simulation Session
Package
Physics Simulation

Step Frame

Function

Advances the simulation by one frame of a frame rate, as Simulate records a run.

Signature
StepFrame
    Simulation Session: Simulation Session
    framesPerSecond: Number
void StepFrame(
    SimulationSession Simulation Session,
    double framesPerSecond = 30)

Parameters

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

Take Events

Function

The events of the scene's triggers since the last call, oldest first: the place a procedural graph reacts to contacts, thresholds and timers.

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

Parameters

nametypedefaultdescription
Simulation SessionSimulation Session—

Returns

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

Unpin Cloth

Function

Lets go of a cloth's pinned vertices.

Signature
UnpinCloth(Simulation Session: Simulation Session, cloth: Text)
void UnpinCloth(
    SimulationSession Simulation Session,
    string cloth)

Parameters

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

Water Particles

Function

The positions of a water body's particles now (m).

Signature
WaterParticles -> Vector3d Array
    Simulation Session: Simulation Session
    water: Text
Vector3d[] WaterParticles(
    SimulationSession Simulation Session,
    string water)

Parameters

nametypedefaultdescription
Simulation SessionSimulation Session—
waterText—

Returns

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

Start

Function

Starts a session from a scene description.

Signature
Start -> Simulation Session
    scene: Scene Description
    threads: Integer
SimulationSession Start(SceneDescription scene, int threads = 0)

Parameters

nametypedefaultdescription
sceneScene Description—The scene.
threadsInteger0Worker threads; 0 uses the engine's shared pool. Results do not depend on it.

Returns

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