Class Box
- All Implemented Interfaces:
Savable
,JmeCloneable
,Cloneable
-
Nested Class Summary
-
Field Summary
Fields inherited from class com.jme3.scene.shape.AbstractBox
center, xExtent, yExtent, zExtent
-
Constructor Summary
ModifierConstructorDescriptionprotected
Box()
Empty constructor for serialization only.Box
(float x, float y, float z) Creates a new box.Deprecated.Due to constant confusion of geometry centers and the center of the box mesh this method has been deprecated.Constructor instantiates a newBox
object. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Creates a clone of this box.protected void
Convert the indices into the list of vertices that define the box's geometry.protected void
Update the normals of each of the box's planes.protected void
Update the points that define the texture of the box.protected void
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
addMorphTarget, clearBuffer, clearCollisionData, cloneFields, cloneForAnim, collideWith, createCollisionData, deepClone, extractVertexData, generateBindPose, generateBindPose, getBound, getBuffer, getBufferList, getBuffers, getElementLengths, getFloatBuffer, getId, getIndexBuffer, getIndicesAsList, getInstanceCount, getLineWidth, getLodLevel, getMaxNumWeights, getMode, getModeStart, getMorphIndex, getMorphTarget, getMorphTargetNames, getMorphTargets, getNumLodLevels, getPatchVertexCount, getPointSize, getShortBuffer, getTriangle, getTriangle, getTriangle, getTriangleCount, getTriangleCount, getVertexCount, hasMorphTargets, isAnimated, isAnimatedByBone, isAnimatedByJoint, jmeClone, prepareForAnim, removeMorphTarget, removeMorphTarget, scaleTextureCoordinates, setBound, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setDynamic, setElementLengths, setId, setInterleaved, setLineWidth, setLodLevels, setMaxNumWeights, setMode, setModeStart, setPatchVertexCount, setStatic, setStreamed, updateBound, updateCounts
-
Constructor Details
-
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
Deprecated.Due to constant confusion of geometry centers and the center of the box mesh this method has been deprecated.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
Constructor instantiates a newBox
object.The minimum and maximum point are provided, these two points define the shape and size of the box but not its orientation or position. You should use the
Spatial.setLocalTranslation(com.jme3.math.Vector3f)
andSpatial.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
protected Box()Empty constructor for serialization only. Do not use.
-
-
Method Details
-
clone
Creates a clone of this box.The cloned box will have '_clone' appended to its name, but all other properties will be the same as this box.
-
doUpdateGeometryIndices
protected void doUpdateGeometryIndices()Description copied from class:AbstractBox
Convert the indices into the list of vertices that define the box's geometry.- Specified by:
doUpdateGeometryIndices
in classAbstractBox
-
doUpdateGeometryNormals
protected void doUpdateGeometryNormals()Description copied from class:AbstractBox
Update the normals of each of the box's planes.- Specified by:
doUpdateGeometryNormals
in classAbstractBox
-
doUpdateGeometryTextures
protected void doUpdateGeometryTextures()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 its own copy of the texture. That is, the texture is repeated one time for each face.
- Specified by:
doUpdateGeometryTextures
in classAbstractBox
-
doUpdateGeometryVertices
protected void doUpdateGeometryVertices()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:
doUpdateGeometryVertices
in classAbstractBox
-