KinematicsSystemOptions
Defined in: src/modules/kinematics/kinematics-system.ts:35
Options for makeKinematicsSystem.
The system iterates every entity that carries all of
Position, Velocity, ShapeAabb, and Grounded — those are the
“dynamic bodies”. For each, it applies gravity (clamped to
terminalVelocity on the way down), then resolves motion against
any entity yielded by broadphase that also carries staticTag.
Resolution uses a two-pass axis-separated push-out: X first, then Y. Against each overlapping static, the body is snapped to the nearest non-penetrating edge and the corresponding velocity component is zeroed. This mirrors Arcade-style platformer physics and avoids the tunneling pathologies of a naive overlap check.
broadphase is called once per axis per body with the axis-projected
target AABB. Consumers typically dispatch a spatial-grid or tag
iterator here.
Type Parameters
Section titled “Type Parameters”TCtx extends KinematicsTickCtx
Properties
Section titled “Properties”broadphase
Section titled “broadphase”
readonlybroadphase: (ctx,x,y,w,h) =>Iterable<EntityId>
Defined in: src/modules/kinematics/kinematics-system.ts:51
Yields candidate static-body ids that may overlap the given AABB.
The system filters the results by staticTag, so over-yielding
is safe (and typical for grid broadphases).
Parameters
Section titled “Parameters”TCtx
number
number
number
number
Returns
Section titled “Returns”Iterable<EntityId>
gravity
Section titled “gravity”
readonlygravity:number
Defined in: src/modules/kinematics/kinematics-system.ts:38
Downward acceleration in world-units per second².
readonlyoptionalname?:string
Defined in: src/modules/kinematics/kinematics-system.ts:36
phase?
Section titled “phase?”
readonlyoptionalphase?:string
Defined in: src/modules/kinematics/kinematics-system.ts:39
runAfter?
Section titled “runAfter?”
readonlyoptionalrunAfter?: readonlystring[]
Defined in: src/modules/kinematics/kinematics-system.ts:40
runBefore?
Section titled “runBefore?”
readonlyoptionalrunBefore?: readonlystring[]
Defined in: src/modules/kinematics/kinematics-system.ts:41
staticTag
Section titled “staticTag”
readonlystaticTag:TagDef
Defined in: src/modules/kinematics/kinematics-system.ts:43
Tag that identifies immovable obstacles.
terminalVelocity
Section titled “terminalVelocity”
readonlyterminalVelocity:number
Defined in: src/modules/kinematics/kinematics-system.ts:45
Maximum positive vy (falling speed cap).