Package com.ardorcraft.objects
Class QuadBox
java.lang.Object
com.ardor3d.scenegraph.Spatial
com.ardor3d.scenegraph.Mesh
com.ardorcraft.objects.QuadBox
- All Implemented Interfaces:
Pickable
,Hintable
,Renderable
,Savable
QuadBox
is an axis-aligned rectangular prism defined by a center point and x, y, and z extents from that
center (essentially radii.)-
Field Summary
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
ConstructorDescriptionQuadBox()
Constructs a new 1x1x1QuadBox
.Constructs a new 1x1x1QuadBox
with the given name.QuadBox
(String name, ReadOnlyVector3 center, double xExtent, double yExtent, double zExtent) Constructs a newQuadBox
object using the given center and extents.QuadBox
(String name, ReadOnlyVector3 pntA, ReadOnlyVector3 pntB) Constructs a newQuadBox
object using the given two points as opposite corners of the box. -
Method Summary
Modifier and TypeMethodDescriptionclone()
clone
creates a new QuadBox object containing the same data as this one.Vector3[]
double
double
double
void
read
(InputCapsule capsule) void
setData
(ReadOnlyVector3 center, double xExtent, double yExtent, double zExtent) Updates the center point and extents of this box using the defined values.void
setData
(ReadOnlyVector3 pntA, ReadOnlyVector3 pntB) Updates the center point and extents of this box to match an axis-aligned box defined by the two given opposite corners.protected void
setVertexData
sets the vertex positions that define the box using the center point and defined extents.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
-
Constructor Details
-
QuadBox
public QuadBox()Constructs a new 1x1x1QuadBox
. -
QuadBox
Constructs a new 1x1x1QuadBox
with the given name.- Parameters:
name
- the name to give this new box. This is required for identification and comparison purposes.
-
QuadBox
Constructs a newQuadBox
object using the given two points as opposite corners of the box. These two points may be in any order.- Parameters:
name
- the name to give this new box. This is required for identification and comparison purposes.pntA
- the first pointpntB
- the second point.
-
QuadBox
Constructs a newQuadBox
object using the given center and extents. Since the extents represent the distance from the center of the box to the edge, the full length of a side is actually 2 * extent.- Parameters:
name
- the name to give this new box. This is required for identification and comparison purposes.center
- Center of the box.xExtent
- x extent of the boxyExtent
- y extent of the boxzExtent
- z extent of the box
-
-
Method Details
-
getCenter
- Returns:
- the current center of this box.
-
getXExtent
public double getXExtent()- Returns:
- the current X extent of this box.
-
getYExtent
public double getYExtent()- Returns:
- the current Y extent of this box.
-
getZExtent
public double getZExtent()- Returns:
- the current Z extent of this box.
-
setData
Updates the center point and extents of this box to match an axis-aligned box defined by the two given opposite corners.- Parameters:
pntA
- the first pointpntB
- the second point.
-
setData
Updates the center point and extents of this box using the defined values.- Parameters:
center
- The center of the box.xExtent
- x extent of the boxyExtent
- y extent of the boxzExtent
- z extent of the box
-
setVertexData
protected void setVertexData()setVertexData
sets the vertex positions that define the box using the center point and defined extents. -
clone
clone
creates a new QuadBox object containing the same data as this one. -
computeVertices
- Returns:
- a size 8 array of Vectors representing the 8 points of the box.
-
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:
-