|
||||||||||
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.AbstractBox
public abstract class AbstractBox
An eight sided box.
A Box
is defined by a minimal point and a maximal 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.
This class does not control how the geometry data is generated, see Box
and StripBox
for that.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.jme.scene.TriMesh |
---|
TriMesh.Mode |
Nested classes/interfaces inherited from class com.jme.scene.Spatial |
---|
Spatial.CullHint, Spatial.LightCombineMode, Spatial.NormalsMode, Spatial.TextureCombineMode |
Field Summary | |
---|---|
Vector3f |
center
|
float |
xExtent
|
float |
yExtent
|
float |
zExtent
|
Fields inherited from class com.jme.scene.TriMesh |
---|
indexBuffer, mode, triangleQuantity |
Fields inherited from class com.jme.scene.Geometry |
---|
binormalBuf, bound, castsShadows, colorBuf, compVect, defaultColor, displayListID, enabled, fogBuf, hasDirtyVertices, normBuf, states, tangentBuf, texBuf, vboInfo, vertBuf, vertQuantity |
Fields inherited from class com.jme.scene.Spatial |
---|
cullHint, frustrumIntersects, geometricalControllers, isCollidable, lightCombineMode, localRotation, localScale, localTranslation, LOCKED_BOUNDS, LOCKED_BRANCH, LOCKED_MESH_DATA, LOCKED_NONE, LOCKED_SHADOWS, LOCKED_TRANSFORMS, lockedMode, name, normalsMode, parent, queueDistance, renderQueueMode, renderStateList, textureCombineMode, worldBound, worldRotation, worldScale, worldTranslation, zOrder |
Constructor Summary | |
---|---|
AbstractBox(java.lang.String name)
|
Method Summary | |
---|---|
Vector3f[] |
computeVertices()
Deprecated. method will be made protected. |
protected abstract void |
duUpdateGeometryIndices()
Convert the indices into the list of vertices that define the box's tri-mesh. |
protected abstract void |
duUpdateGeometryNormals()
Update the normals of each of the box's planes. |
protected abstract void |
duUpdateGeometryTextures()
Update the points that define the texture of the box. |
protected abstract void |
duUpdateGeometryVertices()
Update the position of the vertices that define the box. |
Vector3f |
getCenter()
Get the centre point of this box. |
float |
getXExtent()
Get the x-axis size (extent) of this box. |
float |
getYExtent()
Get the y-axis size (extent) of this box. |
float |
getZExtent()
Get the z-axis size (extent) of this box. |
void |
read(JMEImporter e)
|
void |
setCenter(Vector3f center)
Deprecated. use updateGeometry(Vector3f, float, float, float) . |
void |
setData(Vector3f center,
float x,
float y,
float z)
Deprecated. use updateGeometry(Vector3f, float, float, float) . |
void |
setData(Vector3f minPoint,
Vector3f maxPoint)
Deprecated. use updateGeometry(Vector3f, Vector3f) . |
void |
updateGeometry()
Rebuilds the box after a property has been directly altered. |
void |
updateGeometry(Vector3f center,
float x,
float y,
float z)
Rebuilds this box based on a new set of parameters. |
void |
updateGeometry(Vector3f minPoint,
Vector3f maxPoint)
Rebuilds this box based on a new set of parameters. |
void |
write(JMEExporter e)
|
Methods inherited from class com.jme.scene.TriMesh |
---|
clearBuffers, draw, findCollisions, findTriangleCollision, findTrianglePick, getIndexBuffer, getMaxIndex, getMeshAsTriangles, getMeshAsTrianglesVertices, getMode, getTriangle, getTriangle, getTriangleCount, getTriangleIndices, getVertIndex, hasCollision, hasTriangleCollision, randomPointOnTriangles, recalcTriangleQuantity, reconstruct, setIndexBuffer, setMode, setTriangleQuantity |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.jme.util.export.Savable |
---|
getClassTag |
Field Detail |
---|
public final Vector3f center
public float xExtent
public float yExtent
public float zExtent
Constructor Detail |
---|
public AbstractBox(java.lang.String name)
Method Detail |
---|
public final Vector3f[] computeVertices()
protected abstract void duUpdateGeometryIndices()
protected abstract void duUpdateGeometryNormals()
protected abstract void duUpdateGeometryTextures()
It's a one-to-one ratio, where each plane of the box has it's own copy of the texture. That is, the texture is repeated one time for each face.
protected abstract void duUpdateGeometryVertices()
These eight points are determined from the minimum and maximum point.
public final Vector3f getCenter()
public final float getXExtent()
public final float getYExtent()
public final float getZExtent()
public void read(JMEImporter e) throws java.io.IOException
read
in interface Savable
read
in class TriMesh
java.io.IOException
public final void setCenter(Vector3f center)
updateGeometry(Vector3f, float, float, float)
.
Note that this does not update the geometry information, in most cases
you will want to use setData(Vector3f, float, float, float)
instead.
center
- the new center.public final void setData(Vector3f center, float x, float y, float z)
updateGeometry(Vector3f, float, float, float)
.
public final void setData(Vector3f minPoint, Vector3f maxPoint)
updateGeometry(Vector3f, Vector3f)
.
public final void updateGeometry()
For example, if you call getXExtent().x = 5.0f
then you will
need to call this method afterwards in order to update the box.
public final void updateGeometry(Vector3f center, float x, float y, float z)
Note that the actual sides will be twice the given extent values because the box extends in both directions from the center for each extent.
center
- the center of the box.x
- the x extent of the box, in each directions.y
- the y extent of the box, in each directions.z
- the z extent of the box, in each directions.public final void updateGeometry(Vector3f minPoint, Vector3f maxPoint)
The box is updated so that the two opposite corners are minPoint
and maxPoint
, the other corners are created from those two positions.
minPoint
- the new minimum point of the box.maxPoint
- the new maximum point of the box.public void write(JMEExporter e) throws java.io.IOException
write
in interface Savable
write
in class TriMesh
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |