Class MBox

java.lang.Object
com.jme3.scene.Mesh
com.simsilica.lemur.geom.MBox
All Implemented Interfaces:
Savable, JmeCloneable, Cloneable

public class MBox extends Mesh implements Savable, Cloneable
A mesh implementation that creates a box with a specified number of slices, masking off one or more sides. Separate slice counts can be provided for x,y,z axes and any or all of the sides can be turns on or off. In other words, this can be used directly as a Box implementation with more triangles (subdivided) or it can be used as a subdivided Quad if only one side it specified.
  • Field Details

  • Constructor Details

    • MBox

      public MBox()
      Serialization only. Do not use.
    • MBox

      public MBox(float xExtent, float yExtent, float zExtent, int xSlices, int ySlices, int zSlices)
    • MBox

      public MBox(float xExtent, float yExtent, float zExtent, int xSlices, int ySlices, int zSlices, int sideMask)
  • Method Details

    • getExtents

      public Vector3f getExtents()
    • resize

      public void resize(Vector3f extents)
    • clone

      public MBox clone()
      Description copied from class: Mesh
      Create a shallow clone of this Mesh. The vertex buffers are shared between this and the clone mesh, the rest of the data is cloned.
      Overrides:
      clone in class Mesh
      Returns:
      A shallow clone of the mesh
    • refreshGeometry

      protected void refreshGeometry()
    • spread

      protected float[] spread(float min, float max, int count)
    • fillSide

      protected int fillSide(int lastIndex, int side, int colAxis, int colCount, int rowAxis, int rowCount, int otherAxis, FloatBuffer verts, FloatBuffer norms, FloatBuffer texes, ShortBuffer index)
    • read

      public void read(JmeImporter e) throws IOException
      Specified by:
      read in interface Savable
      Overrides:
      read in class Mesh
      Throws:
      IOException
    • write

      public void write(JmeExporter e) throws IOException
      Specified by:
      write in interface Savable
      Overrides:
      write in class Mesh
      Throws:
      IOException