Header menu logo PhysicsSandbox

Vec3Builders Module

Conversion functions between F# tuples and protobuf Vec3 messages.

The simulation uses a Y-up coordinate system: +Y is up, +X is right, +Z is toward the camera. Ground plane is at Y=0. Gravity defaults to (0, -9.81, 0).

Functions and values

Function or value Description

toTuple arg1

Full Usage: toTuple arg1

Parameters:
Returns: float * float * float A tuple of (X, Y, Z).

Extracts the components of a Vec3 as a float triple (X, Y, Z).

arg0 : Vec3
Returns: float * float * float

A tuple of (X, Y, Z).

toVec3 arg1

Full Usage: toVec3 arg1

Parameters:
    arg0 : float * float * float

Returns: Vec3 A new Vec3 with the given coordinates.

Creates a protobuf Vec3 from a float triple.

arg0 : float * float * float
Returns: Vec3

A new Vec3 with the given coordinates.

Example

 let origin = toVec3 (0.0, 0.0, 0.0)       // world origin
 let above  = toVec3 (0.0, 10.0, 0.0)       // 10m above ground
 let gravity = toVec3 (0.0, -9.81, 0.0)     // standard Earth gravity
val origin: obj
val above: obj
val gravity: obj

Type something to start searching.