public class RectangleMesh extends Mesh
It uses a Rectangle
to locate its vertices, which
are named as follows:
C +----+ D |\ | | \ | | \ | | \| A +----+ B
In the vertex buffers, the order of the vertices is A, B, D, then C.
The default texture coordinates have:
Constructor and Description |
---|
RectangleMesh()
Instantiates a unit-square mesh in the X-Y plane, centered at (0.5, 0.5),
with normals in the +Z direction.
|
RectangleMesh(Rectangle rectangle)
Instantiates a rectangle or parallelogram mesh based on the specified
Rectangle . |
RectangleMesh(Vector3f a,
Vector3f b,
Vector3f c)
Instantiates a rectangle or parallelogram mesh based on 3 specified
vertex positions.
|
Modifier and Type | Method and Description |
---|---|
void |
cloneFields(Cloner cloner,
java.lang.Object original)
Called internally by com.jme3.util.clone.Cloner.
|
void |
flip()
Flips this mesh by reversing its normal vector direction and
setting the
flipped variable accordingly. |
Vector3f |
getNormal()
Provides access to the internal normal-direction vector.
|
Rectangle |
getRectangle()
Provides access to the internal
Rectangle on which
the mesh is based. |
Vector2f[] |
getTexCoords()
Provides access to the internal texture-coordinate array.
|
void |
read(JmeImporter importer) |
void |
setRectangle(Rectangle rectangle)
Sets the
Rectangle and updates the mesh
accordingly. |
void |
setTexCoords(Vector2f[] texCoords)
Sets the texture coordinates and updates the mesh accordingly.
|
protected void |
updateMesh() |
void |
write(JmeExporter e) |
addMorphTarget, clearBuffer, clearCollisionData, clone, 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
public RectangleMesh()
public RectangleMesh(Rectangle rectangle)
Rectangle
.rectangle
- to locate the vertices and set the normals (not null,
alias created)public RectangleMesh(Vector3f a, Vector3f b, Vector3f c)
a
- the mesh position of vertex A (not null, alias created)b
- the mesh position of vertex B (not null, alias created)c
- the mesh position of vertex C (not null, alias created)public Rectangle getRectangle()
Rectangle
on which
the mesh is based.public void setRectangle(Rectangle rectangle)
Rectangle
and updates the mesh
accordingly.rectangle
- the desired Rectangle (not null, alias created)public Vector2f[] getTexCoords()
public void setTexCoords(Vector2f[] texCoords) throws java.lang.IllegalArgumentException
texCoords
- the desired texture coordinates for each vertex (not
null, alias created)java.lang.IllegalArgumentException
- if the array length isn't exactly 4public Vector3f getNormal()
public void flip()
flipped
variable accordingly. This variable
will be used by the updateMesh()
method to rearrange
the index buffer.protected void updateMesh()
public void cloneFields(Cloner cloner, java.lang.Object original)
cloneFields
in interface JmeCloneable
cloneFields
in class Mesh
cloner
- The cloner that is performing the cloning operation. The
cloneFields method can call back into the cloner to make
clones of its subordinate fields.original
- The original object from which this object was cloned.
This is provided for the very rare case that this object needs
to refer to its original for some reason. In general, all of
the relevant values should have been transferred during the
shallow clone, and this object need only clone what it wants.public void read(JmeImporter importer) throws java.io.IOException
public void write(JmeExporter e) throws java.io.IOException