Constructor and Description |
---|
BoundingSphere()
Constructs and initializes a BoundingSphere with radius = 1 at 0 0 0.
|
BoundingSphere(Bounds boundsObject)
Constructs and initializes a BoundingSphere from a bounding object.
|
BoundingSphere(Bounds[] boundsObjects)
Constructs and initializes a BoundingSphere from an array of bounding
objects.
|
BoundingSphere(Point3d center,
double radius)
Constructs and initializes a BoundingSphere from a center and radius.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates a copy of the bounding sphere.
|
Bounds |
closestIntersection(Bounds[] boundsObjects)
Finds closest bounding object that intersects this bounding sphere.
|
void |
combine(Bounds boundsObject)
Combines this bounding sphere with a bounding object so that the
resulting bounding sphere encloses the original bounding sphere and the
given bounds object.
|
void |
combine(Bounds[] boundsObjects)
Combines this bounding sphere with an array of bounding objects so that the
resulting bounding sphere encloses the original bounding sphere and the
given array of bounds object.
|
void |
combine(Point3d point)
Combines this bounding sphere with a point.
|
void |
combine(Point3d[] points)
Combines this bounding sphere with an array of points.
|
boolean |
equals(Object bounds)
Indicates whether the specified
bounds object is
equal to this BoundingSphere object. |
void |
getCenter(Point3d center)
Returns the position of this bounding sphere as a point.
|
double |
getRadius()
Returns the radius of this bounding sphere as a double.
|
int |
hashCode()
Returns a hash code value for this BoundingSphere object
based on the data values in this object.
|
boolean |
intersect(Bounds boundsObject)
Test for intersection with another bounds object.
|
boolean |
intersect(Bounds[] boundsObjects)
Test for intersection with another bounds object.
|
boolean |
intersect(Bounds[] boundsObjects,
BoundingSphere newBoundSphere)
Test for intersection with an array of bounds objects.
|
boolean |
intersect(Bounds boundsObject,
BoundingSphere newBoundSphere)
Test for intersection with another bounds object.
|
boolean |
intersect(Point3d point)
Test for intersection with a point.
|
boolean |
intersect(Point3d origin,
Vector3d direction)
Test for intersection with a ray.
|
boolean |
isEmpty()
Tests whether the bounding sphere is empty.
|
void |
set(Bounds boundsObject)
Sets the value of this BoundingSphere.
|
void |
setCenter(Point3d center)
Sets the position of this bounding sphere from a point.
|
void |
setRadius(double r)
Sets the radius of this bounding sphere from a double.
|
String |
toString()
Returns a string representation of this class.
|
void |
transform(Bounds boundsObject,
Transform3D matrix)
Modifies the bounding sphere so that it bounds the volume
generated by transforming the given bounding object.
|
void |
transform(Transform3D trans)
Transforms this bounding sphere by the given matrix.
|
public BoundingSphere(Point3d center, double radius)
center
- the center of the bounding sphereradius
- the radius of the bounding spherepublic BoundingSphere()
public BoundingSphere(Bounds boundsObject)
boundsObject
- a bounds objectpublic BoundingSphere(Bounds[] boundsObjects)
boundsObjects
- an array of bounds objectspublic double getRadius()
public void setRadius(double r)
r
- the new radius for the bounding spherepublic void getCenter(Point3d center)
public void setCenter(Point3d center)
center
- a Point defining the new center of the bounding spherepublic void set(Bounds boundsObject)
public Object clone()
public boolean equals(Object bounds)
bounds
object is
equal to this BoundingSphere object. They are equal if the
specified bounds
object is an instance of
BoundingSphere and all of the data
members of bounds
are equal to the corresponding
data members in this BoundingSphere.public int hashCode()
public void combine(Bounds boundsObject)
public void combine(Bounds[] boundsObjects)
public void combine(Point3d point)
public void combine(Point3d[] points)
public void transform(Bounds boundsObject, Transform3D matrix)
public void transform(Transform3D trans)
public boolean intersect(Point3d origin, Vector3d direction)
public boolean intersect(Point3d point)
public boolean isEmpty()
public boolean intersect(Bounds boundsObject)
public boolean intersect(Bounds[] boundsObjects)
public boolean intersect(Bounds boundsObject, BoundingSphere newBoundSphere)
boundsObject
- another bounds objectnewBoundSphere
- the new bounding sphere which is the intersection of
the boundsObject and this BoundingSpherepublic boolean intersect(Bounds[] boundsObjects, BoundingSphere newBoundSphere)
boundsObjects
- an array of bounds objectsnewBoundSphere
- the new bounding sphere which is the intersection of
the boundsObject and this BoundingSpherepublic Bounds closestIntersection(Bounds[] boundsObjects)
closestIntersection
in class Bounds
boundsObjects
- an array of bounds objectsCopyright © 2016–2022 SciJava. All rights reserved.