API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
namespacePhysics Functions
@codexo/exojs-physics / physics / stable
Free functions and constants exported from @codexo/exojs-physics.
2
props
2
methods
0
events
Overview
Free functions and constants exported from @codexo/exojs-physics. Import any of them directly, for example `import { shouldCollide } from '@codexo/exojs-physics'`.
Functions2
shouldCollide(a: CollisionFilterPer-collider collision filter. A pair is considered for collision only when each collider's mask includes the other's category. A non-zero group overrides cate…, b: CollisionFilterPer-collider collision filter. A pair is considered for collision only when each collider's mask includes the other's category. A non-zero group overrides cate…): booleanDecide whether two filters permit a collision/overlap. Implements the standard category/mask rule with the signed-group override (Box2D/Matter semantics).
Turn one possibly-concave outline into the convex solver shapes that represent it. Attach all of them to a single body: together they are the original area, and a PolygonShape stays exactly one convex shape rather than secretly standing for several. The number of shapes and their order follow from the current decomposition and are not a stable contract; the preserved properties are the area, the centre of mass and the rotational inertia of the compound. An already-convex outline yields exactly one shape, so a caller that does not know whether its input is convex can route everything through here.
Constants2
The default collider filter: category 1, collides with everything, no group.