Talos docs

FollowGroundOptions

Since 0.6
Plain text

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

MemberSignatureDescription
radiusradius?: numberHow 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.
castcast?: "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".
rayUprayUp?: numberHow 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.
reachreach?: numberHow far below the body's position to look for ground, metres. Default 4.
maxDropmaxDrop?: numberThe 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.
maxStepmaxStep?: numberThe 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.
smoothingsmoothing?: numberEases 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.
gravitygravity?: numberDownward acceleration while it is off the ground, m/s². Default 9.81.
excludeexclude?: CastOptions["exclude"]Entities the cast passes through; the body itself always is.
excludeTagsexcludeTags?: string | string[]Tags the cast passes through. Default [CAMERA_ONLY_TAG]; [] sees everything.
triggerstriggers?: booleanWhether trigger volumes count as ground. Default false.