Changeset 91


Ignore:
Timestamp:
05/11/05 01:23:54 (19 years ago)
Author:
mattausch
Message:
 
Location:
trunk/VUT/Ogre/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp

    r89 r91  
    5050                halfbox->getRenderOperation(ro); 
    5151                ro.srcRenderable = halfbox; 
    52                 mRenderSystem->_render(ro);      
     52                mRenderSystem->_render(ro); 
    5353        } 
    5454} 
     
    105105        query->BeginQuery(); 
    106106                         
    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. 
    109108        // In this case we can also test with the real geometry. 
    110109        if(mUseOptimization && wasVisible && IsLeaf(node)) 
  • trunk/VUT/Ogre/src/OgreSolidHalfBoundingBox.cpp

    r86 r91  
    2323                                                                                                        const bool isFirstHalf)  
    2424{ 
    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 
    3928        // fill the vertex buffer: 12 lines with 2 endpoints each make up a box 
    4029    HardwareVertexBufferSharedPtr vbuf = 
    4130        mRenderOp.vertexData->vertexBufferBinding->getBuffer(POSITION_BINDING);      
    4231 
    43     float* pPos = static_cast<float*>( 
    44         vbuf->lock(HardwareBuffer::HBL_DISCARD)); 
     32    float* pPos = static_cast<float*>(vbuf->lock(HardwareBuffer::HBL_DISCARD)); 
    4533 
    4634        //     5+------+7 
     
    5644        if(isFirstHalf) 
    5745        { 
    58                 *pPos++ = minx; *pPos++ = maxy; *pPos++ = maxz; //011 
    59                 *pPos++ = minx; *pPos++ = miny; *pPos++ = maxz; //001 
    60                 *pPos++ = maxx; *pPos++ = miny; *pPos++ = maxz; //101 
    61                 *pPos++ = maxx; *pPos++ = maxy; *pPos++ = maxz; //111 
     46                *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 
    6250                 
    63                 *pPos++ = maxx; *pPos++ = maxy; *pPos++ = minz; //110 
    64                 *pPos++ = minx; *pPos++ = maxy; *pPos++ = minz; //010 
    65                 *pPos++ = minx; *pPos++ = miny; *pPos++ = minz; //000 
    66                 *pPos++ = minx; *pPos++ = miny; *pPos++ = maxz; //001 
     51                *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 
    6755        } 
    6856        else 
    6957        // fan 2 
    7058        { 
    71                 *pPos++ = maxx; *pPos++ = miny; *pPos++ = minz; //100 
    72                 *pPos++ = minx; *pPos++ = miny; *pPos++ = minz; //000                                    
    73                 *pPos++ = minx; *pPos++ = maxy; *pPos++ = minz; //010 
    74                 *pPos++ = maxx; *pPos++ = maxy; *pPos++ = minz; //110 
     59                *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 
    7563 
    76                 *pPos++ = maxx; *pPos++ = maxy; *pPos++ = maxz; //111 
    77                 *pPos++ = maxx; *pPos++ = miny; *pPos++ = maxz; //101 
    78                 *pPos++ = minx; *pPos++ = miny; *pPos++ = maxz; //001 
    79                 *pPos++ = minx; *pPos++ = miny; *pPos++ = minz; //000 
     64                *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 
    8068        } 
    8169 
     
    8371} 
    8472//----------------------------------------------------------------------- 
    85 void SolidHalfBoundingBox::SetupBoundingBox(const AxisAlignedBox& aabb,  
     73void SolidHalfBoundingBox::SetupBoundingBox(const AxisAlignedBox& aab,  
    8674                                                                                        const bool isFirstHalf)  
    8775{ 
    8876        // 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); 
    9082 
    9183    // setup the bounding box of this SimpleRenderable 
    92         //setBoundingBox(aabb); 
     84        setBoundingBox(aab); 
    9385} 
    9486//----------------------------------------------------------------------- 
  • trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp

    r87 r91  
    1717        mHierarchyInterface =  
    1818                new OctreeHierarchyInterface(this, mDestRenderSystem); 
    19 //      visManager->SetCullingManager(GtpVisibility::VisibilityEnvironment::STOP_AND_WAIT_CULLING); 
     19        //visManager->SetCullingManager(GtpVisibility::VisibilityEnvironment::STOP_AND_WAIT_CULLING); 
     20         
    2021        //mDisplayNodes = true; 
    2122        //mShowBoundingBoxes = true; 
Note: See TracChangeset for help on using the changeset viewer.