Class SphereShape

java.lang.Object
org.episteme.core.mathematics.geometry.collision.SphereShape
All Implemented Interfaces:
CollisionShape

public class SphereShape extends Object implements CollisionShape
Sphere collision shape defined by its radius.
  • Constructor Details

    • SphereShape

      public SphereShape(double radius)
  • Method Details

    • getRadius

      public Real getRadius()
    • getSupportPoint

      public Vector<Real> getSupportPoint(Vector<Real> direction)
      Description copied from interface: CollisionShape
      Gets the support point in a given direction (furthest point in that direction). Used for GJK and SAT algorithms.
      Specified by:
      getSupportPoint in interface CollisionShape
      Parameters:
      direction - the direction vector
      Returns:
      the support point in local coordinates
    • getAABB

      public Vector<Real>[] getAABB()
      Description copied from interface: CollisionShape
      compute AABB (Axis Aligned Bounding Box).
      Specified by:
      getAABB in interface CollisionShape
      Returns:
      array of two Vectors {min, max}