diff options
author | megamage <none@none> | 2009-02-04 10:53:58 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-02-04 10:53:58 -0600 |
commit | df7499e0565116c356308839079c36943ba7949c (patch) | |
tree | 5c7b362962dc49e95601eea5ccfe5102b370639d /src/shared/vmap/TreeNode.h | |
parent | 50c82c666093b5dac3cd60cddf9f46223a48d8d9 (diff) | |
parent | 6b19b789ca1757b99a5eaf37fba7c3f555347ab1 (diff) |
*Merge.
--HG--
branch : trunk
Diffstat (limited to 'src/shared/vmap/TreeNode.h')
-rw-r--r-- | src/shared/vmap/TreeNode.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/shared/vmap/TreeNode.h b/src/shared/vmap/TreeNode.h index a957cfac33b..8f3fbd7a71a 100644 --- a/src/shared/vmap/TreeNode.h +++ b/src/shared/vmap/TreeNode.h @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/> * * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> @@ -109,11 +109,11 @@ namespace VMAP // See if the ray will ever hit this node or its children G3D::Vector3 location; bool alreadyInsideBounds = false; - bool rayWillHitBounds = + bool rayWillHitBounds = MyCollisionDetection::collisionLocationForMovingPointFixedAABox( ray.origin, ray.direction, iBounds, location, alreadyInsideBounds); - bool canHitThisNode = (alreadyInsideBounds || + bool canHitThisNode = (alreadyInsideBounds || (rayWillHitBounds && ((location - ray.origin).squaredLength() < (distance*distance)))); return canHitThisNode; @@ -121,8 +121,8 @@ namespace VMAP template<typename RayCallback, typename TNode, typename TValue> void intersectRay( - const G3D::Ray& ray, - RayCallback& intersectCallback, + const G3D::Ray& ray, + RayCallback& intersectCallback, float& distance, const NodeValueAccess<TNode, TValue>& pNodeValueAccess, bool pStopAtFirstHit, @@ -134,7 +134,7 @@ namespace VMAP } // Test for intersection against every object at this node. - for (unsigned int v = iStartPosition; v < (iNumberOfValues+iStartPosition); ++v) { + for (unsigned int v = iStartPosition; v < (iNumberOfValues+iStartPosition); ++v) { const TValue& nodeValue = pNodeValueAccess.getValue(v); bool canHitThisObject = true; if (! intersectCallbackIsFast) { @@ -142,11 +142,11 @@ namespace VMAP G3D::Vector3 location; const G3D::AABox& bounds = nodeValue.getAABoxBounds(); bool alreadyInsideBounds = false; - bool rayWillHitBounds = + bool rayWillHitBounds = MyCollisionDetection::collisionLocationForMovingPointFixedAABox( ray.origin, ray.direction, bounds, location, alreadyInsideBounds); - canHitThisObject = (alreadyInsideBounds || + canHitThisObject = (alreadyInsideBounds || (rayWillHitBounds && ((location - ray.origin).squaredLength() < (distance*distance)))); } @@ -160,7 +160,7 @@ namespace VMAP } // There are three cases to consider next: - // + // // 1. the ray can start on one side of the splitting plane and never enter the other, // 2. the ray can start on one side and enter the other, and // 3. the ray can travel exactly down the splitting plane @@ -205,7 +205,7 @@ namespace VMAP return; } if (ray.direction[iSplitAxis] != 0) { - // See if there was an intersection before hitting the splitting plane. + // See if there was an intersection before hitting the splitting plane. // If so, there is no need to look on the far side and recursion terminates. float distanceToSplittingPlane = (iSplitLocation - ray.origin[iSplitAxis]) / ray.direction[iSplitAxis]; if (distanceToSplittingPlane > distance) { |