API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classPhysicsBody
A rigid body: a world transform plus mass properties aggregated from its colliders. Dynamic bodies integrate under gravity, accumulated forces/torque and contact impulses each fixed sub-step; static bodies never move; kinematic bodies move by their velocity only and stay immovable under contacts. Drive a body with applyForce, applyTorque and applyImpulse, or set linearVelocityX/linearVelocityY/angularVelocity directly; reposition it (teleport, no velocity) with setTransform.
import { PhysicsBody } from '@codexo/exojs-physics'A rigid body: a world transform plus mass properties aggregated from its colliders. Dynamic bodies integrate under gravity, accumulated forces/torque and contact impulses each fixed sub-step; static bodies never move; kinematic bodies move by their velocity only and stay immovable under contacts. Drive a body with applyForce, applyTorque and applyImpulse, or set linearVelocityX/linearVelocityY/angularVelocity directly; reposition it (teleport, no velocity) with setTransform.
new(options: BodyOptionsConstruction options for a body.): PhysicsBodyaddCollider(collider: ColliderGeometry attached to a PhysicsBody: a Shape plus a body-local offset/rotation, material (friction/restitution/density) and a collision filter. A body may own s… | ColliderOptionsConstruction options for a collider.): ColliderGeometry attached to a PhysicsBody: a Shape plus a body-local offset/rotation, material (friction/restitution/density) and a collision filter. A body may own s…applyForce(forceX: number, forceY: number): thisapplyImpulse(impulseX: number, impulseY: number, pointX?: number, pointY?: number): thisapplyTorque(torque: number): thissetTransform(position: Readonly<PointLikeStructural type for any object with a 2D `x`/`y` position.>, angle: number): thissynchronizeColliders(): voidwake(): thisallowSleep: booleanangularDamping: numberangularVelocity: numberfixedRotation: booleangravityScale: numberinertia: numberinvInertia: numberinvMass: numberisBullet: booleanlinearDamping: numberlinearVelocityX: numberlinearVelocityY: numbermass: numberangle: numberattached: booleancenterOfMassX: numbercenterOfMassY: numberdestroyed: booleanid: numberisMassReady: booleanisSleeping: booleanpreviousAngle: numberpreviousX: numberpreviousY: numbertransform: Readonly<Transform>worldCenterOfMassX: numberworldCenterOfMassY: numberx: numbery: number