com.jme3.scene.shape
Class Box

java.lang.Object
  extended by com.jme3.scene.Mesh
      extended by com.jme3.scene.shape.AbstractBox
          extended by com.jme3.scene.shape.Box
All Implemented Interfaces:
Savable, java.lang.Cloneable

public class Box
extends AbstractBox

A box with solid (filled) faces.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.jme3.scene.Mesh
Mesh.Mode
 
Field Summary
 
Fields inherited from class com.jme3.scene.shape.AbstractBox
center, xExtent, yExtent, zExtent
 
Constructor Summary
Box()
          Empty constructor for serialization only.
Box(float x, float y, float z)
          Creates a new box.
Box(Vector3f center, float x, float y, float z)
          Creates a new box.
Box(Vector3f min, Vector3f max)
          Constructor instantiates a new Box object.
 
Method Summary
 Box clone()
          Creates a clone of this box.
protected  void duUpdateGeometryIndices()
          Convert the indices into the list of vertices that define the box's geometry.
protected  void duUpdateGeometryNormals()
          Update the normals of each of the box's planes.
protected  void duUpdateGeometryTextures()
          Update the points that define the texture of the box.
protected  void duUpdateGeometryVertices()
          Update the position of the vertices that define the box.
 
Methods inherited from class com.jme3.scene.shape.AbstractBox
computeVertices, getCenter, getXExtent, getYExtent, getZExtent, read, updateGeometry, updateGeometry, updateGeometry, write
 
Methods inherited from class com.jme3.scene.Mesh
clearBuffer, cloneForAnim, collideWith, createCollisionData, deepClone, extractVertexData, generateBindPose, getBound, getBuffer, getBufferList, getBuffers, getElementLengths, getFloatBuffer, getId, getIndexBuffer, getIndicesAsList, getLineWidth, getLodLevel, getMaxNumWeights, getMode, getModeStart, getNumLodLevels, getPointSize, getShortBuffer, getTriangle, getTriangle, getTriangle, getTriangleCount, getTriangleCount, getVertexCount, prepareForAnim, scaleTextureCoordinates, setBound, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setDynamic, setElementLengths, setId, setInterleaved, setLineWidth, setLodLevels, setMaxNumWeights, setMode, setModeStart, setPointSize, setStatic, setStreamed, updateBound, updateCounts
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Box

public Box(float x,
           float y,
           float z)
Creates a new box.

The box has a center of 0,0,0 and extends in the out from the center by the given amount in each direction. So, for example, a box with extent of 0.5 would be the unit cube.

Parameters:
x - the size of the box along the x axis, in both directions.
y - the size of the box along the y axis, in both directions.
z - the size of the box along the z axis, in both directions.

Box

public Box(Vector3f center,
           float x,
           float y,
           float z)
Creates a new box.

The box has the given center and extends in the out from the center by the given amount in each direction. So, for example, a box with extent of 0.5 would be the unit cube.

Parameters:
center - the center of the box.
x - the size of the box along the x axis, in both directions.
y - the size of the box along the y axis, in both directions.
z - the size of the box along the z axis, in both directions.

Box

public Box(Vector3f min,
           Vector3f max)
Constructor instantiates a new 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 Spatial.setLocalTranslation(com.jme3.math.Vector3f) and Spatial.setLocalRotation(com.jme3.math.Quaternion) methods to define those properties.

Parameters:
min - the minimum point that defines the box.
max - the maximum point that defines the box.

Box

public Box()
Empty constructor for serialization only. Do not use.

Method Detail

clone

public Box clone()
Creates a clone of this box.

The cloned box will have '_clone' appended to it's name, but all other properties will be the same as this box.

Overrides:
clone in class Mesh
Returns:
A shallow clone of the mesh

duUpdateGeometryIndices

protected void duUpdateGeometryIndices()
Description copied from class: AbstractBox
Convert the indices into the list of vertices that define the box's geometry.

Specified by:
duUpdateGeometryIndices in class AbstractBox

duUpdateGeometryNormals

protected void duUpdateGeometryNormals()
Description copied from class: AbstractBox
Update the normals of each of the box's planes.

Specified by:
duUpdateGeometryNormals in class AbstractBox

duUpdateGeometryTextures

protected void duUpdateGeometryTextures()
Description copied from class: AbstractBox
Update the points that define the texture of the box.

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.

Specified by:
duUpdateGeometryTextures in class AbstractBox

duUpdateGeometryVertices

protected void duUpdateGeometryVertices()
Description copied from class: AbstractBox
Update the position of the vertices that define the box.

These eight points are determined from the minimum and maximum point.

Specified by:
duUpdateGeometryVertices in class AbstractBox