Class NarrowPhase

java.lang.Object
jsim.collision.NarrowPhase

public final class NarrowPhase extends Object
Generates ContactPoints from broadphase candidate pairs.

Supported shape pairs: Sphere-Sphere, Sphere-Plane, Box-Plane, Box-Sphere, Box-Box. Each test emits at most one contact (box-box emits the deepest corner contact).

  • Method Details

    • generateContacts

      public static void generateContacts(List<CollisionPair> pairs, List<ContactPoint> contacts)
      Populate contacts from each CollisionPair. Existing entries are cleared first. Only overlapping contacts (penetration > 0) are added.
      Parameters:
      pairs - broadphase candidate pairs to test
      contacts - output list to populate (cleared before adding new contacts)