Module org.dyn4j

Class Collisions


  • public final class Collisions
    extends Object
    Class used to estimate collision counts and other one-off collision methods and values.

    This class is transient and may get deprecated at any time.

    Since:
    3.1.1
    Version:
    3.2.0
    Author:
    William Bittle
    • Method Detail

      • getEstimatedCollisionPairs

        public static final int getEstimatedCollisionPairs​(int n)
        Returns an estimate on the number of collision pairs based on the number objects being simulated.
        Parameters:
        n - the number of objects
        Returns:
        int
      • getEstimatedCollisionsPerObject

        public static final int getEstimatedCollisionsPerObject()
        Returns an estimate on the number of collisions per object.
        Returns:
        int
      • getEstimatedRaycastCollisions

        public static final int getEstimatedRaycastCollisions​(int n)
        Returns an estimate on the number of raycast collisions given the total number of objects to collide with.
        Parameters:
        n - the number of objects
        Returns:
        int
        Since:
        3.2.0