Skip to main content

Type Alias: Physics

type Physics = {
engine: string;
gravity: Vec3;
timestepInS: Float;
epsilon: Float;
toleranceLength: Float;
toleranceSpeed: Float;
lmdMax: Float;
};

Defined in: node_modules/@3dverse/livelink.core/dist/_prebuild/engine_types/sceneSettings.d.ts:168

Settings for the physics engine.

Properties

engine

engine: string;

Defined in: node_modules/@3dverse/livelink.core/dist/_prebuild/engine_types/sceneSettings.d.ts:173

The engine that is powering the physics of the scene.

Default Value

physx;

gravity

gravity: Vec3;

Defined in: node_modules/@3dverse/livelink.core/dist/_prebuild/engine_types/sceneSettings.d.ts:178

Global gravity applied throughout the scene.

Default Value

(0, -9.8, 0);

timestepInS

timestepInS: Float;

Defined in: node_modules/@3dverse/livelink.core/dist/_prebuild/engine_types/sceneSettings.d.ts:183

A frame-rate-independent interval that dictates when physics calculations are performed.

Default Value

0.01666;

epsilon

epsilon: Float;

Defined in: node_modules/@3dverse/livelink.core/dist/_prebuild/engine_types/sceneSettings.d.ts:188

The epsilon used to mark whether the transform of an entity has changed and so whether to notify the physics engine.

Default Value

0.000001;

toleranceLength

toleranceLength: Float;

Defined in: node_modules/@3dverse/livelink.core/dist/_prebuild/engine_types/sceneSettings.d.ts:193

The approximate size of objects in the simulation. This is used to estimate certain length-related tolerances.

Default Value

1;

toleranceSpeed

toleranceSpeed: Float;

Defined in: node_modules/@3dverse/livelink.core/dist/_prebuild/engine_types/sceneSettings.d.ts:198

The typical magnitude of velocities of objects in simulation. This is used to estimate whether a contact should be treated as bouncing or resting based on its impact velocity, and a kinetic energy threshold below which the simulation may put objects to sleep. For normal physical environments, a good choice is the approximate speed of an object falling under gravity for one second.

Default Value

10;

lmdMax

lmdMax: Float;

Defined in: node_modules/@3dverse/livelink.core/dist/_prebuild/engine_types/sceneSettings.d.ts:203

The bigger LMD Max is, the greater the area that is searched for future contacts, and so the greater time taken per iteration. Note that XDE resolves contacts pre-collision, not once collision has taken place, like the majority of physics engines. Displacement of any object per iteration should not exceed LMD Max.

Default Value

1;