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
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
angularDamping? | number | Fraction of angular velocity lost per second, applied as w *= exp(-angularDamping * dt). | BodyOptions.angularDamping | packages/core/src/Body.ts:37 |
canSleep? | boolean | Whether the body may fall asleep once it has been still for a while. Defaults to true. | BodyOptions.canSleep | packages/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? | number | In kg/m³. Defaults to water, 1000, when no mass is given either. | Omit.density | packages/core/src/Body.ts:61 |
gravityScale? | number | Multiplier on the world's gravity for this body; 0 turns gravity off. | BodyOptions.gravityScale | 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. | BodyOptions.instance | packages/core/src/Body.ts:47 |
linearDamping? | number | Fraction of linear velocity lost per second, applied as v *= exp(-linearDamping * dt). | BodyOptions.linearDamping | packages/core/src/Body.ts:35 |
mass? | number | Total mass in kg. Give this or density. | Omit.mass | packages/core/src/Body.ts:59 |
type? | BodyType | - | BodyOptions.type | packages/core/src/Body.ts:16 |
