Small World Engine API Reference - v0.78.00
    Preparing search index...

    Class SweptVolumeCCD

    Handles Continuous Collision Detection (CCD) for fast-moving bodies (Sphere, Box, OBB) to prevent tunneling.

    Index
    • get hasCandidates(): boolean

      Returns true if any fast-moving bodies were registered in the current substep.

      Returns boolean

    • Tests whether a moving body exceeds the motion threshold and should be registered for swept CCD.

      Parameters

      • obj: Object3D

        The dynamic Object3D.

      • deltaP: Vector3D

        Positional displacement vector for this substep.

      • ccdMotionThreshold: number

        Multiplier of broad radius triggering CCD.

      Returns void

    • Sweeps all registered CCD candidates against nearby colliders and clamps their positions to earliest impact.

      Callers must reset the broadphase placement of every returned body afterwards (e.g. PhysicsBroadphase.reinsertCollider): a clamped position behind the swept one is no longer represented by the octree node it was originally inserted into (that node covers the unclamped swept volume), so later queries around the body's actual position would silently miss it.

      Parameters

      Returns Object3D[]

      The bodies whose positions were clamped this call.