Class BroadPhase

java.lang.Object
jsim.collision.BroadPhase

public final class BroadPhase extends Object
O(n²) AABB sweep broadphase.

FRC simulations rarely exceed ~50 bodies, so the quadratic cost is irrelevant. Bodies with RigidBodyFlags.NO_COLLISION are skipped. Two static bodies never collide with each other.

  • Method Details

    • findPairs

      public static void findPairs(List<RigidBody> bodies, List<CollisionPair> out)
      Return all body pairs whose cached AABBs overlap. The supplied list is cleared and repopulated each call.
      Parameters:
      bodies - all bodies in the world
      out - cleared and populated with overlapping pairs