This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private Vector3f normalForVoxel(int x, int y, int z, Vector3f normal) { | |
float numAdded = 0; | |
normal.set(0, 0, 0); | |
// Iterate through the 26 neighbors of the voxel | |
for (int xd = -1; xd < 2; xd++) { | |
for (int yd = -1; yd < 2; yd++) { | |
for (int zd = -1; zd < 2; zd++) { | |
int xoff = x + xd; | |
int yoff = y + yd; |