Skip to content

Kinematics3DSystemOptions

Defined in: src/modules/kinematics-3d/kinematics3d-system.ts:37

Options for makeKinematics3DSystem, the 3D sibling of makeKinematicsSystem.

The system iterates every entity carrying dynamicTag and all of positionDef, velocityDef and ShapeAabb3Def — those are the “dynamic bodies”. For each it applies gravity (clamped to terminalVelocity), then resolves motion against the colliders yielded by broadphase.

Resolution is a three-pass axis-separated push-out — X, then Z, then Y — always pushing along the axis of shallowest penetration. That is the shortest way out and the only one that cannot tunnel; without it, a body overlapping a large thin wall is pushed out through the wall’s wide face, and a floor the body is resting on blocks its horizontal movement. Horizontal axes run before Y so a wall contact cannot cancel a jump on the same tick.

positionDef / velocityDef are injected because the engine has no modules/transform-3d yet — the same shape as makeFollowCameraSystem({ positionDef }). Nullary defaults belong here once that module ships.

TCtx extends Kinematics3DTickCtx

readonly broadphase: (ctx, box) => Iterable<EntityId>

Defined in: src/modules/kinematics-3d/kinematics3d-system.ts:72

Yields candidate static ids that may overlap box — the axis-projected target AABB (world-space, centre + half extents). The system re-tests every candidate with aabb3VsAabb3 and filters by staticTag, so over-yielding is safe (and typical for a spatial index). Called once per axis per body.

TCtx

Aabb3

Iterable<EntityId>


readonly dynamicTag: TagDef

Defined in: src/modules/kinematics-3d/kinematics3d-system.ts:40

Tag marking the bodies this system simulates.


readonly gravity: number

Defined in: src/modules/kinematics-3d/kinematics3d-system.ts:42

Downward acceleration in world-units per second², applied as -y.


readonly optional name?: string

Defined in: src/modules/kinematics-3d/kinematics3d-system.ts:38


readonly optional phase?: string

Defined in: src/modules/kinematics-3d/kinematics3d-system.ts:43


readonly positionDef: ComponentDef<Vec3>

Defined in: src/modules/kinematics-3d/kinematics3d-system.ts:45

Position component to integrate, {x, y, z}.


readonly optional runAfter?: readonly string[]

Defined in: src/modules/kinematics-3d/kinematics3d-system.ts:46


readonly optional runBefore?: readonly string[]

Defined in: src/modules/kinematics-3d/kinematics3d-system.ts:47


readonly optional staticTag?: TagDef

Defined in: src/modules/kinematics-3d/kinematics3d-system.ts:55

Tag that identifies immovable obstacles. Supplying it makes the system skip any candidate that does not carry it, which is what makes over-yielding safe for a spatial-index broadphase. Omit it when the broadphase already yields exactly the colliders — a game whose candidate list also carries a movable body that should still block (portal’s resting cube).


readonly optional stepHeight?: number

Defined in: src/modules/kinematics-3d/kinematics3d-system.ts:61

Maximum rise (world units) a grounded body auto-climbs instead of being blocked — the character-controller “step offset” (stairs). Omit to disable step-up entirely.


readonly terminalVelocity: number

Defined in: src/modules/kinematics-3d/kinematics3d-system.ts:63

Maximum downward speed (the -vy cap).


readonly velocityDef: ComponentDef<{ vx: number; vy: number; vz: number; }>

Defined in: src/modules/kinematics-3d/kinematics3d-system.ts:65

Velocity component to integrate, {vx, vy, vz}.