Showing the changes to interface/src/VoxelSystem.cpp (1 of 1 file). Show all
Unified · Split
| @@ -38,7 +38,9 @@ int VoxelSystem::initVoxels(Voxel * voxel, float scale, glm::vec3 * position) { · 37 unmodified lines | |||
| 38 | voxel->children[i] = new Voxel; | 38 | voxel->children[i] = new Voxel; |
| 39 | newVoxels++; | 39 | newVoxels++; |
| 40 | childrenCreated++; | 40 | childrenCreated++; |
| 41 | glm::vec3 shift(scale/4.0*((i&4)>>2), scale/4.0*((i&2)>>1), scale/4.0*(i&1)); | 41 | glm::vec3 shift(scale/2.0*((i&4)>>2)-scale/4.0, |
| 42 | scale/2.0*((i&2)>>1)-scale/4.0, | ||
| 43 | scale/2.0*(i&1)-scale/4.0); | ||
| 42 | *position += shift; | 44 | *position += shift; |
| 43 | newVoxels += initVoxels(voxel->children[i], scale/2.0, position); | 45 | newVoxels += initVoxels(voxel->children[i], scale/2.0, position); |
| 44 | *position -= shift; | 46 | *position -= shift; |