voxelImprovements #5

Merged
railgun merged 21 commits from voxelImprovements into master 2024-11-07 15:08:54 -05:00
2 changed files with 18 additions and 3 deletions
Showing only changes of commit c80c8e5b71 - Show all commits

View File

@ -44,16 +44,23 @@ public class ChunkData {
*/ */
int worldZ; int worldZ;
/**
* The stride of the data
*/
int stride;
/** /**
* Creates a chunk data * Creates a chunk data
* @param worldX The word x coordinate * @param worldX The word x coordinate
* @param worldY The word y coordinate * @param worldY The word y coordinate
* @param worldZ The word z coordinate * @param worldZ The word z coordinate
* @param stride The stride of the data
*/ */
public ChunkData(int worldX, int worldY, int worldZ){ public ChunkData(int worldX, int worldY, int worldZ, int stride){
this.worldX = worldX; this.worldX = worldX;
this.worldY = worldY; this.worldY = worldY;
this.worldZ = worldZ; this.worldZ = worldZ;
this.stride = stride;
} }
@ -216,5 +223,13 @@ public class ChunkData {
return new Vector3i(worldX,worldY,worldZ); return new Vector3i(worldX,worldY,worldZ);
} }
/**
* Gets the stride of the data
* @return The stride of the data
*/
public int getStride(){
return stride;
}
} }

View File

@ -98,7 +98,7 @@ public class ClientTerrainManager {
} }
} }
} }
ChunkData data = new ChunkData(message.getworldX(), message.getworldY(), message.getworldZ()); ChunkData data = new ChunkData(message.getworldX(), message.getworldY(), message.getworldZ(), ChunkData.NO_STRIDE);
data.setVoxelType(values); data.setVoxelType(values);
data.setVoxelWeight(weights); data.setVoxelWeight(weights);
terrainCache.addChunkDataToCache( terrainCache.addChunkDataToCache(
@ -127,7 +127,7 @@ public class ClientTerrainManager {
} }
} }
} }
ChunkData data = new ChunkData(message.getworldX(), message.getworldY(), message.getworldZ()); ChunkData data = new ChunkData(message.getworldX(), message.getworldY(), message.getworldZ(), message.getchunkResolution());
data.setVoxelType(values); data.setVoxelType(values);
data.setVoxelWeight(weights); data.setVoxelWeight(weights);
terrainCache.addChunkDataToCache( terrainCache.addChunkDataToCache(