Package com.rvandoosselaer.blocks
Interface Shape
-
public interface Shape
The interface describing the shape of aBlock
element. Theadd(Vec3i, Chunk, ChunkMesh)
method is called for each block in the chunk when the mesh is constructed using theChunkMeshGenerator
.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CUBE
static java.lang.String
DOUBLE_SLAB
static java.lang.String
PYRAMID
static java.lang.String
SLAB
static java.lang.String
STAIR_BACK
static java.lang.String
STAIR_FRONT
static java.lang.String
STAIR_LEFT
static java.lang.String
STAIR_RIGHT
static java.lang.String
WEDGE_BACK
static java.lang.String
WEDGE_FRONT
static java.lang.String
WEDGE_LEFT
static java.lang.String
WEDGE_RIGHT
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(com.simsilica.mathd.Vec3i location, Chunk chunk, ChunkMesh chunkMesh)
Adds the shape at the location in the chunk to the chunk mesh.static com.jme3.math.Vector3f
createVertex(com.jme3.math.Vector3f vertex, com.simsilica.mathd.Vec3i blockLocation, float blockScale)
A helper method that offsets a vertex based on the location of the block in the chunk and the block scale.
-
-
-
Field Detail
-
CUBE
static final java.lang.String CUBE
- See Also:
- Constant Field Values
-
PYRAMID
static final java.lang.String PYRAMID
- See Also:
- Constant Field Values
-
WEDGE_FRONT
static final java.lang.String WEDGE_FRONT
- See Also:
- Constant Field Values
-
WEDGE_RIGHT
static final java.lang.String WEDGE_RIGHT
- See Also:
- Constant Field Values
-
WEDGE_BACK
static final java.lang.String WEDGE_BACK
- See Also:
- Constant Field Values
-
WEDGE_LEFT
static final java.lang.String WEDGE_LEFT
- See Also:
- Constant Field Values
-
SLAB
static final java.lang.String SLAB
- See Also:
- Constant Field Values
-
DOUBLE_SLAB
static final java.lang.String DOUBLE_SLAB
- See Also:
- Constant Field Values
-
STAIR_FRONT
static final java.lang.String STAIR_FRONT
- See Also:
- Constant Field Values
-
STAIR_RIGHT
static final java.lang.String STAIR_RIGHT
- See Also:
- Constant Field Values
-
STAIR_BACK
static final java.lang.String STAIR_BACK
- See Also:
- Constant Field Values
-
STAIR_LEFT
static final java.lang.String STAIR_LEFT
- See Also:
- Constant Field Values
-
-
Method Detail
-
add
void add(com.simsilica.mathd.Vec3i location, Chunk chunk, ChunkMesh chunkMesh)
Adds the shape at the location in the chunk to the chunk mesh.- Parameters:
location
- of the shape in the chunkchunk
- of the shapechunkMesh
- to add the shape to
-
createVertex
static com.jme3.math.Vector3f createVertex(com.jme3.math.Vector3f vertex, com.simsilica.mathd.Vec3i blockLocation, float blockScale)
A helper method that offsets a vertex based on the location of the block in the chunk and the block scale.- Parameters:
vertex
-blockLocation
-blockScale
-- Returns:
- the same vertex with an offset
-
-