Talos docs

SwayState

Since 0.7

What the sway behavior keeps in ctx.state (it survives a hot reload, so the rest pose is never re-read from a swayed body).

Plain text

Signature

export interface SwayState {
  /** The child's local position at init: its rest. */
  restPosition?: Vec3
  /** The child's local rotation at init: its rest. */
  restRotation?: Quat
  /** The parent's world position on the last tick. */
  last?: Vec3
  /** The parent's world velocity over the last tick, m/s; absent after a teleport until it is measured again. */
  velocity?: Vec3
  /** Where each spring is. */
  pose?: SwayPose
  /** Set once there is no parent to measure; logged once. */
  orphan?: boolean
}

Import: import type { SwayState } from "@argus/gameplay"

Members

MemberSignatureDescription
restPositionrestPosition?: Vec3The child's local position at init: its rest.
restRotationrestRotation?: QuatThe child's local rotation at init: its rest.
lastlast?: Vec3The parent's world position on the last tick.
velocityvelocity?: Vec3The parent's world velocity over the last tick, m/s; absent after a teleport until it is measured again.
posepose?: SwayPoseWhere each spring is.
orphanorphan?: booleanSet once there is no parent to measure; logged once.