Package arc.math.geom

Class Sphere

java.lang.Object
arc.math.geom.Sphere

public class Sphere extends Object
Encapsulates a 3D sphere with a center and a radius
  • Field Details

    • center

      public final Vec3 center
      the center of the sphere
    • radius

      public float radius
      the radius of the sphere
  • Constructor Details

    • Sphere

      public Sphere(Vec3 center, float radius)
      Constructs a sphere with the given center and radius
      Parameters:
      center - The center
      radius - The radius
  • Method Details

    • overlaps

      public boolean overlaps(Sphere sphere)
      Parameters:
      sphere - the other sphere
      Returns:
      whether this and the other sphere overlap
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • volume

      public float volume()
    • surfaceArea

      public float surfaceArea()