mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
recursive position vector is same as rendering.
This commit is contained in:
parent
9d6d17c1bc
commit
5f60bf6376
1 changed files with 3 additions and 1 deletions
|
@ -38,7 +38,9 @@ int VoxelSystem::initVoxels(Voxel * voxel, float scale, glm::vec3 * position) {
|
|||
voxel->children[i] = new Voxel;
|
||||
newVoxels++;
|
||||
childrenCreated++;
|
||||
glm::vec3 shift(scale/4.0*((i&4)>>2), scale/4.0*((i&2)>>1), scale/4.0*(i&1));
|
||||
glm::vec3 shift(scale/2.0*((i&4)>>2)-scale/4.0,
|
||||
scale/2.0*((i&2)>>1)-scale/4.0,
|
||||
scale/2.0*(i&1)-scale/4.0);
|
||||
*position += shift;
|
||||
newVoxels += initVoxels(voxel->children[i], scale/2.0, position);
|
||||
*position -= shift;
|
||||
|
|
Loading…
Reference in a new issue