Package com.ardor3d.scenegraph.shape
Class OrientedBox
java.lang.Object
com.ardor3d.scenegraph.Spatial
com.ardor3d.scenegraph.Mesh
com.ardor3d.scenegraph.shape.OrientedBox
- All Implemented Interfaces:
Pickable
,Hintable
,Renderable
,Savable
This primitive represents a box that has options to orient it according to its X/Y/Z axis. It is used to create an
OrientedBoundingBox mostly.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Vector3
Center of the Oriented Box.boolean
If true, the box's vectorStore array correctly represnts the box's corners.protected Vector3
Extents of the box along the x,y,z axis.protected Vector2
Texture coordintae values for the corners of the box.protected Vector2
Texture coordintae values for the corners of the box.protected Vector2
Texture coordintae values for the corners of the box.protected Vector2
Texture coordintae values for the corners of the box.Vector3[]
Vector array used to store the array of 8 corners the box has.protected Vector3
X axis of the Oriented Box.protected Vector3
Y axis of the Oriented Box.protected Vector3
Z axis of the Oriented Box.Fields inherited from class com.ardor3d.scenegraph.Mesh
_defaultColor, _isVisible, _lightState, _meshData, _modelBound, _states, RENDER_VERTEX_ONLY
Fields inherited from class com.ardor3d.scenegraph.Spatial
_controllers, _delegateMap, _dirtyMark, _frustumIntersects, _listener, _localTransform, _name, _parent, _queueDistance, _renderStateList, _sceneHints, _userData, _worldBound, _worldTransform, ON_DIRTY_ATTACHED, ON_DIRTY_BOUNDING, ON_DIRTY_RENDERSTATE, ON_DIRTY_TRANSFORM, ON_DIRTY_TRANSFORM_ONLY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Sets the vectorStore information to the 8 corners of the box.void
Takes the plane and center information and creates the correct vertex,normal,color,texture,index information to represent the OrientedBox.Returns the center of the box.Returns the box's extent vector along the x,y,z.getxAxis()
Returns the x axis of this box.getYAxis()
Gets the Y axis of this OB.getZAxis()
Returns the Z axis of this OB.boolean
Returns if the corners are set corectly.void
read
(InputCapsule capsule) void
Sets the box's center to the given value.void
Sets the box's extent vector to the given value.void
Sets the x axis of this OB.void
Sets the Y axis of this OB.void
Sets the Z axis of this OB.void
write
(OutputCapsule capsule) Methods inherited from class com.ardor3d.scenegraph.Mesh
applyWorldRenderStates, draw, getClassTag, getDefaultColor, getLightState, getMeshData, getModelBound, getModelBound, getWorldNormals, getWorldRenderState, getWorldVectors, intersectsPrimitivesWhere, intersectsWorldBound, intersectsWorldBoundsWhere, isVisible, makeCopy, makeInstanced, render, render, renderArrays, renderVBO, reorderIndices, reorderVertexData, reorderVertexData, setDefaultColor, setDefaultColor, setLightState, setMeshData, setModelBound, setModelBound, setRandomColors, setSolidColor, setVisible, sortLights, supportsBoundsIntersectionRecord, supportsPrimitivesIntersectionRecord, updateModelBound, updateWorldBound
Methods inherited from class com.ardor3d.scenegraph.Spatial
acceptVisitor, addController, addTranslation, addTranslation, clearControllers, clearDirty, clearDirty, clearRenderState, getController, getControllerCount, getControllers, getCurrentRenderDelegate, getLastFrustumIntersection, getListener, getLocalLastFrustumIntersection, getLocalRenderState, getLocalRenderStates, getName, getParent, getParentHintable, getRenderDelegate, getRotation, getScale, getSceneHints, getTransform, getTranslation, getUserData, getWorldBound, getWorldRotation, getWorldScale, getWorldTransform, getWorldTranslation, hasAncestor, isDirty, localToWorld, markDirty, markDirty, onDraw, propagateBoundToRoot, propagateDirtyDown, propagateDirtyUp, propagateStatesFromRoot, propageEventUp, removeController, removeController, removeFromParent, setLastFrustumIntersection, setListener, setName, setParent, setRenderDelegate, setRenderState, setRotation, setRotation, setScale, setScale, setScale, setTransform, setTranslation, setTranslation, setUserData, setWorldRotation, setWorldRotation, setWorldScale, setWorldScale, setWorldScale, setWorldTransform, setWorldTranslation, setWorldTranslation, toString, updateChildren, updateControllers, updateGeometricState, updateGeometricState, updateWorldRenderStates, updateWorldRenderStates, updateWorldTransform, worldToLocal
-
Field Details
-
_center
Center of the Oriented Box. -
_xAxis
X axis of the Oriented Box. -
_yAxis
Y axis of the Oriented Box. -
_zAxis
Z axis of the Oriented Box. -
_extent
Extents of the box along the x,y,z axis. -
_texTopRight
Texture coordintae values for the corners of the box. -
_texTopLeft
Texture coordintae values for the corners of the box. -
_texBotRight
Texture coordintae values for the corners of the box. -
_texBotLeft
Texture coordintae values for the corners of the box. -
_vectorStore
Vector array used to store the array of 8 corners the box has. -
_correctCorners
public boolean _correctCornersIf true, the box's vectorStore array correctly represnts the box's corners.
-
-
Constructor Details
-
OrientedBox
public OrientedBox() -
OrientedBox
Creates a new OrientedBox with the given name.- Parameters:
name
- The name of the new box.
-
-
Method Details
-
computeInformation
public void computeInformation()Takes the plane and center information and creates the correct vertex,normal,color,texture,index information to represent the OrientedBox. -
computeCorners
public void computeCorners()Sets the vectorStore information to the 8 corners of the box. -
getCenter
Returns the center of the box.- Returns:
- The box's center.
-
setCenter
Sets the box's center to the given value. Shallow copy only.- Parameters:
center
- The box's new center.
-
getExtent
Returns the box's extent vector along the x,y,z.- Returns:
- The box's extent vector.
-
setExtent
Sets the box's extent vector to the given value. Shallow copy only.- Parameters:
extent
- The box's new extent.
-
getxAxis
Returns the x axis of this box.- Returns:
- This OB's x axis.
-
setXAxis
Sets the x axis of this OB. Shallow copy.- Parameters:
xAxis
- The new x axis.
-
getYAxis
Gets the Y axis of this OB.- Returns:
- This OB's Y axis.
-
setYAxis
Sets the Y axis of this OB. Shallow copy.- Parameters:
yAxis
- The new Y axis.
-
getZAxis
Returns the Z axis of this OB.- Returns:
- The Z axis.
-
setZAxis
Sets the Z axis of this OB. Shallow copy.- Parameters:
zAxis
- The new Z axis.
-
isCorrectCorners
public boolean isCorrectCorners()Returns if the corners are set corectly.- Returns:
- True if the vectorStore is correct.
-
write
- Specified by:
write
in interfaceSavable
- Overrides:
write
in classMesh
- Parameters:
capsule
- the capsule- Throws:
IOException
- Signals that an I/O exception has occurred.- See Also:
-
read
- Specified by:
read
in interfaceSavable
- Overrides:
read
in classMesh
- Parameters:
capsule
- the input capsule- Throws:
IOException
- Signals that an I/O exception has occurred.- See Also:
-