- Timestamp:
- 09/04/06 08:56:26 (18 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBvHierarchyInterface.cpp
r1319 r1320 8 8 */ 9 9 10 #include "OgreBv Renderable.h"10 #include "OgreBvhRenderable.h" 11 11 #include "OgreBvHierarchySceneManager.h" 12 12 #include "OgreBvHierarchyInterface.h" … … 15 15 { 16 16 17 KdTreeHierarchyInterface::KdTreeHierarchyInterface(KdTreeSceneManager *sm, RenderSystem *rsys):17 BvHierarchyInterface::BvHierarchyInterface(BvHierarchySceneManager *sm, RenderSystem *rsys): 18 18 PlatformHierarchyInterface(sm, rsys) 19 19 { … … 21 21 } 22 22 23 bool KdTreeHierarchyInterface::IsLeaf(GtpVisibility::HierarchyNode *node) const23 bool BvHierarchyInterface::IsLeaf(GtpVisibility::HierarchyNode *node) const 24 24 { 25 return KDNODEPTR_CAST(node)->isLeaf();25 return BVHNODEPTR_CAST(node)->isLeaf(); 26 26 } 27 27 28 void KdTreeHierarchyInterface::TraverseNode(GtpVisibility::HierarchyNode *node)28 void BvHierarchyInterface::TraverseNode(GtpVisibility::HierarchyNode *node) 29 29 { 30 30 ++ mNumTraversedNodes; 31 31 32 KdTree::Node * kdnode = KDNODEPTR_CAST(node);32 BvHierarchy::Node * kdnode = BVHNODEPTR_CAST(node); 33 33 34 34 // if the node is a leaf and has geometry => render it … … 49 49 } 50 50 51 void KdTreeHierarchyInterface::RenderNode(GtpVisibility::HierarchyNode *node)51 void BvHierarchyInterface::RenderNode(GtpVisibility::HierarchyNode *node) 52 52 { 53 KdTree::Node * kdnode = KDNODEPTR_CAST(node);53 BvHierarchy::Node * kdnode = BVHNODEPTR_CAST(node); 54 54 if (kdnode->lastRendered() != mFrameId) 55 55 { 56 56 kdnode->setLastRendered(mFrameId); 57 KdTreeSceneManager * ksm = static_cast<KdTreeSceneManager *>(mSceneManager);57 BvHierarchySceneManager * ksm = static_cast<BvHierarchySceneManager *>(mSceneManager); 58 58 59 59 ksm->_renderNode(kdnode, mCamera, mOnlyShadowCasters, mLeavePassesInQueue); … … 63 63 } 64 64 65 void KdTreeHierarchyInterface::PullUpVisibility(GtpVisibility::HierarchyNode *node) const65 void BvHierarchyInterface::PullUpVisibility(GtpVisibility::HierarchyNode *node) const 66 66 { 67 KdTree::Node * kdnode = KDNODEPTR_CAST(node);67 BvHierarchy::Node * kdnode = BVHNODEPTR_CAST(node); 68 68 69 69 while (kdnode && !kdnode->isNodeVisible()) … … 74 74 } 75 75 76 float KdTreeHierarchyInterface::GetSquaredDistance(GtpVisibility::HierarchyNode *node) const76 float BvHierarchyInterface::GetSquaredDistance(GtpVisibility::HierarchyNode *node) const 77 77 { 78 const Vector3 pos = KDNODEPTR_CAST(node)->mAABB.getCenter();78 const Vector3 pos = BVHNODEPTR_CAST(node)->mAABB.getCenter(); 79 79 return (mCameraPosition - pos).squaredLength(); 80 80 } 81 81 82 AxisAlignedBox * KdTreeHierarchyInterface::GetBoundingBox(GtpVisibility::HierarchyNode *node)82 AxisAlignedBox * BvHierarchyInterface::GetBoundingBox(GtpVisibility::HierarchyNode *node) 83 83 { 84 84 // reuse box if node is the same … … 87 87 { 88 88 mSavedNode = node; 89 mBox = KDNODEPTR_CAST(node)->_getWorldAABB();89 mBox = BVHNODEPTR_CAST(node)->_getWorldAABB(); 90 90 } 91 91 … … 93 93 } 94 94 95 bool KdTreeHierarchyInterface::HasGeometry(GtpVisibility::HierarchyNode *node) const95 bool BvHierarchyInterface::HasGeometry(GtpVisibility::HierarchyNode *node) const 96 96 { 97 return KDNODEPTR_CAST(node)->hasGeometry();97 return BVHNODEPTR_CAST(node)->hasGeometry(); 98 98 } 99 99 100 void KdTreeHierarchyInterface::SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible) const100 void BvHierarchyInterface::SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible) const 101 101 { 102 KDNODEPTR_CAST(node)->setNodeVisible(visible);102 BVHNODEPTR_CAST(node)->setNodeVisible(visible); 103 103 } 104 104 105 bool KdTreeHierarchyInterface::IsNodeVisible(GtpVisibility::HierarchyNode *node) const105 bool BvHierarchyInterface::IsNodeVisible(GtpVisibility::HierarchyNode *node) const 106 106 { 107 return KDNODEPTR_CAST(node)->isNodeVisible();107 return BVHNODEPTR_CAST(node)->isNodeVisible(); 108 108 } 109 109 110 void KdTreeHierarchyInterface::SetLastVisited(GtpVisibility::HierarchyNode *node, const unsigned int frameId) const110 void BvHierarchyInterface::SetLastVisited(GtpVisibility::HierarchyNode *node, const unsigned int frameId) const 111 111 { 112 KDNODEPTR_CAST(node)->setLastVisited(frameId);112 BVHNODEPTR_CAST(node)->setLastVisited(frameId); 113 113 } 114 114 115 unsigned int KdTreeHierarchyInterface::LastVisited(GtpVisibility::HierarchyNode *node) const115 unsigned int BvHierarchyInterface::LastVisited(GtpVisibility::HierarchyNode *node) const 116 116 { 117 return KDNODEPTR_CAST(node)->lastVisited();117 return BVHNODEPTR_CAST(node)->lastVisited(); 118 118 } 119 119 120 void KdTreeHierarchyInterface::VisualizeCulledNode(GtpVisibility::HierarchyNode *node,120 void BvHierarchyInterface::VisualizeCulledNode(GtpVisibility::HierarchyNode *node, 121 121 GtpVisibility::CullingType type) const 122 122 { 123 WireBoundingBox *box = KDNODEPTR_CAST(node)->getWireBoundingBox();123 WireBoundingBox *box = BVHNODEPTR_CAST(node)->getWireBoundingBox(); 124 124 125 125 if (type == GtpVisibility::FRUSTUM_CULLED) … … 132 132 } 133 133 134 dynamic_cast< KdTreeSceneManager *>(mSceneManager)->getRenderQueue()->addRenderable(box);134 dynamic_cast<BvHierarchySceneManager *>(mSceneManager)->getRenderQueue()->addRenderable(box); 135 135 } 136 136 137 void KdTreeHierarchyInterface::GetNodeGeometryList(GtpVisibility::HierarchyNode *node,137 void BvHierarchyInterface::GetNodeGeometryList(GtpVisibility::HierarchyNode *node, 138 138 GtpVisibility::GeometryVector *geometryList, 139 139 bool includeChildren) 140 140 { 141 KDNODEPTR_CAST(node)->getGeometryList(geometryList);141 BVHNODEPTR_CAST(node)->getGeometryList(geometryList); 142 142 } 143 143
Note: See TracChangeset
for help on using the changeset viewer.