Package com.jme3.scene.shape
Class CenterQuad
java.lang.Object
com.jme3.scene.Mesh
com.jme3.scene.shape.CenterQuad
- All Implemented Interfaces:
Savable
,JmeCloneable
,Cloneable
A static, indexed, Triangles-mode mesh for an axis-aligned rectangle in the
X-Y plane.
The rectangle extends from (-width/2, -height/2, 0) to (width/2, height/2, 0) with normals set to (0,0,1).
This differs from Quad
because it puts
(0,0,0) at the rectangle's center instead of in a corner.
-
Nested Class Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
For serialization only.CenterQuad
(float width, float height) Instantiate an unflipped quad in the X-Y plane with the specified width and height.CenterQuad
(float width, float height, boolean flipCoords) Instantiate a quad in the X-Y plane with the specified width and height. -
Method Summary
Modifier and TypeMethodDescriptionfloat
Returns the height (or Y extent).float
getWidth()
Returns the width (or X extent).void
read
(JmeImporter importer) De-serializes from the specified importer, for example when loading from a J3O file.void
write
(JmeExporter exporter) Serializes to the specified exporter, for example when saving to a J3O file.Methods inherited from class com.jme3.scene.Mesh
addMorphTarget, clearBuffer, clearCollisionData, clone, 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
-
CenterQuad
protected CenterQuad()For serialization only. Do not use. -
CenterQuad
public CenterQuad(float width, float height) Instantiate an unflipped quad in the X-Y plane with the specified width and height.- Parameters:
width
- the desired X extent or widthheight
- the desired Y extent or height
-
CenterQuad
public CenterQuad(float width, float height, boolean flipCoords) Instantiate a quad in the X-Y plane with the specified width and height.- Parameters:
width
- the desired X extent or widthheight
- the desired Y extent or heightflipCoords
- true to flip the texture coordinates (v=0 when y=height/2) or false to leave them unflipped (v=1 when y=height/2)
-
-
Method Details
-
getHeight
public float getHeight()Returns the height (or Y extent).- Returns:
- the height
-
getWidth
public float getWidth()Returns the width (or X extent).- Returns:
- the width
-
read
De-serializes from the specified importer, for example when loading from a J3O file.- Specified by:
read
in interfaceSavable
- Overrides:
read
in classMesh
- Parameters:
importer
- the importer to use (not null)- Throws:
IOException
- from the importer
-
write
Serializes to the specified exporter, for example when saving to a J3O file. The current instance is unaffected.- Specified by:
write
in interfaceSavable
- Overrides:
write
in classMesh
- Parameters:
exporter
- the exporter to use (not null)- Throws:
IOException
- from the exporter
-