Skip to content

@modoki/engine / index / Collider3D

Variable: Collider3D

const Collider3D: Trait<{ collisionGroups: number; collisionMask: number; density: number; friction: number; halfD: number; halfH: number; halfHeight: number; halfW: number; isSensor: boolean; mesh: string; physicsLayer: string; radius: number; restitution: number; shape: ColliderShape3D; }>

The shape/material half of a 3D physics entity. REQUIRES a RigidBody3D on the same entity OR a rigidbody ancestor (then adopted as a compound collider at its local Transform offset). A lone Collider3D with neither creates no Rapier collider and fires no events (the physics system warns once); for a static wall/sensor pair it with RigidBody3D({ bodyType: 'static' }).

Dimensions are in WORLD UNITS (same space as Transform), converted to Rapier meters via Physics3D.unitsPerMeter (default 1 → world units already are meters). Collider dims do NOT scale with Transform.scale (Phase 1) — size the collider directly.

collisionGroups/collisionMask are 16-bit membership/filter bitmasks: two colliders interact only if each one's group is in the other's mask.

Built with Modoki.