Package gov.nasa.worldwind.geom
Class BoundingSphere
- java.lang.Object
-
- gov.nasa.worldwind.geom.BoundingSphere
-
public class BoundingSphere extends java.lang.Object
Represents a bounding sphere in Cartesian coordinates. Typically used as a bounding volume.
-
-
Constructor Summary
Constructors Constructor Description BoundingSphere()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
hashCode()
boolean
intersectsFrustum(Frustum frustum)
Indicates whether this bounding sphere intersects a specified frustum.BoundingSphere
set(Vec3 center, double radius)
Sets this bounding sphere to the specified center point and radius.java.lang.String
toString()
-
-
-
Field Detail
-
center
public final Vec3 center
The sphere's center point.
-
radius
public double radius
The sphere's radius.
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
@NonNull public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
set
public BoundingSphere set(Vec3 center, double radius)
Sets this bounding sphere to the specified center point and radius.- Parameters:
center
- the new center pointradius
- the new radius- Returns:
- This bounding sphere with its center point and radius set to the specified values
- Throws:
java.lang.IllegalArgumentException
- If the center is null, or if the radius is negative
-
intersectsFrustum
public boolean intersectsFrustum(Frustum frustum)
Indicates whether this bounding sphere intersects a specified frustum.- Parameters:
frustum
- the frustum of interest- Returns:
- true if the specified frustum intersects this bounding sphere, otherwise false.
- Throws:
java.lang.IllegalArgumentException
- If the frustum is null
-
-