API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
interfaceAttachOptions
@codexo/exojs-physics / physics / stable
PhysicsWorld.attach convenience options: a body type plus a single collider, attached to a scene node in one call.
13
props
0
methods
0
events
Import
import { AttachOptions } from '@codexo/exojs-physics'PhysicsWorld.attach convenience options: a body type plus a single collider, attached to a scene node in one call.
Properties13
angle?: numberInitial rotation (radians) of the body. Default the node's current WORLD rotation at attach time.
density?: numberCollider density (mass per px²). Default 1.
Category/mask/group collision filter; partials merge over the defaults.
fixedRotation?: booleanWhen true, the body never rotates under contacts. Default false.
friction?: numberCoulomb friction coefficient. Default 0.2.
gravityScale?: numberPer-body multiplier on world gravity. Default 1.
isSensor?: booleanWhen true, the collider generates overlap events but no contact response. Default false.
offset?: Readonly<PointLikeStructural type for any object with a 2D `x`/`y` position.>Body-local offset of the collider. Default (0, 0).
position?: Readonly<PointLikeStructural type for any object with a 2D `x`/`y` position.>Initial world position of the body. Default the node's current WORLD position (SceneNode.getWorldTransform) at attach time.
restitution?: numberRestitution / bounciness in [0, 1]. Default 0.
rotation?: numberBody-local rotation of the collider (radians). Default 0.
The collider geometry.
Simulation role of the created body. Default 'dynamic'.
Source