History

recursive position vector is same as rendering.

Philip Rosedale committed 13 years ago

Commit 5f60bf61 parent 9d6d17c1 file · +3 −1Browse files

Showing the changes to interface/src/VoxelSystem.cpp (1 of 1 file). Show all

Unified · Split

interface/src/VoxelSystem.cpp+3−1
@@ -38,7 +38,9 @@ int VoxelSystem::initVoxels(Voxel * voxel, float scale, glm::vec3 * position) { · 37 unmodified lines
3838 voxel->children[i] = new Voxel;
3939 newVoxels++;
4040 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);
4244 *position += shift;
4345 newVoxels += initVoxels(voxel->children[i], scale/2.0, position);
4446 *position -= shift;