Package com.badlogic.gdx.math.collision
Class Sphere
- java.lang.Object
-
- com.badlogic.gdx.math.collision.Sphere
-
- All Implemented Interfaces:
java.io.Serializable
public class Sphere extends java.lang.Object implements java.io.Serializable
Encapsulates a 3D sphere with a center and a radius- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
hashCode()
boolean
overlaps(Sphere sphere)
float
surfaceArea()
float
volume()
-
-
-
Field Detail
-
radius
public float radius
the radius of the sphere
-
center
public final Vector3 center
the center of the sphere
-
-
Constructor Detail
-
Sphere
public Sphere(Vector3 center, float radius)
Constructs a sphere with the given center and radius- Parameters:
center
- The centerradius
- The radius
-
-
Method Detail
-
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 classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
volume
public float volume()
-
surfaceArea
public float surfaceArea()
-
-