- Timestamp:
- 05/11/05 01:23:54 (20 years ago)
- Location:
- trunk/VUT/Ogre/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp
r89 r91 50 50 halfbox->getRenderOperation(ro); 51 51 ro.srcRenderable = halfbox; 52 mRenderSystem->_render(ro); 52 mRenderSystem->_render(ro); 53 53 } 54 54 } … … 105 105 query->BeginQuery(); 106 106 107 // if node is leaf and was visible => 108 // will be rendered anyway. 107 // if node is leaf and was visible => will be rendered anyway. 109 108 // In this case we can also test with the real geometry. 110 109 if(mUseOptimization && wasVisible && IsLeaf(node)) -
trunk/VUT/Ogre/src/OgreSolidHalfBoundingBox.cpp
r86 r91 23 23 const bool isFirstHalf) 24 24 { 25 Vector3 vmax = aab.getMaximum(); 26 Vector3 vmin = aab.getMinimum(); 27 28 //Real sqLen = std::max(vmax.squaredLength(), vmin.squaredLength()); 29 //mRadius = Math::Sqrt(sqLen); 30 31 Real maxx = vmax.x; 32 Real maxy = vmax.y; 33 Real maxz = vmax.z; 34 35 Real minx = vmin.x; 36 Real miny = vmin.y; 37 Real minz = vmin.z; 38 25 const Vector3& min = aab.getMinimum(); 26 const Vector3& max = aab.getMaximum(); 27 39 28 // fill the vertex buffer: 12 lines with 2 endpoints each make up a box 40 29 HardwareVertexBufferSharedPtr vbuf = 41 30 mRenderOp.vertexData->vertexBufferBinding->getBuffer(POSITION_BINDING); 42 31 43 float* pPos = static_cast<float*>( 44 vbuf->lock(HardwareBuffer::HBL_DISCARD)); 32 float* pPos = static_cast<float*>(vbuf->lock(HardwareBuffer::HBL_DISCARD)); 45 33 46 34 // 5+------+7 … … 56 44 if(isFirstHalf) 57 45 { 58 *pPos++ = min x; *pPos++ = maxy; *pPos++ = maxz; //01159 *pPos++ = min x; *pPos++ = miny; *pPos++ = maxz; //00160 *pPos++ = max x; *pPos++ = miny; *pPos++ = maxz; //10161 *pPos++ = max x; *pPos++ = maxy; *pPos++ = maxz; //11146 *pPos++ = min.x; *pPos++ = max.y; *pPos++ = max.z; //011 47 *pPos++ = min.x; *pPos++ = min.y; *pPos++ = max.z; //001 48 *pPos++ = max.x; *pPos++ = min.y; *pPos++ = max.z; //101 49 *pPos++ = max.x; *pPos++ = max.y; *pPos++ = max.z; //111 62 50 63 *pPos++ = max x; *pPos++ = maxy; *pPos++ = minz; //11064 *pPos++ = min x; *pPos++ = maxy; *pPos++ = minz; //01065 *pPos++ = min x; *pPos++ = miny; *pPos++ = minz; //00066 *pPos++ = min x; *pPos++ = miny; *pPos++ = maxz; //00151 *pPos++ = max.x; *pPos++ = max.y; *pPos++ = min.z; //110 52 *pPos++ = min.x; *pPos++ = max.y; *pPos++ = min.z; //010 53 *pPos++ = min.x; *pPos++ = min.y; *pPos++ = min.z; //000 54 *pPos++ = min.x; *pPos++ = min.y; *pPos++ = max.z; //001 67 55 } 68 56 else 69 57 // fan 2 70 58 { 71 *pPos++ = max x; *pPos++ = miny; *pPos++ = minz; //10072 *pPos++ = min x; *pPos++ = miny; *pPos++ = minz; //00073 *pPos++ = min x; *pPos++ = maxy; *pPos++ = minz; //01074 *pPos++ = max x; *pPos++ = maxy; *pPos++ = minz; //11059 *pPos++ = max.x; *pPos++ = min.y; *pPos++ = min.z; //100 60 *pPos++ = min.x; *pPos++ = min.y; *pPos++ = min.z; //000 61 *pPos++ = min.x; *pPos++ = max.y; *pPos++ = min.z; //010 62 *pPos++ = max.x; *pPos++ = max.y; *pPos++ = min.z; //110 75 63 76 *pPos++ = max x; *pPos++ = maxy; *pPos++ = maxz; //11177 *pPos++ = max x; *pPos++ = miny; *pPos++ = maxz; //10178 *pPos++ = min x; *pPos++ = miny; *pPos++ = maxz; //00179 *pPos++ = min x; *pPos++ = miny; *pPos++ = minz; //00064 *pPos++ = max.x; *pPos++ = max.y; *pPos++ = max.z; //111 65 *pPos++ = max.x; *pPos++ = min.y; *pPos++ = max.z; //101 66 *pPos++ = min.x; *pPos++ = min.y; *pPos++ = max.z; //001 67 *pPos++ = min.x; *pPos++ = min.y; *pPos++ = min.z; //000 80 68 } 81 69 … … 83 71 } 84 72 //----------------------------------------------------------------------- 85 void SolidHalfBoundingBox::SetupBoundingBox(const AxisAlignedBox& aab b,73 void SolidHalfBoundingBox::SetupBoundingBox(const AxisAlignedBox& aab, 86 74 const bool isFirstHalf) 87 75 { 88 76 // init the vertices to the aabb 89 SetupBoundingBoxVertices(aabb, isFirstHalf); 77 SetupBoundingBoxVertices(aab, isFirstHalf); 78 79 Real sqLen = std::max(aab.getMaximum().squaredLength(), 80 aab.getMinimum().squaredLength()); 81 mRadius = Math::Sqrt(sqLen); 90 82 91 83 // setup the bounding box of this SimpleRenderable 92 //setBoundingBox(aabb);84 setBoundingBox(aab); 93 85 } 94 86 //----------------------------------------------------------------------- -
trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp
r87 r91 17 17 mHierarchyInterface = 18 18 new OctreeHierarchyInterface(this, mDestRenderSystem); 19 // visManager->SetCullingManager(GtpVisibility::VisibilityEnvironment::STOP_AND_WAIT_CULLING); 19 //visManager->SetCullingManager(GtpVisibility::VisibilityEnvironment::STOP_AND_WAIT_CULLING); 20 20 21 //mDisplayNodes = true; 21 22 //mShowBoundingBoxes = true;
Note: See TracChangeset
for help on using the changeset viewer.