API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classCollider

@codexo/exojs-physics / physics / stable

Geometry attached to a PhysicsBody: a Shape plus a body-local offset/rotation, material (friction/restitution/density) and a collision filter. A body may own several colliders (compound). The collider also caches its world-space geometry — refreshed by synchronize — which the broad phase, narrow phase and queries read directly. Material fields and the filter are mutable; the shape and local placement are immutable (rebuild the collider to change geometry).

18
props
2
methods
0
events
Import
import { Collider } from '@codexo/exojs-physics'

Geometry attached to a PhysicsBody: a Shape plus a body-local offset/rotation, material (friction/restitution/density) and a collision filter. A body may own several colliders (compound). The collider also caches its world-space geometry — refreshed by synchronize — which the broad phase, narrow phase and queries read directly.

Material fields and the filter are mutable; the shape and local placement are immutable (rebuild the collider to change geometry).

Constructors 1
new(options: ColliderOptions): Collider
Methods 2
_markDestroyed(): void
synchronize(bodyTransform: Transform): void
Properties 18
density: number
filter: CollisionFilter
friction: number
isSensor: boolean
localRotation: number
offsetX: number
offsetY: number
restitution: number
shape: AnyShape
aabb: Readonly<Aabb>
body: PhysicsBody
destroyed: boolean
id: number
localTransform: Readonly<Transform>
worldCenter: Readonly<Mutable2D>
worldNormals: readonly number[]
worldTransform: Readonly<Transform>
worldVertices: readonly number[]
Source