Package WildMagic.LibGraphics.SceneGraph
Class BoxBV
- java.lang.Object
-
- WildMagic.LibGraphics.ObjectSystem.GraphicsObject
-
- WildMagic.LibGraphics.SceneGraph.BoundingVolume
-
- WildMagic.LibGraphics.SceneGraph.BoxBV
-
- All Implemented Interfaces:
java.io.Serializable
,StreamInterface
public class BoxBV extends BoundingVolume implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class WildMagic.LibGraphics.SceneGraph.BoundingVolume
BoundingVolume.BVType
-
-
Field Summary
Fields Modifier and Type Field Description protected Box3f
m_kBox
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description BoxBV()
BoxBV(Box3f rkBox)
BoxBV(VertexBuffer pkVBuffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
ComputeFromData(Vector3f[] pkVertices)
Compute a bounding volume that contains all the points.void
ComputeFromData(VertexBuffer pkVBuffer)
Compute a bounding volume that contains all the points.boolean
Contains(Vector3f rkPoint)
test for containment of a pointvoid
CopyFrom(BoundingVolume pkInput)
Make a copy of the bounding volume.void
dispose()
Delete memory.Box3f
GetBox()
BoundingVolume.BVType
GetBVType()
Get the type of BoundingVolume.Vector3f
GetCenter()
all bounding volumes must define a center and radiusfloat
GetRadius()
all bounding volumes must define a center and radiusvoid
GrowToContain(BoundingVolume pkInput)
Change the current bounding volume so that it contains the input bounding volume as well as its old bounding volume.void
SetBox(Box3f kBox)
void
SetCenter(Vector3f rkCenter)
all bounding volumes must define a center and radiusvoid
SetRadius(float fRadius)
all bounding volumes must define a center and radiusboolean
TestIntersection(Vector3f rkOrigin, Vector3f rkDirection, float fTMin, float fTMax)
Test for intersection of linear component and bound (points of intersection not computed).boolean
TestIntersection(BoundingVolume pkInput)
Test for intersection of the two bounds.void
TransformBy(Transformation rkTransform, BoundingVolume pkResult)
Transform the bounding volume (model-to-world conversion).int
WhichSide(Plane3f rkPlane)
Determine if the bounding volume is one side of the plane, the other side, or straddles the plane.-
Methods inherited from class WildMagic.LibGraphics.SceneGraph.BoundingVolume
GetDiskUsed, Link, Load, Register, Save, SaveStrings
-
Methods inherited from class WildMagic.LibGraphics.ObjectSystem.GraphicsObject
GetAllObjectsByName, GetID, GetName, GetNextID, GetObjectByID, GetObjectByIDBase, GetObjectByName, GetObjectByNameBase, SetName
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
m_kBox
protected Box3f m_kBox
-
-
Constructor Detail
-
BoxBV
public BoxBV()
-
BoxBV
public BoxBV(Box3f rkBox)
-
BoxBV
public BoxBV(VertexBuffer pkVBuffer)
-
-
Method Detail
-
ComputeFromData
public void ComputeFromData(Vector3f[] pkVertices)
Description copied from class:BoundingVolume
Compute a bounding volume that contains all the points.- Specified by:
ComputeFromData
in classBoundingVolume
- Parameters:
pkVertices
- array of points.
-
ComputeFromData
public void ComputeFromData(VertexBuffer pkVBuffer)
Description copied from class:BoundingVolume
Compute a bounding volume that contains all the points.- Specified by:
ComputeFromData
in classBoundingVolume
- Parameters:
pkVBuffer
- VertexBuffer containing points.
-
Contains
public boolean Contains(Vector3f rkPoint)
Description copied from class:BoundingVolume
test for containment of a point- Specified by:
Contains
in classBoundingVolume
- Parameters:
rkPoint
- point to test.- Returns:
- true if contained in this volume..
-
CopyFrom
public void CopyFrom(BoundingVolume pkInput)
Description copied from class:BoundingVolume
Make a copy of the bounding volume.- Specified by:
CopyFrom
in classBoundingVolume
- Parameters:
pkInput
- bounding volume to copy into this.
-
dispose
public void dispose()
Description copied from class:GraphicsObject
Delete memory.- Overrides:
dispose
in classGraphicsObject
-
GetBox
public Box3f GetBox()
-
GetBVType
public BoundingVolume.BVType GetBVType()
Description copied from class:BoundingVolume
Get the type of BoundingVolume.- Specified by:
GetBVType
in classBoundingVolume
-
GetCenter
public Vector3f GetCenter()
Description copied from class:BoundingVolume
all bounding volumes must define a center and radius- Specified by:
GetCenter
in classBoundingVolume
- Returns:
- center of bounding volume.
-
GetRadius
public float GetRadius()
Description copied from class:BoundingVolume
all bounding volumes must define a center and radius- Specified by:
GetRadius
in classBoundingVolume
- Returns:
- radius of bounding volume.
-
GrowToContain
public void GrowToContain(BoundingVolume pkInput)
Description copied from class:BoundingVolume
Change the current bounding volume so that it contains the input bounding volume as well as its old bounding volume.- Specified by:
GrowToContain
in classBoundingVolume
- Parameters:
pkInput
- bounding volume to grow and contain with.
-
SetBox
public void SetBox(Box3f kBox)
-
SetCenter
public void SetCenter(Vector3f rkCenter)
Description copied from class:BoundingVolume
all bounding volumes must define a center and radius- Specified by:
SetCenter
in classBoundingVolume
- Parameters:
rkCenter
- center of bounding volume.
-
SetRadius
public void SetRadius(float fRadius)
Description copied from class:BoundingVolume
all bounding volumes must define a center and radius- Specified by:
SetRadius
in classBoundingVolume
- Parameters:
fRadius
- radius of bounding volume.
-
TestIntersection
public boolean TestIntersection(BoundingVolume pkInput)
Description copied from class:BoundingVolume
Test for intersection of the two bounds.- Specified by:
TestIntersection
in classBoundingVolume
- Parameters:
pkInput
- BoundingVolume.- Returns:
- true if intersects.
-
TestIntersection
public boolean TestIntersection(Vector3f rkOrigin, Vector3f rkDirection, float fTMin, float fTMax)
Description copied from class:BoundingVolume
Test for intersection of linear component and bound (points of intersection not computed). The linear component is parameterized by P + t*D, where P is a point on the component and D is a unit-length direction. The interval [tmin,tmax] is line: tmin = -Mathf::MAX_REAL, tmax = Mathf::MAX_REAL ray: tmin = 0.0f, tmax = Mathf::MAX_REAL segment: tmin = 0.0f, tmax > 0.0f- Specified by:
TestIntersection
in classBoundingVolume
- Parameters:
rkOrigin
- origin of point.rkDirection
- unit-length direction.fTMin
- min value for parameter t.fTMax
- miax value for parameter t.- Returns:
- true if intersects.
-
TransformBy
public void TransformBy(Transformation rkTransform, BoundingVolume pkResult)
Description copied from class:BoundingVolume
Transform the bounding volume (model-to-world conversion).- Specified by:
TransformBy
in classBoundingVolume
- Parameters:
rkTransform
- transformationpkResult
- updated bounding volume.
-
WhichSide
public int WhichSide(Plane3f rkPlane)
Description copied from class:BoundingVolume
Determine if the bounding volume is one side of the plane, the other side, or straddles the plane. If it is on the positive side (the side to which the normal points), the return value is +1. If it is on the negative side, the return value is -1. If it straddles the plane, the return value is 0.- Specified by:
WhichSide
in classBoundingVolume
- Parameters:
rkPlane
- plane to test against bounding volume.- Returns:
- positive side: +1; negative side: -1; straddle: 0.
-
-