Skip to content

eulerjs API / @eulerjs/core / InstancedBodyOptions

InstancedBodyOptions ​

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

Options for the bodies world.addInstances makes, one for each instance of an InstancedMesh.

Extends ​

  • Omit<ObjectBodyOptions, | "shape" | "cellSize" | "collider" | "position" | "quaternion" | "velocity" | "angularVelocity">

Properties ​

PropertyTypeDescriptionInherited fromDefined in
angularDamping?numberFraction of angular velocity lost per second, applied as w *= exp(-angularDamping * dt).BodyOptions.angularDampingpackages/core/src/Body.ts:37
canSleep?booleanWhether the body may fall asleep once it has been still for a while. Defaults to true.BodyOptions.canSleeppackages/core/src/Body.ts:53
collider?| ColliderShorthand | ((index) => | Collider | readonly Collider[])What each body collides as: a shape fitted around the mesh's geometry (with the instance's scale), or a function making the colliders for the instance at index. Every body needs colliders of its own, so it is a function rather than colliders to share.-packages/core/src/Body.ts:96
density?numberIn kg/m³. Defaults to water, 1000, when no mass is given either.Omit.densitypackages/core/src/Body.ts:61
gravityScale?numberMultiplier on the world's gravity for this body; 0 turns gravity off.BodyOptions.gravityScalepackages/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.BodyOptions.instancepackages/core/src/Body.ts:47
linearDamping?numberFraction of linear velocity lost per second, applied as v *= exp(-linearDamping * dt).BodyOptions.linearDampingpackages/core/src/Body.ts:35
mass?numberTotal mass in kg. Give this or density.Omit.masspackages/core/src/Body.ts:59
type?BodyType-BodyOptions.typepackages/core/src/Body.ts:16

Released under the MIT License.