Scene
23 nodes
On this page 23
Add Body
FunctionThe scene with a body added. Names must be unique within a scene.
AddBody -> Scene Description
scene: Scene Description
body: Body DescriptionSceneDescription AddBody(
SceneDescription scene,
BodyDescription body)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Scene Description | — | |
| body | Body Description | — |
Returns
| result | Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation
Add Cloth
FunctionThe scene with a rectangular cloth, lying flat (in the XY plane) at Center; it falls and drapes unless pinned.
AddCloth -> Scene Description
scene: Scene Description
name: Text
center: Vector3d
sizeX: Number
sizeY: Number
cells: Integer
density: Number
bendingStiffness: Number
friction: Number
pin: Cloth PinSceneDescription AddCloth(
SceneDescription scene,
string name,
Vector3d center,
double sizeX = 1,
double sizeY = 1,
int cells = 32,
double density = 0.2,
double bendingStiffness = 1E-05,
double friction = 0.4,
ClothPin pin = ClothPin.None)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Scene Description | — | The scene. |
| name | Text | — | The cloth's name. |
| center | Vector3d | — | Centre of the sheet (m). |
| sizeX | Number | 1 | Extent along X (m). |
| sizeY | Number | 1 | Extent along Y (m). |
| cells | Integer | 32 | Cells along the longer side; the shorter side gets as many as keep them square. |
| density | Number | 0.2 | Areal density (kg/m²): 0.1 to 0.3 for light fabrics, 0.5 and more for canvas. |
| bendingStiffness | Number | 1E-05 | Bending stiffness (N·m): 1e-5 drapes like cotton, 1e-3 like card. |
| friction | Number | 0.4 | Friction coefficient. |
| pin | Cloth Pin | None | Which vertices are held in place. |
Returns
| result | Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation
Add Cloth Mesh
FunctionThe scene with a cloth made from a Divooka mesh, as it is placed in the world (a garment, a flag, a tablecloth).
AddClothMesh -> Scene Description
scene: Scene Description
name: Text
mesh: Streamed Vertex Mesh Data
unitScale: Number
density: Number
bendingStiffness: Number
friction: Number
pin: Cloth PinSceneDescription AddClothMesh(
SceneDescription scene,
string name,
StreamedVertexMeshData mesh,
double unitScale = 1,
double density = 0.2,
double bendingStiffness = 1E-05,
double friction = 0.4,
ClothPin pin = ClothPin.None)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Scene Description | — | The scene. |
| name | Text | — | The cloth's name. |
| mesh | Streamed Vertex Mesh Data | — | The cloth's surface, in Divooka's axes; polygons are split into triangles. |
| unitScale | Number | 1 | Metres per mesh unit: 1 for metres, 0.001 for millimetres. |
| density | Number | 0.2 | Areal density (kg/m²). |
| bendingStiffness | Number | 1E-05 | Bending stiffness (N·m). |
| friction | Number | 0.4 | Friction coefficient. |
| pin | Cloth Pin | None | Which vertices are held in place, judged on the mesh's bounds. |
Returns
| result | Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation
Add Garment
FunctionThe scene with a garment made in Methodox Cloth Designer, as the designer draped it, and the body it was draped on.
AddGarment -> Scene Description
scene: Scene Description
name: Text
path: Text
position: Vector3d
turn: Number
withBody: Truth
weldSeams: TruthSceneDescription AddGarment(
SceneDescription scene,
string name,
string path,
Vector3d position,
double turn = 0,
bool withBody = true,
bool weldSeams = true)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Scene Description | — | The scene. |
| name | Text | — | The garment's name; its pieces are named after it. |
| path | Text | — | The .mgarment file an export from Methodox Cloth Designer wrote. |
| position | Vector3d | — | Where the floor point under the wearer goes (m). |
| turn | Number | 0 | How far the wearer is turned about the vertical, in degrees, anticlockwise seen from above. |
| withBody | Truth | True | Add the body the garment was draped on, when the file has it. Without one the garment falls. |
| weldSeams | Truth | True | Weld the stitches that start shut, so that their seams hold at one point; off, every stitch is sewn and a seam under load keeps a gap of a millimetre or so. |
Returns
| result | Scene Description |
Remarks
Each pattern piece becomes a cloth named garment/piece (tee/front, tee/sleeve.l), woven, with the stiffness of its fabric along the warp and the weft, cut to its flat pattern and starting where the designer's drape left it; the seams become stitches between them, welded where the drape left them shut (every seam the designer welded) and sewn where it left them open (a gathered seam's). The body becomes a static mesh body named garment/body. From there the garment is cloth like any other in the scene: wind blows it, bodies thrown at it move it, and ContinuumResults.GarmentMesh reads it back as one surface. The garment file's frame has y up and the wearer facing +z, which arrives here standing on Z and facing +X.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation
Add Tiled Slab
FunctionThe scene with a slab of ground laid as breakable tiles, named name#1, name#2 …, lying with their tops at Center's height: ground that a blow or a blast cracks and throws. Conditions and actions naming Name match every tile.
AddTiledSlab -> Scene Description
scene: Scene Description
name: Text
center: Vector3d
sizeX: Number
sizeY: Number
thickness: Number
tilesX: Integer
tilesY: Integer
density: Number
breakImpulse: NumberSceneDescription AddTiledSlab(
SceneDescription scene,
string name,
Vector3d center,
double sizeX,
double sizeY,
double thickness,
int tilesX = 6,
int tilesY = 6,
double density = 2500,
double breakImpulse = 500)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Scene Description | — | The scene. |
| name | Text | — | The slab's name. |
| center | Vector3d | — | Centre of the slab's top face (m). |
| sizeX | Number | — | Extent along X (m). |
| sizeY | Number | — | Extent along Y (m). |
| thickness | Number | — | Thickness (m). |
| tilesX | Integer | 6 | Tiles along X. |
| tilesY | Integer | 6 | Tiles along Y. |
| density | Number | 2500 | Density (kg/m³): stone 2500. |
| breakImpulse | Number | 500 | Impulse (N·s) that shatters a tile; zero for tiles that are thrown but never break. |
Returns
| result | Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation
Add Trigger
FunctionThe scene with a trigger added; triggers are evaluated after every coupling step in the order they were added.
AddTrigger -> Scene Description
scene: Scene Description
trigger: Trigger DescriptionSceneDescription AddTrigger(
SceneDescription scene,
TriggerDescription trigger)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Scene Description | — | |
| trigger | Trigger Description | — |
Returns
| result | Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation
Add Water
FunctionThe scene with SPH water in a tank, filling a region of it at the start. The tank's walls and floor hold the water only: bodies do not collide with them, so put a ground or walls of static bodies where bodies need them.
AddWater -> Scene Description
scene: Scene Description
name: Text
tankMin: Vector3d
tankMax: Vector3d
fillMin: Vector3d
fillMax: Vector3d
particleRadius: Number
viscosity: NumberSceneDescription AddWater(
SceneDescription scene,
string name,
Vector3d tankMin,
Vector3d tankMax,
Vector3d fillMin,
Vector3d fillMax,
double particleRadius = 0.01,
double viscosity = 1E-06)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Scene Description | — | The scene. |
| name | Text | — | The water's name. |
| tankMin | Vector3d | — | Lower corner of the tank (m). |
| tankMax | Vector3d | — | Upper corner of the tank (m); its top is open. |
| fillMin | Vector3d | — | Lower corner of the water at the start (m). |
| fillMax | Vector3d | — | Upper corner of the water at the start (m). |
| particleRadius | Number | 0.01 | Particle radius (m); bodies need a few particles across their thinnest side. Halving it costs about sixteen times more. |
| viscosity | Number | 1E-06 | Kinematic viscosity (m²/s); water is 1e-6. |
Returns
| result | Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation
Add Water Tank
FunctionThe scene with a tank filled with SPH water to a depth.
AddWaterTank -> Scene Description
scene: Scene Description
name: Text
tankMin: Vector3d
tankMax: Vector3d
depth: Number
particleRadius: NumberSceneDescription AddWaterTank(
SceneDescription scene,
string name,
Vector3d tankMin,
Vector3d tankMax,
double depth,
double particleRadius = 0.01)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Scene Description | — | The scene. |
| name | Text | — | The water's name. |
| tankMin | Vector3d | — | Lower corner of the tank (m); the water starts at its floor. |
| tankMax | Vector3d | — | Upper corner of the tank (m). |
| depth | Number | — | Depth of the water (m). |
| particleRadius | Number | 0.01 | Particle radius (m). |
Returns
| result | Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation
Box
FunctionA box.
Box -> Body Description
name: Text
size: Vector3d
position: Vector3d
motion: Body Motion
density: Number
friction: Number
restitution: NumberBodyDescription Box(
string name,
Vector3d size,
Vector3d position,
BodyMotion motion = BodyMotion.Dynamic,
double density = 1000,
double friction = 0.6,
double restitution = 0.1)Parameters
| name | type | default | description |
|---|---|---|---|
| name | Text | — | The body's name. |
| size | Vector3d | — | Full size along X, Y and Z (m). |
| position | Vector3d | — | Centre (m). |
| motion | Body Motion | Dynamic | Static, dynamic or kinematic. |
| density | Number | 1000 | Density (kg/m³): wood 600, water 1000, concrete 2400, steel 7850. |
| friction | Number | 0.6 | Friction coefficient. |
| restitution | Number | 0.1 | Bounciness, 0 to 1. |
Returns
| result | Body Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation
Breakable
FunctionThe body made breakable: a blow (the impulse through one contact during an impact) or a blast whose impulse on it reaches Impulse shatters it into Voronoi fragments, which fly on with its motion.
Breakable -> Body Description
body: Body Description
impulse: Number
pieces: IntegerBodyDescription Breakable(
BodyDescription body,
double impulse,
int pieces = 8)Parameters
| name | type | default | description |
|---|---|---|---|
| body | Body Description | — | A dynamic body (box, cylinder, capsule, sphere or convex mesh). |
| impulse | Number | — | Breaking impulse (N·s): a few hundred for brittle stone a hammer can crack, thousands for a concrete column. |
| pieces | Integer | 8 | Fragments it shatters into. |
Returns
| result | Body Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation
Capsule
FunctionAn upright capsule (its axis along Z): a cylinder with hemispherical ends.
Capsule -> Body Description
name: Text
radius: Number
length: Number
position: Vector3d
motion: Body Motion
density: Number
friction: Number
restitution: NumberBodyDescription Capsule(
string name,
double radius,
double length,
Vector3d position,
BodyMotion motion = BodyMotion.Dynamic,
double density = 1000,
double friction = 0.6,
double restitution = 0.1)Parameters
| name | type | default | description |
|---|---|---|---|
| name | Text | — | The body's name. |
| radius | Number | — | Radius (m). |
| length | Number | — | Total length, ends included (m); at least twice the radius. |
| position | Vector3d | — | Centre (m). |
| motion | Body Motion | Dynamic | Static, dynamic or kinematic. |
| density | Number | 1000 | Density (kg/m³). |
| friction | Number | 0.6 | Friction coefficient. |
| restitution | Number | 0.1 | Bounciness, 0 to 1. |
Returns
| result | Body Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation
Coloured
FunctionThe body drawn in a colour: the 3D view, and the moments and runs it draws, show it so. An alpha below 255 lets what stands behind it show through - glass at about 60, a tinted pane at 120. Copies a trigger spawns and the fragments it breaks into are drawn in it too. A body given no colour is drawn in its kind's: see-through glass for a static body, steel for a kinematic one, and one of a few soft colours, in turn, for a moving one.
Coloured -> Body Description
body: Body Description
colour: ColorBodyDescription Coloured(
BodyDescription body,
ColorElement colour)Parameters
| name | type | default | description |
|---|---|---|---|
| body | Body Description | — | The body. |
| colour | Color | — | Its colour; the alpha is how much of what is behind it it hides. |
Returns
| result | Body Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation
Cylinder
FunctionAn upright cylinder (its axis along Z); turn it with Rotated or Rotated About.
Cylinder -> Body Description
name: Text
radius: Number
length: Number
position: Vector3d
motion: Body Motion
density: Number
friction: Number
restitution: NumberBodyDescription Cylinder(
string name,
double radius,
double length,
Vector3d position,
BodyMotion motion = BodyMotion.Dynamic,
double density = 1000,
double friction = 0.6,
double restitution = 0.1)Parameters
| name | type | default | description |
|---|---|---|---|
| name | Text | — | The body's name. |
| radius | Number | — | Radius (m). |
| length | Number | — | Length along its axis (m). |
| position | Vector3d | — | Centre (m). |
| motion | Body Motion | Dynamic | Static, dynamic or kinematic. |
| density | Number | 1000 | Density (kg/m³). |
| friction | Number | 0.6 | Friction coefficient. |
| restitution | Number | 0.1 | Bounciness, 0 to 1. |
Returns
| result | Body Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation
Garment Pieces
FunctionThe names of a garment's pieces in a scene, as cloths: tee/front, tee/back and so on.
GarmentPieces -> Text Array
scene: Scene Description
garment: Textstring[] GarmentPieces(SceneDescription scene, string garment)
Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Scene Description | — | |
| garment | Text | — |
Returns
| result | Text Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation
Ground
FunctionAn infinite ground plane at a height, solid below.
Ground -> Body Description
name: Text
height: Number
friction: NumberBodyDescription Ground(
string name = "ground",
double height = 0,
double friction = 0.6)Parameters
| name | type | default | description |
|---|---|---|---|
| name | Text | ground | The body's name. |
| height | Number | 0 | Height of the plane (m). |
| friction | Number | 0.6 | Friction coefficient. |
Returns
| result | Body Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation
Launched
FunctionThe body with an initial velocity (m/s).
Launched -> Body Description
body: Body Description
velocity: Vector3dBodyDescription Launched(
BodyDescription body,
Vector3d velocity)Parameters
| name | type | default | description |
|---|---|---|---|
| body | Body Description | — | |
| velocity | Vector3d | — |
Returns
| result | Body Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation
Mesh Body
FunctionA body from a Divooka mesh: static meshes collide exactly (terrain, a car body in a tunnel, a ship's hull as an obstacle); moving ones collide as the mesh's convex hull. The mesh is placed with its own origin at Position.
MeshBody -> Body Description
name: Text
mesh: Streamed Vertex Mesh Data
position: Vector3d
motion: Body Motion
unitScale: Number
density: Number
friction: Number
restitution: NumberBodyDescription MeshBody(
string name,
StreamedVertexMeshData mesh,
Vector3d position,
BodyMotion motion = BodyMotion.Static,
double unitScale = 1,
double density = 1000,
double friction = 0.6,
double restitution = 0.1)Parameters
| name | type | default | description |
|---|---|---|---|
| name | Text | — | The body's name. |
| mesh | Streamed Vertex Mesh Data | — | The mesh, in Divooka's axes; polygons are split into triangles. |
| position | Vector3d | — | Where the mesh's origin goes (m). |
| motion | Body Motion | Static | Static (exact triangles), dynamic or kinematic (convex hull). |
| unitScale | Number | 1 | Metres per mesh unit: 1 for metres, 0.001 for millimetres. |
| density | Number | 1000 | Density (kg/m³), for moving bodies. |
| friction | Number | 0.6 | Friction coefficient. |
| restitution | Number | 0.1 | Bounciness, 0 to 1. |
Returns
| result | Body Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation
New Scene
FunctionAn empty scene: Earth gravity along -Z and the default solver rates.
NewScene -> Scene Description
gravity: Number
couplingRate: Number
clothSubsteps: Integer
seed: IntegerSceneDescription NewScene(
double gravity = 9.81,
double couplingRate = 120,
int clothSubsteps = 15,
int seed = 1)Parameters
| name | type | default | description |
|---|---|---|---|
| gravity | Number | 9.81 | Gravitational acceleration (m/s²), pointing down along -Z. |
| couplingRate | Number | 120 | How many times per second the solvers exchange forces (Hz): 120 for rigid bodies and cloth, 200 to 480 when light bodies float in water. |
| clothSubsteps | Integer | 15 | Constraint sub-steps of the cloth solver per coupling step: 10 for soft cloth, 15 to 20 for hanging or loaded cloth. |
| seed | Integer | 1 | Seed of the random numbers triggers scatter spawned bodies with. |
Returns
| result | Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation
Rotated
FunctionThe body turned by a rotation about its centre.
Rotated -> Body Description
body: Body Description
rotation: QuaterniondBodyDescription Rotated(
BodyDescription body,
Quaterniond rotation)Parameters
| name | type | default | description |
|---|---|---|---|
| body | Body Description | — | |
| rotation | Quaterniond | — |
Returns
| result | Body Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation
Rotated About
FunctionThe body turned about an axis by an angle in degrees.
RotatedAbout -> Body Description
body: Body Description
axis: Vector3d
degrees: NumberBodyDescription RotatedAbout(
BodyDescription body,
Vector3d axis,
double degrees)Parameters
| name | type | default | description |
|---|---|---|---|
| body | Body Description | — | |
| axis | Vector3d | — | |
| degrees | Number | — |
Returns
| result | Body Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation
Set Gravity
FunctionThe scene with a gravity vector of any direction (m/s²).
SetGravity -> Scene Description
scene: Scene Description
gravity: Vector3dSceneDescription SetGravity(
SceneDescription scene,
Vector3d gravity)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Scene Description | — | |
| gravity | Vector3d | — |
Returns
| result | Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation
Set Wind
FunctionThe scene with a steady wind that pushes cloth, bodies and water, with optional gusts.
SetWind -> Scene Description
scene: Scene Description
velocity: Vector3d
gusts: NumberSceneDescription SetWind(
SceneDescription scene,
Vector3d velocity,
double gusts = 0)Parameters
| name | type | default | description |
|---|---|---|---|
| scene | Scene Description | — | The scene. |
| velocity | Vector3d | — | Wind velocity (m/s). |
| gusts | Number | 0 | Gust amplitude (m/s). |
Returns
| result | Scene Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation
Sphere
FunctionA sphere.
Sphere -> Body Description
name: Text
radius: Number
position: Vector3d
motion: Body Motion
density: Number
friction: Number
restitution: NumberBodyDescription Sphere(
string name,
double radius,
Vector3d position,
BodyMotion motion = BodyMotion.Dynamic,
double density = 1000,
double friction = 0.6,
double restitution = 0.1)Parameters
| name | type | default | description |
|---|---|---|---|
| name | Text | — | The body's name. |
| radius | Number | — | Radius (m). |
| position | Vector3d | — | Centre (m). |
| motion | Body Motion | Dynamic | Static, dynamic or kinematic. |
| density | Number | 1000 | Density (kg/m³). |
| friction | Number | 0.6 | Friction coefficient. |
| restitution | Number | 0.1 | Bounciness, 0 to 1. |
Returns
| result | Body Description |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Scene
- Package
- Physics Simulation