Skip to content

eulerjs API / @eulerjs/core / BodyOptions

BodyOptions ​

Defined in: packages/core/src/Body.ts:15

Properties ​

PropertyTypeDescriptionDefined in
angularDamping?numberFraction of angular velocity lost per second, applied as w *= exp(-angularDamping * dt).packages/core/src/Body.ts:37
angularVelocity?Vector3Angular velocity in world space, in rad/s.packages/core/src/Body.ts:33
canSleep?booleanWhether 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?numberWithout massProperties or mass, the colliders' density in kg/m³. Defaults to water, 1000.packages/core/src/Body.ts:25
gravityScale?numberMultiplier on the world's gravity for this body; 0 turns gravity off.packages/core/src/Body.ts:39
instance?BodyInstanceOne 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?numberFraction of linear velocity lost per second, applied as v *= exp(-linearDamping * dt).packages/core/src/Body.ts:35
mass?numberOverrides 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?MassPropertiesMass, 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?Vector3Origin of the body frame in world space. Defaults to the bound object's world position.packages/core/src/Body.ts:27
quaternion?QuaternionOrientation 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?Vector3Velocity of the centre of mass, in m/s.packages/core/src/Body.ts:31
voxels?VoxelsThe body's volume as cells, for behaviours that need it such as buoyancy.packages/core/src/Body.ts:49

Released under the MIT License.