Skip to content

eulerjs API / @eulerjs/core / HeightfieldColliderOptions

HeightfieldColliderOptions ​

Defined in: packages/core/src/colliders/HeightfieldCollider.ts:7

Extends ​

Properties ​

PropertyTypeDescriptionInherited fromDefined in
cellDepth?numberDistance between neighbouring rows, along z, where it isn't cellSize.-packages/core/src/colliders/HeightfieldCollider.ts:17
cellSizenumberDistance between neighbouring points along x, and along z too unless cellDepth is given.-packages/core/src/colliders/HeightfieldCollider.ts:15
collidesWith?numberBit mask of the groups it collides with. Defaults to every group.ColliderOptions.collidesWithpackages/core/src/colliders/Collider.ts:37
collisionGroups?numberBit mask of the groups this collider is in. Defaults to group 1.ColliderOptions.collisionGroupspackages/core/src/colliders/Collider.ts:35
friction?numberCoulomb friction coefficient. Two colliders use the geometric mean of theirs. Defaults to 0.5.ColliderOptions.frictionpackages/core/src/colliders/Collider.ts:22
heightsreadonly (readonly number[])[]Heights of the ground at evenly spaced points, along the collider's y axis: heights[row][column], rows running along z and columns along x. Every row needs the same number of columns, and there must be at least two of each.-packages/core/src/colliders/HeightfieldCollider.ts:13
offset?Vector3Where the collider sits in its body's frame. Defaults to the origin.ColliderOptions.offsetpackages/core/src/colliders/Collider.ts:18
restitution?numberBounciness, 0 (none) to 1 (perfectly elastic). Two colliders use the larger. Defaults to 0.ColliderOptions.restitutionpackages/core/src/colliders/Collider.ts:24
rollingResistance?numberResistance to rolling, as a share of the load: a ball, capsule, cylinder or cone rolling on this, or this one rolling, is held back by a torque of at most this times the contact force times its radius, and so is one spinning on the spot. Two colliders use the larger. Defaults to ROUND_ROLLING_RESISTANCE (0.02) for those round shapes, which come to rest after rolling a while, and to 0 for the others; 0 on a round shape rolls it for ever. About 0.002 for steel on steel, 0.01 for a ball on a hard floor, 0.05 or more for something soft.ColliderOptions.rollingResistancepackages/core/src/colliders/Collider.ts:33
rotation?QuaternionHow the collider is turned in its body's frame.ColliderOptions.rotationpackages/core/src/colliders/Collider.ts:20
sensor?booleanA sensor detects what overlaps it, reporting it through the world's sensorEnter and sensorExit events, without pushing anything: a trigger volume, such as a finish line or a pickup. Defaults to false.ColliderOptions.sensorpackages/core/src/colliders/Collider.ts:43
thickness?numberHow deep below its lowest point the terrain counts as solid, so that whatever sinks into it, however far, is still pushed back out of the top. Defaults to 1 m.-packages/core/src/colliders/HeightfieldCollider.ts:22

Released under the MIT License.