eulerjs API / @eulerjs/core / HeightfieldCollider
HeightfieldCollider
Defined in: packages/core/src/colliders/HeightfieldCollider.ts:32
Terrain: a grid of heights, centred on the collider's origin, each cell split into two triangles. Solid below the surface, so whatever ends up beneath it is pushed back up. Only for static and kinematic bodies.
Extends
Constructors
Constructor
new HeightfieldCollider(options): HeightfieldCollider;Defined in: packages/core/src/colliders/HeightfieldCollider.ts:45
Parameters
| Parameter | Type |
|---|---|
options | HeightfieldColliderOptions |
Returns
HeightfieldCollider
Overrides
Properties
Accessors
boundingRadius
Get Signature
get boundingRadius(): number;Defined in: packages/core/src/colliders/HeightfieldCollider.ts:75
Radius of a sphere around the offset that contains the shape; Infinity for infinite shapes.
Returns
number
Overrides
depth
Get Signature
get depth(): number;Defined in: packages/core/src/colliders/HeightfieldCollider.ts:71
Depth along z, from the first row to the last.
Returns
number
width
Get Signature
get width(): number;Defined in: packages/core/src/colliders/HeightfieldCollider.ts:66
Width along x, from the first column to the last.
Returns
number
Methods
bounds()
bounds(pose, target): Box3;Defined in: packages/core/src/colliders/HeightfieldCollider.ts:180
World-space box around the collider at pose. Infinite shapes return an infinite box.
Parameters
| Parameter | Type |
|---|---|
pose | ColliderPose |
target | Box3 |
Returns
Box3
Overrides
canCollideWith()
canCollideWith(other): boolean;Defined in: packages/core/src/colliders/Collider.ts:95
Parameters
| Parameter | Type |
|---|---|
other | Collider |
Returns
boolean
Inherited from
heightAt()
heightAt(row, column): number;Defined in: packages/core/src/colliders/HeightfieldCollider.ts:80
The height stored for a grid point.
Parameters
| Parameter | Type |
|---|---|
row | number |
column | number |
Returns
number
massProperties()
massProperties(): undefined;Defined in: packages/core/src/colliders/HeightfieldCollider.ts:190
Mass properties of the solid in the body frame, or undefined for shapes without a volume.
Returns
undefined
Overrides
pointAt()
pointAt(
row,
column,
target
): Vector3;Defined in: packages/core/src/colliders/HeightfieldCollider.ts:85
Writes the grid point in the collider's frame.
Parameters
| Parameter | Type |
|---|---|
row | number |
column | number |
target | Vector3 |
Returns
Vector3
surfaceHeight()
surfaceHeight(localX, localZ): number | undefined;Defined in: packages/core/src/colliders/HeightfieldCollider.ts:90
The surface's height above the point (localX, localZ) of the collider's frame, or undefined off the grid.
Parameters
| Parameter | Type |
|---|---|
localX | number |
localZ | number |
Returns
number | undefined
toGeometry()
toGeometry(): BufferGeometry;Defined in: packages/core/src/colliders/HeightfieldCollider.ts:158
The surface as triangles in the collider's frame, the same ones it collides as, with normals: to draw the terrain exactly where things roll on it.
Returns
BufferGeometry
