Builds a collider from options, validated against §24, §25, and §85.
The shape is checked on its own terms (parameters, convexity) and the remaining fields against the dimension the shape implies; the world's dimension is checked later by Collider.validateFor. The offset transform is copied (position and rotation only), so the caller keeps ownership of whatever it passes in.
Bit set of the groups this collider belongs to (§24).
Bit set of the groups this collider collides with (§24).
OptionaldensityMass per unit volume in kg/m³ (§24), or undefined to fall back to §25.
OptionalfrictionCoulomb friction coefficient (§24), or undefined to fall back to §25.
The node this component is attached to, or null. Written by the
ComponentRegistry alone (§6a); never assign it.
OptionalmaterialShared surface properties (§25), or undefined. A fallback only: the
explicit fields below win where both are set.
ReadonlyoffsetPose of the shape in the body's local frame (§24). Owned by the component
and never replaced; only position and rotation are read, because a
collider has no scale and no pivot (§37 ColliderDescriptor.offset).
OptionalrestitutionRestitution (§24), or undefined to fall back to §25.
Whether this collider reports overlaps without exerting forces (§24). A
sensor emits "triggerenter" / "triggerexit" instead of collision events
(§29).
The collider's geometry (§24). Held by reference — shapes are plain, shareable data — and re-validated by Collider.validateFor when the collider is registered, so replacing it before registration is free.
Static ReadonlytypeComponent key (plan D2) and §79 serialization name.
The body this collider belongs to, or undefined while it has none.
Resolved on every read: the RigidBody on this collider's own node, else
the nearest ancestor's. See the module header for why resolution is lazy
and why the ancestor walk is what lets one body carry several colliders.
The walk needs a scene graph, so it runs only when the host is a
@fourjs/scene Node; a bare ComponentRegistry host resolves against
itself alone.
Whether Collider.dispose has run. Disposal is terminal (§83): a
disposed component refuses world registration with
INVALID_APPLICATION_STATE (§89) rather than silently working.
The density used to derive mass from this collider (§23, §25) — §25's rule
exactly, through resolveDensity: the collider's own density is
authoritative, the material's is the fallback, and DEFAULT_DENSITY is the
last resort.
The friction a contact with this collider uses (§24, §25): the explicit Collider.friction, else the material's, else DEFAULT_FRICTION.
Combine it with the other collider's value through combineFriction /
combineValues to get the coefficient of a contact (§25, Appendix A).
The restitution a contact with this collider uses (§24, §25): the explicit Collider.restitution, else the material's, else DEFAULT_RESTITUTION.
Drops every listener (§6a, §83). Detaching does not dispose (§6a), so this
runs only from an explicit dispose() or ComponentRegistry.disposeAll.
Delivers event to the listeners registered for type in registration
order. Re-entrant emission of type is deferred (rule 4).
Number of live registrations for type (diagnostics, §83).
Number of live listener registrations across every event type (§83).
Used by teardown diagnostics — a detached node that still holds listeners pins its subtree until those listeners are removed.
Removes the earliest still-registered registration of listener for
type. Removing a listener that is not registered is a no-op.
Registers listener for type. Returns a function that removes it.
The same listener may be registered more than once; each registration is independent and is delivered once per dispatch.
Registers listener for a single delivery. Returns an unsubscriber.
Removes every listener, or every listener of one type. Used by teardown paths that must not leave detached nodes retaining listeners (§83).
Optionaltype: KCollider.body, or a FourError explaining that the collider has no
body (§23: every collider belongs to one).
INVALID_SCENE_GRAPH because the fault is an arrangement of nodes and
components, not a bad value. Called by PhysicsWorld at registration
(WP-5.3).
The descriptor an adapter would be handed for this collider (§37
createCollider), attached to body.
friction, restitution, and density are the effective values: §25's
fallback chain is resolved here, once, so an adapter receives numbers and
never has to re-implement the material rule. The material itself is still
passed through for adapters that model §25's optional rolling and spinning
friction. The shape and the offset are references to this component's live
state; the adapter reads them during createCollider and must not retain
them.
Re-validates this collider against a world of dimension (§21, §24, §85).
The check a component cannot make on its own: whether its shape belongs to
the world it is joining (a "circle" is not a "3d" shape) and whether
its offset lies in the plane a "2d" world simulates. Called at
registration (WP-5.3); not a per-step path.
A collision shape attached to a node, belonging to that node's (or an ancestor's) RigidBody (§24).
One per node (§6a); see the module header for how a body carries several.