Divooka Reference

Ocean Session

16 nodes

On this page 16

Advance

Function

Advances the sea and the bodies on it by a span of simulated time (s).

Signature
Advance(Ocean Session: Ocean Session, seconds: Number)
void Advance(OceanSession Ocean Session, double seconds)

Parameters

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

Body Position

Function

Where a body is now (m).

Signature
BodyPosition -> Vector3d
    Ocean Session: Ocean Session
    name: Text
Vector3d BodyPosition(OceanSession Ocean Session, string name)

Parameters

nametypedefaultdescription
Ocean SessionOcean Session—
nameText—Its name.

Returns

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

Body Rotation

Function

How a body is turned now.

Signature
BodyRotation -> Quaterniond
    Ocean Session: Ocean Session
    name: Text
Quaterniond BodyRotation(
    OceanSession Ocean Session,
    string name)

Parameters

nametypedefaultdescription
Ocean SessionOcean Session—
nameText—Its name.

Returns

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

Body Velocity

Function

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

Signature
BodyVelocity -> Vector3d
    Ocean Session: Ocean Session
    name: Text
Vector3d BodyVelocity(OceanSession Ocean Session, string name)

Parameters

nametypedefaultdescription
Ocean SessionOcean Session—
nameText—Its name.

Returns

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

Capture Bodies

Function

The bodies as they are now, as a moment the 3D view draws.

Signature
CaptureBodies(Ocean Session: Ocean Session) -> Simulation Frame
SimulationFrame CaptureBodies(OceanSession Ocean Session)

Parameters

nametypedefaultdescription
Ocean SessionOcean Session—

Returns

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

Dispose

Function

Ends the session and gives back what it holds on the graphics card.

Signature
Dispose(Ocean Session: Ocean Session)
void Dispose(OceanSession Ocean Session)

Parameters

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

Frame

Function

How many frames Step Frame has stepped.

Signature
Frame(Ocean Session: Ocean Session) -> Integer
int Frame(OceanSession Ocean Session)

Parameters

nametypedefaultdescription
Ocean SessionOcean Session—

Returns

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

Scene

Function

The scene the session started from.

Signature
Scene(Ocean Session: Ocean Session) -> Ocean Scene Description
OceanSceneDescription Scene(OceanSession Ocean Session)

Parameters

nametypedefaultdescription
Ocean SessionOcean Session—

Returns

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

Time

Function

Simulated time (s).

Signature
Time(Ocean Session: Ocean Session) -> Number
double Time(OceanSession Ocean Session)

Parameters

nametypedefaultdescription
Ocean SessionOcean Session—

Returns

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

Height

Function

The sea's height (m) over a point now.

Signature
Height -> Number
    Ocean Session: Ocean Session
    position: Vector3d
double Height(OceanSession Ocean Session, Vector3d position)

Parameters

nametypedefaultdescription
Ocean SessionOcean Session—
positionVector3d—The point; its Z is not used.

Returns

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

Push Body

Function

Gives a body a push at its centre: an impulse (N·s), its mass times the change of velocity. A boat's engine, a gust.

Signature
PushBody
    Ocean Session: Ocean Session
    name: Text
    impulse: Vector3d
void PushBody(
    OceanSession Ocean Session,
    string name,
    Vector3d impulse)

Parameters

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

Render

Function

A picture of the sea as it is now, with the bodies on it. Made on the graphics card.

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

Parameters

nametypedefaultdescription
Ocean SessionOcean 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
Ocean Session
Package
Physics Simulation

Step Frame

Function

Advances the sea and the bodies on it by one frame of a frame rate.

Signature
StepFrame(Ocean Session: Ocean Session, framesPerSecond: Number)
void StepFrame(
    OceanSession Ocean Session,
    double framesPerSecond = 30)

Parameters

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

Surface

Function

The sea's surface over a rectangle now, as a mesh.

Signature
Surface -> Streamed Vertex Mesh Data
    Ocean Session: Ocean Session
    center: Vector3d
    Size X: Number
    Size Y: Number
    cells: Integer
StreamedVertexMeshData Surface(
    OceanSession Ocean Session,
    Vector3d center,
    double sizeX = 100,
    double sizeY = 100,
    int cells = 128)

Parameters

nametypedefaultdescription
Ocean SessionOcean Session—
centerVector3d—The rectangle's middle (m).
Size XNumber100Its extent along X (m).
Size YNumber100Its extent along Y (m).
cellsInteger128Cells along its longer side.

Returns

resultStreamed Vertex Mesh Data
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Ocean 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 sea has no triggers.

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

Parameters

nametypedefaultdescription
Ocean SessionOcean Session—

Returns

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

Start

Function

Starts a session from an ocean scene.

Signature
Start(scene: Ocean Scene Description) -> Ocean Session
OceanSession Start(OceanSceneDescription scene)

Parameters

nametypedefaultdescription
sceneOcean Scene Description—The sea.

Returns

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