Package jme3utilities.mesh
Class ClothGrid
java.lang.Object
com.jme3.scene.Mesh
jme3utilities.mesh.ClothGrid
- All Implemented Interfaces:
com.jme3.export.Savable,com.jme3.util.clone.JmeCloneable,Cloneable
public class ClothGrid
extends com.jme3.scene.Mesh
A dynamic, Triangles-mode Mesh (with indices and normals but no texture
coordinates) that renders a subdivided rectangle.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.jme3.scene.Mesh
com.jme3.scene.Mesh.Mode -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidread(com.jme3.export.JmeImporter importer) De-serialize this mesh from the specified importer, for example when loading from a J3O file.voidreposition(int xIndex, int zIndex, com.jme3.math.Vector3f location) Reposition the specified mesh vertex.voidwrite(com.jme3.export.JmeExporter exporter) Serialize this Mesh 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
-
Field Details
-
logger
message logger for this class
-
-
Constructor Details
-
ClothGrid
protected ClothGrid()No-argument constructor needed by SavableClassUtil. -
ClothGrid
public ClothGrid(int xLines, int zLines, float lineSpacing) Instantiate a grid in the X-Z plane, centered on (0,0,0).- Parameters:
xLines- the desired number of grid lines parallel to the X axis (≥2)zLines- the desired number of grid lines parallel to the Z axis (≥2)lineSpacing- the desired initial distance between adjacent grid lines (in mesh units, >0)
-
-
Method Details
-
reposition
public void reposition(int xIndex, int zIndex, com.jme3.math.Vector3f location) Reposition the specified mesh vertex. Use this to deform the mesh without changing its topology. Normals are unaffected.- Parameters:
xIndex- the index of the vertex along the original X axis (≥0, <numZLines)zIndex- the index of the vertex along the original Z axis (≥0, <numXLines)location- the desired vertex location (in mesh coordinates, not null, unaffected)
-
read
De-serialize this mesh from the specified importer, for example when loading from a J3O file.- Specified by:
readin interfacecom.jme3.export.Savable- Overrides:
readin classcom.jme3.scene.Mesh- Parameters:
importer- (not null)- Throws:
IOException- from the importer
-
write
Serialize this Mesh to the specified exporter, for example when saving to a J3O file.- Specified by:
writein interfacecom.jme3.export.Savable- Overrides:
writein classcom.jme3.scene.Mesh- Parameters:
exporter- (not null)- Throws:
IOException- from the exporter
-