eulerjs API / @eulerjs/core / BodyOptions
BodyOptions
Defined in: packages/core/src/Body.ts:15
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
angularDamping? | number | Fraction of angular velocity lost per second, applied as w *= exp(-angularDamping * dt). | packages/core/src/Body.ts:37 |
angularVelocity? | Vector3 | Angular velocity in world space, in rad/s. | packages/core/src/Body.ts:33 |
canSleep? | boolean | Whether the body may fall asleep once it has been still for a while. Defaults to true. | packages/core/src/Body.ts:53 |
colliders? | readonly Collider[] | The shapes the body collides with, in its own frame. | packages/core/src/Body.ts:51 |
density? | number | Without massProperties or mass, the colliders' density in kg/m³. Defaults to water, 1000. | packages/core/src/Body.ts:25 |
gravityScale? | number | Multiplier on the world's gravity for this body; 0 turns gravity off. | packages/core/src/Body.ts:39 |
instance? | BodyInstance | One instance of a three.js InstancedMesh that follows the body, as object does: for many bodies that look alike drawn in one go. Its starting pose, and the scale it keeps, are read from the instance's matrix. world.addInstances makes a body for every instance of a mesh. | packages/core/src/Body.ts:47 |
linearDamping? | number | Fraction of linear velocity lost per second, applied as v *= exp(-linearDamping * dt). | packages/core/src/Body.ts:35 |
mass? | number | Overrides the mass in massProperties, the inertia scaled to match; or, without them, the total mass of the colliders. | packages/core/src/Body.ts:23 |
massProperties? | MassProperties | Mass, centre of mass and inertia. Leave out for a dynamic body with solid colliders to have them worked out from those, with mass or density. | packages/core/src/Body.ts:21 |
object? | Object3D<Object3DEventMap> | A three.js object that follows the body when the world syncs objects. | packages/core/src/Body.ts:41 |
position? | Vector3 | Origin of the body frame in world space. Defaults to the bound object's world position. | packages/core/src/Body.ts:27 |
quaternion? | Quaternion | Orientation of the body frame. Defaults to the bound object's world orientation. | packages/core/src/Body.ts:29 |
type? | BodyType | - | packages/core/src/Body.ts:16 |
velocity? | Vector3 | Velocity of the centre of mass, in m/s. | packages/core/src/Body.ts:31 |
voxels? | Voxels | The body's volume as cells, for behaviours that need it such as buoyancy. | packages/core/src/Body.ts:49 |
