|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjme.geometry.bounding.BoundingCylinder
BoundingCylinder
defines a cylinder as a set of all points a
distance r from a line P + tD where D is unit length. We are defining the
cylinder as a subset of this line and therefore finite. All points can be
also defined by the equation Xi = P + RYi where R = [U V D], and U V causes
R to be orthonormal.
Constructor Summary | |
BoundingCylinder()
Constructor instantiates a new BoundingCylinder with
default (zero) attributes. |
|
BoundingCylinder(Vector center,
Vector direction,
Vector u,
Vector v,
float height,
float radius)
Constructor instantiates a new BoundingCylinder with
set attributes. |
Method Summary | |
float |
distance(BoundingVolume volume)
|
void |
generateCoordinateSystem()
generateCoordinateSystem calculates the matrix
R = [U V D]. |
boolean |
hasCollision(BoundingVolume volume)
|
boolean |
isVisible(Frustum frustum)
|
void |
leastSquaresFit(Vector[] points)
leastSquaresFit builds a cylinder from a collection of
points where the radius is the distance from a line approximation to the
furthest point and the height is the direction(max) - direction(min). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BoundingCylinder()
BoundingCylinder
with
default (zero) attributes.
public BoundingCylinder(Vector center, Vector direction, Vector u, Vector v, float height, float radius)
BoundingCylinder
with
set attributes.
center
- the center of the cylinder.direction
- the orientation of the cylinder.u
- the U unit vector to make [u v direction] orthonormal.v
- the V unit vector to make [u v direction] orthonormal.height
- the height of the cylinder.radius
- the radius of the cylinder.Method Detail |
public void generateCoordinateSystem()
generateCoordinateSystem
calculates the matrix
R = [U V D].
public void leastSquaresFit(Vector[] points)
leastSquaresFit
builds a cylinder from a collection of
points where the radius is the distance from a line approximation to the
furthest point and the height is the direction(max) - direction(min). It
is assumed that the matrix [U V D] has been predefined either through
construction or calling generateCoordinateSystem
.
points
- the collection of points that the cylinder contains.public boolean hasCollision(BoundingVolume volume)
hasCollision
in interface BoundingVolume
public float distance(BoundingVolume volume)
distance
in interface BoundingVolume
public boolean isVisible(Frustum frustum)
isVisible
in interface BoundingVolume
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |