Changeset 74 for trunk/VUT/Ogre/src/OgreOctreeHierarchyInterface.cpp
- Timestamp:
- 05/01/05 23:29:27 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/Ogre/src/OgreOctreeHierarchyInterface.cpp
r59 r74 2 2 #include "OgreVisibilityOctreeSceneManager.h" 3 3 #include <OgreOctree.h> 4 //#include <windows.h>4 #include <windows.h> 5 5 6 6 namespace Ogre { … … 19 19 RenderNode(node); 20 20 21 for(int i=0; i<8; i++)21 for(int i=0; i<8; ++i) 22 22 { 23 23 Octree *nextChild = 24 24 static_cast<Octree *>(node)->mChildren[(i & 4) >> 2][(i & 2) >> 1][i & 1]; 25 25 26 if(nextChild)26 if (nextChild) 27 27 { 28 28 mDistanceQueue->push(nextChild); … … 31 31 } 32 32 //----------------------------------------------------------------------- 33 bool OctreeHierarchyInterface::IsLeaf(GtpVisibility::HierarchyNode *node) 33 bool OctreeHierarchyInterface::IsLeaf(GtpVisibility::HierarchyNode *node) const 34 34 { 35 35 Octree *octant = static_cast<Octree *>(node); … … 37 37 for(int i=0; i<8; i++) 38 38 { 39 if (octant->mChildren[(i & 4) >> 2][(i & 2) >> 1][i & 1])39 if (octant->mChildren[(i & 4) >> 2][(i & 2) >> 1][i & 1]) 40 40 return false; 41 41 } … … 44 44 } 45 45 //----------------------------------------------------------------------- 46 bool OctreeHierarchyInterface::HasGeometry(GtpVisibility::HierarchyNode *node) 46 bool OctreeHierarchyInterface::HasGeometry(GtpVisibility::HierarchyNode *node) const 47 47 { 48 48 return static_cast<Octree *>(node)->numNodes() > 0; … … 55 55 //----------------------------------------------------------------------- 56 56 bool OctreeHierarchyInterface::HasGreaterDistance(GtpVisibility::HierarchyNode *node1, 57 GtpVisibility::HierarchyNode *node2) 57 GtpVisibility::HierarchyNode *node2) const 58 58 { 59 59 // matt: change this (inefficient) … … 66 66 } 67 67 //----------------------------------------------------------------------- 68 Real OctreeHierarchyInterface::GetSquaredViewDepth(const Camera* cam, const AxisAlignedBox* box) const 68 Real OctreeHierarchyInterface::GetSquaredViewDepth(const Camera* cam, 69 const AxisAlignedBox* box) const 69 70 { 70 Vector3 mid 71 Vector3 mid = ((box->getMinimum() - box->getMaximum()) * 0.5) + box->getMinimum(); 71 72 return (cam->getDerivedPosition() - mid).squaredLength(); 72 73 } 73 74 //----------------------------------------------------------------------- 74 void OctreeHierarchyInterface::SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible) 75 void OctreeHierarchyInterface::SetNodeVisible(GtpVisibility::HierarchyNode *node, 76 const bool visible) 75 77 { 76 78 #ifdef GTP_VISIBILITY_MODIFIED_OGRE … … 79 81 } 80 82 //----------------------------------------------------------------------- 81 void OctreeHierarchyInterface::SetLastVisited(GtpVisibility::HierarchyNode *node, const int frameId) 83 void OctreeHierarchyInterface::SetLastVisited(GtpVisibility::HierarchyNode *node, 84 const unsigned int frameId) 82 85 { 83 86 #ifdef GTP_VISIBILITY_MODIFIED_OGRE … … 117 120 } 118 121 //----------------------------------------------------------------------- 119 bool OctreeHierarchyInterface::IsNodeVisible(GtpVisibility::HierarchyNode *node) 122 bool OctreeHierarchyInterface::IsNodeVisible(GtpVisibility::HierarchyNode *node) const 120 123 { 121 124 #ifdef GTP_VISIBILITY_MODIFIED_OGRE … … 126 129 } 127 130 //----------------------------------------------------------------------- 128 int OctreeHierarchyInterface::LastVisited(GtpVisibility::HierarchyNode *node) 131 unsigned int OctreeHierarchyInterface::LastVisited(GtpVisibility::HierarchyNode *node) const 129 132 { 130 133 #ifdef GTP_VISIBILITY_MODIFIED_OGRE
Note: See TracChangeset
for help on using the changeset viewer.