public abstract class BoundingVolume extends GraphicsObject implements StreamInterface, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
BoundingVolume.BVType
run-time type information
|
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID |
Constructor and Description |
---|
BoundingVolume()
streaming constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
ComputeFromData(Vector3f[] pkVertices)
Compute a bounding volume that contains all the points.
|
abstract void |
ComputeFromData(VertexBuffer pkVBuffer)
Compute a bounding volume that contains all the points.
|
abstract boolean |
Contains(Vector3f rkPoint)
test for containment of a point
|
abstract void |
CopyFrom(BoundingVolume pkInput)
Make a copy of the bounding volume.
|
abstract BoundingVolume.BVType |
GetBVType()
Get the type of BoundingVolume.
|
abstract Vector3f |
GetCenter()
all bounding volumes must define a center and radius
|
int |
GetDiskUsed(StreamVersion rkVersion)
Returns the size of this object and it's children on disk for the
current StreamVersion parameter.
|
abstract float |
GetRadius()
all bounding volumes must define a center and radius
|
abstract void |
GrowToContain(BoundingVolume pkInput)
Change the current bounding volume so that it contains the input
bounding volume as well as its old bounding volume.
|
void |
Link(Stream rkStream,
Stream.Link pkLink)
Copies this objects children objects from the input Stream's HashTable,
based on the LinkID of the child stored in the pkLink parameter.
|
void |
Load(Stream rkStream,
Stream.Link pkLink)
Loads this object from the input parameter rkStream, using the input
Stream.Link to store the IDs of children objects of this object
for linking after all objects are loaded from the Stream.
|
boolean |
Register(Stream rkStream)
Registers this object with the input Stream parameter.
|
void |
Save(Stream rkStream)
Write this object and all it's children to the Stream.
|
StringTree |
SaveStrings(String acTitle)
Write this object into a StringTree for the scene-graph visualization.
|
abstract void |
SetCenter(Vector3f rkCenter)
all bounding volumes must define a center and radius
|
abstract void |
SetRadius(float fRadius)
all bounding volumes must define a center and radius
|
abstract boolean |
TestIntersection(BoundingVolume pkInput)
Test for intersection of the two bounds.
|
abstract boolean |
TestIntersection(Vector3f rkOrigin,
Vector3f rkDirection,
float fTMin,
float fTMax)
Test for intersection of linear component and bound (points of
intersection not computed).
|
abstract void |
TransformBy(Transformation rkTransform,
BoundingVolume pkResult)
Transform the bounding volume (model-to-world conversion).
|
abstract int |
WhichSide(Plane3f rkPlane)
Determine if the bounding volume is one side of the plane, the other
side, or straddles the plane.
|
dispose, GetAllObjectsByName, GetID, GetName, GetNextID, GetObjectByID, GetObjectByIDBase, GetObjectByName, GetObjectByNameBase, SetName
private static final long serialVersionUID
public abstract void ComputeFromData(Vector3f[] pkVertices)
pkVertices
- array of points.public abstract void ComputeFromData(VertexBuffer pkVBuffer)
pkVBuffer
- VertexBuffer containing points.public abstract boolean Contains(Vector3f rkPoint)
rkPoint
- point to test.public abstract void CopyFrom(BoundingVolume pkInput)
pkInput
- bounding volume to copy into this.public abstract BoundingVolume.BVType GetBVType()
public abstract Vector3f GetCenter()
public int GetDiskUsed(StreamVersion rkVersion)
GetDiskUsed
in interface StreamInterface
GetDiskUsed
in class GraphicsObject
rkVersion
- the current version of the Stream file being created.public abstract float GetRadius()
public abstract void GrowToContain(BoundingVolume pkInput)
pkInput
- bounding volume to grow and contain with.public void Link(Stream rkStream, Stream.Link pkLink)
Link
in interface StreamInterface
Link
in class GraphicsObject
rkStream
- the Stream where the child objects are stored.pkLink
- the Link class from which the child object IDs are read.public void Load(Stream rkStream, Stream.Link pkLink)
Load
in interface StreamInterface
Load
in class GraphicsObject
rkStream
- the Stream from which this object is being read.pkLink
- the Link class for storing the IDs of this object's
children objects.public boolean Register(Stream rkStream)
Register
in interface StreamInterface
Register
in class GraphicsObject
rkStream
- the Stream where the child objects are stored.public void Save(Stream rkStream)
Save
in interface StreamInterface
Save
in class GraphicsObject
rkStream
- the Stream where the child objects are stored.public StringTree SaveStrings(String acTitle)
SaveStrings
in interface StreamInterface
SaveStrings
in class GraphicsObject
acTitle
- the header for this object in the StringTree.public abstract void SetCenter(Vector3f rkCenter)
rkCenter
- center of bounding volume.public abstract void SetRadius(float fRadius)
fRadius
- radius of bounding volume.public abstract boolean TestIntersection(BoundingVolume pkInput)
pkInput
- BoundingVolume.public abstract boolean TestIntersection(Vector3f rkOrigin, Vector3f rkDirection, float fTMin, float fTMax)
rkOrigin
- origin of point.rkDirection
- unit-length direction.fTMin
- min value for parameter t.fTMax
- miax value for parameter t.public abstract void TransformBy(Transformation rkTransform, BoundingVolume pkResult)
rkTransform
- transformationpkResult
- updated bounding volume.public abstract int WhichSide(Plane3f rkPlane)
rkPlane
- plane to test against bounding volume.