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 Box3fm_kBoxprivate static longserialVersionUID
-
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 voidComputeFromData(Vector3f[] pkVertices)Compute a bounding volume that contains all the points.voidComputeFromData(VertexBuffer pkVBuffer)Compute a bounding volume that contains all the points.booleanContains(Vector3f rkPoint)test for containment of a pointvoidCopyFrom(BoundingVolume pkInput)Make a copy of the bounding volume.voiddispose()Delete memory.Box3fGetBox()BoundingVolume.BVTypeGetBVType()Get the type of BoundingVolume.Vector3fGetCenter()all bounding volumes must define a center and radiusfloatGetRadius()all bounding volumes must define a center and radiusvoidGrowToContain(BoundingVolume pkInput)Change the current bounding volume so that it contains the input bounding volume as well as its old bounding volume.voidSetBox(Box3f kBox)voidSetCenter(Vector3f rkCenter)all bounding volumes must define a center and radiusvoidSetRadius(float fRadius)all bounding volumes must define a center and radiusbooleanTestIntersection(Vector3f rkOrigin, Vector3f rkDirection, float fTMin, float fTMax)Test for intersection of linear component and bound (points of intersection not computed).booleanTestIntersection(BoundingVolume pkInput)Test for intersection of the two bounds.voidTransformBy(Transformation rkTransform, BoundingVolume pkResult)Transform the bounding volume (model-to-world conversion).intWhichSide(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:BoundingVolumeCompute a bounding volume that contains all the points.- Specified by:
ComputeFromDatain classBoundingVolume- Parameters:
pkVertices- array of points.
-
ComputeFromData
public void ComputeFromData(VertexBuffer pkVBuffer)
Description copied from class:BoundingVolumeCompute a bounding volume that contains all the points.- Specified by:
ComputeFromDatain classBoundingVolume- Parameters:
pkVBuffer- VertexBuffer containing points.
-
Contains
public boolean Contains(Vector3f rkPoint)
Description copied from class:BoundingVolumetest for containment of a point- Specified by:
Containsin classBoundingVolume- Parameters:
rkPoint- point to test.- Returns:
- true if contained in this volume..
-
CopyFrom
public void CopyFrom(BoundingVolume pkInput)
Description copied from class:BoundingVolumeMake a copy of the bounding volume.- Specified by:
CopyFromin classBoundingVolume- Parameters:
pkInput- bounding volume to copy into this.
-
dispose
public void dispose()
Description copied from class:GraphicsObjectDelete memory.- Overrides:
disposein classGraphicsObject
-
GetBox
public Box3f GetBox()
-
GetBVType
public BoundingVolume.BVType GetBVType()
Description copied from class:BoundingVolumeGet the type of BoundingVolume.- Specified by:
GetBVTypein classBoundingVolume
-
GetCenter
public Vector3f GetCenter()
Description copied from class:BoundingVolumeall bounding volumes must define a center and radius- Specified by:
GetCenterin classBoundingVolume- Returns:
- center of bounding volume.
-
GetRadius
public float GetRadius()
Description copied from class:BoundingVolumeall bounding volumes must define a center and radius- Specified by:
GetRadiusin classBoundingVolume- Returns:
- radius of bounding volume.
-
GrowToContain
public void GrowToContain(BoundingVolume pkInput)
Description copied from class:BoundingVolumeChange the current bounding volume so that it contains the input bounding volume as well as its old bounding volume.- Specified by:
GrowToContainin 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:BoundingVolumeall bounding volumes must define a center and radius- Specified by:
SetCenterin classBoundingVolume- Parameters:
rkCenter- center of bounding volume.
-
SetRadius
public void SetRadius(float fRadius)
Description copied from class:BoundingVolumeall bounding volumes must define a center and radius- Specified by:
SetRadiusin classBoundingVolume- Parameters:
fRadius- radius of bounding volume.
-
TestIntersection
public boolean TestIntersection(BoundingVolume pkInput)
Description copied from class:BoundingVolumeTest for intersection of the two bounds.- Specified by:
TestIntersectionin classBoundingVolume- Parameters:
pkInput- BoundingVolume.- Returns:
- true if intersects.
-
TestIntersection
public boolean TestIntersection(Vector3f rkOrigin, Vector3f rkDirection, float fTMin, float fTMax)
Description copied from class:BoundingVolumeTest 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:
TestIntersectionin 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:BoundingVolumeTransform the bounding volume (model-to-world conversion).- Specified by:
TransformByin classBoundingVolume- Parameters:
rkTransform- transformationpkResult- updated bounding volume.
-
WhichSide
public int WhichSide(Plane3f rkPlane)
Description copied from class:BoundingVolumeDetermine 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:
WhichSidein classBoundingVolume- Parameters:
rkPlane- plane to test against bounding volume.- Returns:
- positive side: +1; negative side: -1; straddle: 0.
-
-