Module org.dyn4j

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

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

    public class BruteForceBroadphase<E extends Collidable<T>,​T extends Fixture>
    extends AbstractBroadphaseDetector<E,​T>
    implements BroadphaseDetector<E,​T>
    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.

    Since:
    3.4.0
    Version:
    3.4.0
    Author:
    Manolis Tsamis