fixed LOD issue in client

This commit is contained in:
ZappoMan 2013-05-01 22:57:19 -07:00
parent 0f71627923
commit 6a7ebb3a55
2 changed files with 2 additions and 1 deletions

View file

@ -234,6 +234,7 @@ bool VoxelNode::isInView(const ViewFrustum& viewFrustum) const {
float VoxelNode::distanceToCamera(const ViewFrustum& viewFrustum) const {
AABox box;
getAABox(box);
box.scale(TREE_SCALE);
float distanceToVoxelCenter = sqrtf(powf(viewFrustum.getPosition().x - (box.getCorner().x + box.getSize().x), 2) +
powf(viewFrustum.getPosition().y - (box.getCorner().y + box.getSize().y), 2) +
powf(viewFrustum.getPosition().z - (box.getCorner().z + box.getSize().z), 2));