Class Slab

java.lang.Object
com.rvandoosselaer.blocks.shapes.Slab
All Implemented Interfaces:
Shape
Direct Known Subclasses:
SquareCuboid

public class Slab extends Object implements Shape
A shape implementation for a slab. A slab is actual a cube shape with a controllable y (height) value. If you specify a starting y value of 0 and an end y value of 1, you have a unit cube shape. Only 4 vertices are used per face, 2 vertices are shared.
  • Field Details

    • startY

      protected final float startY
    • endY

      protected final float endY
    • direction

      protected final Direction direction
  • Constructor Details

    • Slab

      public Slab(float startY, float endY)
    • Slab

      public Slab(float startY, float endY, Direction direction)
  • Method Details

    • add

      public void add(com.simsilica.mathd.Vec3i location, Chunk chunk, ChunkMesh chunkMesh)
      Description copied from interface: Shape
      Adds the shape at the location in the chunk to the chunk mesh.
      Specified by:
      add in interface Shape
      Parameters:
      location - of the shape in the chunk
      chunk - of the shape
      chunkMesh - to add the shape to
    • createNorth

      protected void createNorth(com.simsilica.mathd.Vec3i location, com.jme3.math.Quaternion rotation, ChunkMesh chunkMesh, float blockScale, boolean multipleImages)
    • createSouth

      protected void createSouth(com.simsilica.mathd.Vec3i location, com.jme3.math.Quaternion rotation, ChunkMesh chunkMesh, float blockScale, boolean multipleImages)
    • createEast

      protected void createEast(com.simsilica.mathd.Vec3i location, com.jme3.math.Quaternion rotation, ChunkMesh chunkMesh, float blockScale, boolean multipleImages)
    • createWest

      protected void createWest(com.simsilica.mathd.Vec3i location, com.jme3.math.Quaternion rotation, ChunkMesh chunkMesh, float blockScale, boolean multipleImages)
    • createDown

      protected void createDown(com.simsilica.mathd.Vec3i location, com.jme3.math.Quaternion rotation, ChunkMesh chunkMesh, float blockScale, boolean multipleImages)
    • createUp

      protected void createUp(com.simsilica.mathd.Vec3i location, com.jme3.math.Quaternion rotation, ChunkMesh chunkMesh, float blockScale, boolean multipleImages)