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).
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
| Member | Signature | Description |
|---|---|---|
restPosition | restPosition?: Vec3 | The child's local position at init: its rest. |
restRotation | restRotation?: Quat | The child's local rotation at init: its rest. |
last | last?: Vec3 | The parent's world position on the last tick. |
velocity | velocity?: Vec3 | The parent's world velocity over the last tick, m/s; absent after a teleport until it is measured again. |
pose | pose?: SwayPose | Where each spring is. |
orphan | orphan?: boolean | Set once there is no parent to measure; logged once. |