Per-object body configuration accepted by ScenePhysics.setBody.

interface PhysicsBodyParams {
    density?: number;
    friction?: number;
    restitution?: number;
    shape?: "cuboid" | "ball";
    type?: "fixed" | "dynamic" | "kinematicPositionBased";
}

Properties

density?: number

Collider density (kg / m³ at unit gravity). Defaults to 1.0.

friction?: number

Coulomb friction coefficient. Defaults to 0.5.

restitution?: number

Coefficient of restitution (0 = inelastic, 1 = perfectly elastic). Defaults to 0.0.

shape?: "cuboid" | "ball"

Collider shape:

  • "cuboid" (default) — a box matching the object's world AABB. Cheap, handles every BIM-style block geometry.
  • "ball" — a sphere whose radius is the largest world-AABB half-extent. Useful for projectiles, droplets, marbles.
type?: "fixed" | "dynamic" | "kinematicPositionBased"

Body type:

  • "fixed" (default) — never moves. Static collider.
  • "dynamic" — pushed around by gravity, impulses, and contacts.
  • "kinematicPositionBased" — moved by the caller via setNextKinematicTranslation; not affected by gravity but pushes dynamic bodies aside.