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
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;