Module org.dyn4j

Class BruteForceBroadphase<T extends CollisionBody<E>,​E extends Fixture>

  • Type Parameters:
    T - the CollisionBody type
    E - the Fixture type
    All Implemented Interfaces:
    BroadphaseDetector<T,​E>, Shiftable

    public final class BruteForceBroadphase<T extends CollisionBody<E>,​E extends Fixture>
    extends AbstractBroadphaseDetector<T,​E>
    implements BroadphaseDetector<T,​E>
    This class implements the simplest possible broad-phase detector, a brute-force algorithm for finding all pairs of collisions (and similar queries).

    This implementation is not tuned for performance in any way and should not be used except for testing purposes. One main reason this was developed is for automated testing of the other broad-phase detectors.

    The logic of this class is simple: It holds a hash table of all the nodes and each time a query is made it scans linearly all the nodes to find the answer.

    Important note: This class must not use AABB expansion in order to always return the minimum set of pairs/items. This property is used to test the other broad-phase detectors correctly.

    Manolis Tsamis