|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nasa.worldwind.geom.Sphere
public final class Sphere
Represents a sphere in three dimensional space.
Instances ofSphere are immutable.
| Field Summary | |
|---|---|
protected Vec4 |
center
|
protected double |
radius
|
static Sphere |
UNIT_SPHERE
|
| Constructor Summary | |
|---|---|
Sphere(Vec4 center,
double radius)
Creates a new Sphere from a given center and radius. |
|
| Method Summary | |
|---|---|
static Sphere |
createBoundingSphere(BufferWrapper buffer)
Creates a sphere that completely contains a set of points. |
static Sphere |
createBoundingSphere(Iterable<? extends Extent> extents)
Creates a sphere that completely contains a set of Extents. |
static Sphere |
createBoundingSphere(Vec4[] points)
Creates a sphere that completely contains a set of points. |
boolean |
equals(Object o)
|
Vec4 |
getCenter()
Obtains the center of this Sphere. |
double |
getDiameter()
Obtains the diameter of this Sphere. |
double |
getEffectiveRadius(Plane plane)
Computes the effective radius of the extent relative to a specified plane. |
Vec4 |
getPointOnSphere(LatLon location)
Computes a point on the sphere corresponding to a specified location. |
double |
getProjectedArea(View view)
Computes the area in square pixels of this Extent after it is projected into the specified
view's viewport. |
double |
getRadius()
Obtains the radius of this Sphere. |
int |
hashCode()
|
Intersection[] |
intersect(Line line)
Obtains the intersections of this sphere with a line. |
boolean |
intersects(Frustum frustum)
Indicates whether a specified Frustum intersects this sphere. |
boolean |
intersects(Line line)
Tests for intersection with a Line. |
boolean |
intersects(Plane plane)
Tests for intersection with a Plane. |
void |
render(DrawContext dc)
Causes this Sphere to render itself using the DrawContext provided. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final Vec4 center
protected final double radius
public static final Sphere UNIT_SPHERE
| Constructor Detail |
|---|
public Sphere(Vec4 center,
double radius)
Sphere from a given center and radius. radius must be positive (that is,
greater than zero), and center may not be null.
center - the center of the new sphereradius - the radius of the new sphere
IllegalArgumentException - if center is null or if radius is non-positive| Method Detail |
|---|
public static Sphere createBoundingSphere(BufferWrapper buffer)
buffer - the Cartesian coordinates to be enclosed by the new Sphere.
Sphere encompassing the given coordinates.
IllegalArgumentException - if buffer is null or contains fewer than three values.public static Sphere createBoundingSphere(Iterable<? extends Extent> extents)
extents - the extends to be enclosed by the new Sphere.
IllegalArgumentException - if the Iterable is null.public static Sphere createBoundingSphere(Vec4[] points)
points - the Vec4s to be enclosed by the new Sphere
Sphere encompassing the given array of Vec4s
IllegalArgumentException - if points is null or emptypublic boolean equals(Object o)
equals in class Objectpublic final Vec4 getCenter()
Sphere.
getCenter in interface ExtentVec4 situated at the center of this Spherepublic final double getDiameter()
Sphere. The diameter is twice the radius.
getDiameter in interface ExtentSpherepublic double getEffectiveRadius(Plane plane)
getEffectiveRadius in interface Extentplane - the plane.
public Vec4 getPointOnSphere(LatLon location)
location - the location to compute the point for.
IllegalArgumentException - if the location is null.public double getProjectedArea(View view)
Extent after it is projected into the specified
view's viewport. The returned value is the screen area that this Extent covers in the
infinite plane defined by the view's viewport. This area is not limited to the size of the
view's viewport, and portions of this Extent are not clipped by the view's
frustum.
This returns Double.POSITIVE_INFINITY if the view's eye point is inside this
Extent, or if any portion of this Extent is behind the eye point. In either case, this
Extent has no finite projection on the view.
getProjectedArea in interface Extentview - the View for which to compute a projected screen area.
Extent in square pixels, or
Double.POSITIVE_INFINITY if the view's eye point is inside this
Extent or part of this Extent is behind the view's eye point.public final double getRadius()
Sphere. The radus is the distance from the center to the surface. If an
object's distance to this sphere's center is less than or equal to the radius, then that object is at least
partially within this Sphere.
getRadius in interface Extentpublic int hashCode()
hashCode in class Objectpublic final Intersection[] intersect(Line line)
line is considered to have infinite length in both directions.
intersect in interface Extentline - the Line with which to intersect this Sphere
Sphere and line
IllegalArgumentException - if line is nullpublic final boolean intersects(Frustum frustum)
Frustum intersects this sphere.
intersects in interface Extentfrustum - the frustum to test.
IllegalArgumentException - if the frustum is null.public boolean intersects(Line line)
Line.
intersects in interface Extentline - the Line with which to test for intersection
line intersects or makes a tangent with the surface of this Sphere
IllegalArgumentException - if line is nullpublic boolean intersects(Plane plane)
Plane.
intersects in interface Extentplane - the Plane with which to test for intersection
plane intersects or makes a tangent with the surface of this Sphere
IllegalArgumentException - if plane is nullpublic void render(DrawContext dc)
Sphere to render itself using the DrawContext provided. dc may
not be null.
render in interface Renderabledc - the DrawContext to be used
IllegalArgumentException - if dc is nullDrawContextpublic String toString()
toString in class Object
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||