Package gov.nasa.worldwind.geom
Class BoundingSphere
- java.lang.Object
-
- gov.nasa.worldwind.geom.BoundingSphere
-
public class BoundingSphere extends java.lang.ObjectRepresents 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 booleanequals(java.lang.Object o)inthashCode()booleanintersectsFrustum(Frustum frustum)Indicates whether this bounding sphere intersects a specified frustum.BoundingSphereset(Vec3 center, double radius)Sets this bounding sphere to the specified center point and radius.java.lang.StringtoString()
-
-
-
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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
@NonNull public java.lang.String toString()
- Overrides:
toStringin 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
-
-