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
    Modifier and Type
    Field
    Description
    static final Logger
    message logger for this class
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    No-argument constructor needed by SavableClassUtil.
     
    ClothGrid(int xLines, int zLines, float lineSpacing)
    Instantiate a grid in the X-Z plane, centered on (0,0,0).
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    read(com.jme3.export.JmeImporter importer)
    De-serialize this mesh from the specified importer, for example when loading from a J3O file.
    void
    reposition(int xIndex, int zIndex, com.jme3.math.Vector3f location)
    Reposition the specified mesh vertex.
    void
    write(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

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • logger

      public static final Logger 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

      public void read(com.jme3.export.JmeImporter importer) throws IOException
      De-serialize this mesh from the specified importer, for example when loading from a J3O file.
      Specified by:
      read in interface com.jme3.export.Savable
      Overrides:
      read in class com.jme3.scene.Mesh
      Parameters:
      importer - (not null)
      Throws:
      IOException - from the importer
    • write

      public void write(com.jme3.export.JmeExporter exporter) throws IOException
      Serialize this Mesh to the specified exporter, for example when saving to a J3O file.
      Specified by:
      write in interface com.jme3.export.Savable
      Overrides:
      write in class com.jme3.scene.Mesh
      Parameters:
      exporter - (not null)
      Throws:
      IOException - from the exporter