FollowGroundOptions
Since 0.6
Signature
export interface FollowGroundOptions {
/**
* How far the body's position sits above the ground, metres: a sphere's radius when the position is
* its centre, 0 for a body whose origin is at its base. Default 0.5.
*/
radius?: number
/**
* `"sphere"` sweeps a sphere of `radius` down, so the body rests on a slope, a step or an edge where
* a ball of that size would; `"ray"` casts a thin ray under the position and lifts by
* `radius / normal.y`. Default `"sphere"` when `radius > 0`, else `"ray"`.
*/
cast?: "sphere" | "ray"
/**
* How far above the body's own position the cast starts, metres. It has to clear the highest
* ground the body could be under in one tick — the uphill side of a slope. Default 2.
*/
rayUp?: number
/** How far below the body's position to look for ground, metres. Default 4. */
reach?: number
/**
* The most the ground may fall away under the body in one tick, metres, for the body to follow it
* down. Beyond it the body has gone over an edge: it falls under `gravity` until it lands, rather
* than jumping down to whatever is below. Default 0.5.
*/
maxDrop?: number
/**
* The most the ground may rise under the body in one tick, metres, before the result says
* `blocked`. The body is lifted anyway — it is never left inside the ground — so a mover that
* should stop at a wall checks `blocked`. Default 0.5.
*/
maxStep?: number
/**
* Eases the body down onto lower ground, 1/s (larger is snappier; 0, the default, follows exactly).
* Smoothing never leaves the body under the surface: it only slows the descent. The ground normal
* the result reports is eased by the same amount.
*/
smoothing?: number
/** Downward acceleration while it is off the ground, m/s². Default 9.81. */
gravity?: number
/** Entities the cast passes through; the body itself always is. */
exclude?: CastOptions["exclude"]
/** Tags the cast passes through. Default `[CAMERA_ONLY_TAG]`; `[]` sees everything. */
excludeTags?: string | string[]
/** Whether trigger volumes count as ground. Default false. */
triggers?: boolean
}
Import: import type { FollowGroundOptions } from "@argus/gameplay"
Members
| Member | Signature | Description |
|---|---|---|
radius | radius?: number | How far the body's position sits above the ground, metres: a sphere's radius when the position is its centre, 0 for a body whose origin is at its base. Default 0.5. |
cast | cast?: "sphere" | "ray" | "sphere" sweeps a sphere of radius down, so the body rests on a slope, a step or an edge where a ball of that size would; "ray" casts a thin ray under the position and lifts by radius / normal.y. Default "sphere" when radius > 0, else "ray". |
rayUp | rayUp?: number | How far above the body's own position the cast starts, metres. It has to clear the highest ground the body could be under in one tick — the uphill side of a slope. Default 2. |
reach | reach?: number | How far below the body's position to look for ground, metres. Default 4. |
maxDrop | maxDrop?: number | The most the ground may fall away under the body in one tick, metres, for the body to follow it down. Beyond it the body has gone over an edge: it falls under gravity until it lands, rather than jumping down to whatever is below. Default 0.5. |
maxStep | maxStep?: number | The most the ground may rise under the body in one tick, metres, before the result says blocked. The body is lifted anyway — it is never left inside the ground — so a mover that should stop at a wall checks blocked. Default 0.5. |
smoothing | smoothing?: number | Eases the body down onto lower ground, 1/s (larger is snappier; 0, the default, follows exactly). Smoothing never leaves the body under the surface: it only slows the descent. The ground normal the result reports is eased by the same amount. |
gravity | gravity?: number | Downward acceleration while it is off the ground, m/s². Default 9.81. |
exclude | exclude?: CastOptions["exclude"] | Entities the cast passes through; the body itself always is. |
excludeTags | excludeTags?: string | string[] | Tags the cast passes through. Default [CAMERA_ONLY_TAG]; [] sees everything. |
triggers | triggers?: boolean | Whether trigger volumes count as ground. Default false. |