Make stairs work
This commit is contained in:
@@ -8,7 +8,7 @@ from assethelpers import getAssetRelativePath
|
||||
|
||||
CHUNK_WIDTH = 16
|
||||
CHUNK_HEIGHT = 16
|
||||
CHUNK_DEPTH = 8
|
||||
CHUNK_DEPTH = 4
|
||||
CHUNK_TILE_COUNT = CHUNK_WIDTH * CHUNK_HEIGHT * CHUNK_DEPTH
|
||||
TILE_WIDTH = 16.0
|
||||
TILE_HEIGHT = 16.0
|
||||
@@ -17,6 +17,7 @@ TILE_DEPTH = 11.36
|
||||
def processTile(tileIndex, x=0, y=0, z=0):
|
||||
vertices = []
|
||||
indices = []
|
||||
tileType = tileIndex
|
||||
|
||||
# Placement X, Y, Z
|
||||
px = x * TILE_WIDTH
|
||||
@@ -59,7 +60,8 @@ def processTile(tileIndex, x=0, y=0, z=0):
|
||||
|
||||
return {
|
||||
'vertices': vertices,
|
||||
'indices': indices
|
||||
'indices': indices,
|
||||
'tileType': tileType
|
||||
}
|
||||
|
||||
def processChunk(path):
|
||||
@@ -88,7 +90,6 @@ def processChunk(path):
|
||||
|
||||
for i, tile in enumerate(inData['tiles']):
|
||||
# Set to chunk
|
||||
chunk['tiles'][i] = tile
|
||||
|
||||
# Calculate x, y, z from i
|
||||
x = i % CHUNK_WIDTH
|
||||
@@ -104,6 +105,7 @@ def processChunk(path):
|
||||
baseModel['indices'].extend(quad_indices)
|
||||
baseModel['vertexCount'] = len(baseModel['vertices'])
|
||||
baseModel['indexCount'] = len(baseModel['indices'])
|
||||
chunk['tiles'][i] = result['tileType']
|
||||
|
||||
# Generate binary buffer for efficient output
|
||||
buffer = bytearray()
|
||||
|
||||
Reference in New Issue
Block a user