|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jme.scene.Spatial
com.jme.scene.Geometry
com.jme.scene.TriMesh
com.jme.scene.shape.Box
Box provides an extension of TriMesh. A
Box is defined by a minimal point and a maximum point. The
eight vertices that make the box are then computed. They are computed in such
a way as to generate an axis-aligned box.
| Field Summary | |
static Vector3f |
AXIS_X
|
static Vector3f |
AXIS_Y
|
static Vector3f |
AXIS_Z
|
Vector3f |
center
|
float |
xExtent
|
float |
yExtent
|
float |
zExtent
|
| Fields inherited from class com.jme.scene.TriMesh |
indices, triangleQuantity |
| Fields inherited from class com.jme.scene.Geometry |
bound, color, colorBuf, normal, normBuf, texBuf, texture, vertBuf, vertex, vertQuantity |
| Fields inherited from class com.jme.scene.Spatial |
currentStates, defaultStateList, forceCull, forceView, frustrumIntersects, geometricalControllers, lightCombineMode, localRotation, localScale, localTranslation, name, parent, queueDistance, renderQueueMode, renderStateList, textureCombineMode, worldBound, worldRotation, worldScale, worldTranslation, zOrder |
| Constructor Summary | |
Box()
instantiates a new Box object. |
|
Box(java.lang.String name)
Constructor instantiates a new Box object. |
|
Box(java.lang.String name,
Vector3f center,
float xExtent,
float yExtent,
float zExtent)
Constructs a new box. |
|
Box(java.lang.String name,
Vector3f min,
Vector3f max)
Constructor instantiates a new Box object. |
|
| Method Summary | |
java.lang.Object |
clone()
clone creates a new Box object containing the same data as
this one. |
Vector3f[] |
computeVertices()
|
Vector3f |
getCenter()
Returns the current center of the box. |
void |
setCenter(Vector3f aCenter)
Sets the center of the box. |
void |
setData(Vector3f center,
float xExtent,
float yExtent,
float zExtent,
boolean updateBuffers)
Changes the data of the box so that its center is center
and it extends in the x, y, and z directions by the given extent. |
void |
setData(Vector3f minPoint,
Vector3f maxPoint,
boolean updateBuffers)
Changes the data of the box so that the two opposite corners are minPoint and maxPoint. |
| Methods inherited from class com.jme.scene.TriMesh |
clearBuffers, draw, drawBounds, findCollisions, findTriangleCollision, findTrianglePick, findWorldRotMat, getIndexAsBuffer, getIndices, getMeshAsTriangles, getTriangle, getTriangle, getTriangleQuantity, hasCollision, hasTriangleCollision, putClone, reconstruct, setIndexBuffer, setIndices, updateCollisionTree, updateIndexBuffer |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public float xExtent
public float yExtent
public float zExtent
public final Vector3f center
public static final Vector3f AXIS_X
public static final Vector3f AXIS_Y
public static final Vector3f AXIS_Z
| Constructor Detail |
public Box()
Box object. All information must be
applies later. For internal usage only
public Box(java.lang.String name)
Box object. Center and
vertice information must be supplied later.
name - the name of the scene element. This is required for
identification and comparision purposes.
public Box(java.lang.String name,
Vector3f min,
Vector3f max)
Box object. The minimum and
maximum point are provided. These two points define the shape and size of
the box, but not it's orientation or position. You should use the
setLocalTranslation and setLocalRotation
for those attributes.
name - the name of the scene element. This is required for
identification and comparision purposes.min - the minimum point that defines the box.max - the maximum point that defines the box.
public Box(java.lang.String name,
Vector3f center,
float xExtent,
float yExtent,
float zExtent)
name - Name of the box.center - Center of the box.xExtent - x extent of the box, in both directions.yExtent - y extent of the box, in both directions.zExtent - z extent of the box, in both directions.| Method Detail |
public void setData(Vector3f minPoint,
Vector3f maxPoint,
boolean updateBuffers)
minPoint - The new minPoint of the box.maxPoint - The new maxPoint of the box.updateBuffers - If true, buffers are updated.
public void setData(Vector3f center,
float xExtent,
float yExtent,
float zExtent,
boolean updateBuffers)
center
and it extends in the x, y, and z directions by the given extent. Note
that the actual sides will be 2x the given extent values because the box
extends in + & - from the center for each extent.
center - The center of the box.xExtent - x extent of the box, in both directions.yExtent - y extent of the box, in both directions.zExtent - z extent of the box, in both directions.updateBuffers - If true, buffers are updated.public java.lang.Object clone()
clone creates a new Box object containing the same data as
this one.
public Vector3f[] computeVertices()
public Vector3f getCenter()
public void setCenter(Vector3f aCenter)
aCenter - The new center.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||