Ignore:
Timestamp:
02/20/06 19:06:03 (18 years ago)
Author:
mattausch
Message:

added ogre dependencies and patched ogre sources

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OGRE/trunk/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctreeSceneManager.cpp

    r318 r657  
    536536SceneNode * OctreeSceneManager::createSceneNode( const String &name ) 
    537537{ 
     538    // Check name not used 
     539    if (mSceneNodes.find(name) != mSceneNodes.end()) 
     540    { 
     541        OGRE_EXCEPT( 
     542            Exception::ERR_DUPLICATE_ITEM, 
     543            "A scene node with the name " + name + " already exists", 
     544            "OctreeSceneManager::createSceneNode" ); 
     545    } 
    538546    OctreeNode * on = new OctreeNode( this, name ); 
    539547    mSceneNodes[ on->getName() ] = on; 
     
    548556void OctreeSceneManager::_alertVisibleObjects( void ) 
    549557{ 
     558    OGRE_EXCEPT( Exception::UNIMPLEMENTED_FEATURE, 
     559        "Function doesn't do as advertised", 
     560        "OctreeSceneManager::_alertVisibleObjects" ); 
     561 
    550562    NodeList::iterator it = mVisible.begin(); 
    551563 
     
    570582 
    571583        if ( c != 0 ) 
    572             cam = getCamera( "CullCamera" ); 
     584            cam = c; 
    573585    } 
    574586 
     
    680692        } 
    681693 
    682         if ( octant -> mChildren[ 0 ][ 0 ][ 0 ] != 0 ) 
    683             walkOctree( camera, queue, octant -> mChildren[ 0 ][ 0 ][ 0 ], ( v == OctreeCamera::FULL ), onlyShadowCasters ); 
    684  
    685         if ( octant -> mChildren[ 1 ][ 0 ][ 0 ] != 0 ) 
    686             walkOctree( camera, queue, octant -> mChildren[ 1 ][ 0 ][ 0 ], ( v == OctreeCamera::FULL ), onlyShadowCasters ); 
    687  
    688         if ( octant -> mChildren[ 0 ][ 1 ][ 0 ] != 0 ) 
    689             walkOctree( camera, queue, octant -> mChildren[ 0 ][ 1 ][ 0 ], ( v == OctreeCamera::FULL ), onlyShadowCasters ); 
    690  
    691         if ( octant -> mChildren[ 1 ][ 1 ][ 0 ] != 0 ) 
    692             walkOctree( camera, queue, octant -> mChildren[ 1 ][ 1 ][ 0 ], ( v == OctreeCamera::FULL ), onlyShadowCasters ); 
    693  
    694         if ( octant -> mChildren[ 0 ][ 0 ][ 1 ] != 0 ) 
    695             walkOctree( camera, queue, octant -> mChildren[ 0 ][ 0 ][ 1 ], ( v == OctreeCamera::FULL ), onlyShadowCasters ); 
    696  
    697         if ( octant -> mChildren[ 1 ][ 0 ][ 1 ] != 0 ) 
    698             walkOctree( camera, queue, octant -> mChildren[ 1 ][ 0 ][ 1 ], ( v == OctreeCamera::FULL ), onlyShadowCasters ); 
    699  
    700         if ( octant -> mChildren[ 0 ][ 1 ][ 1 ] != 0 ) 
    701             walkOctree( camera, queue, octant -> mChildren[ 0 ][ 1 ][ 1 ], ( v == OctreeCamera::FULL ), onlyShadowCasters ); 
    702  
    703         if ( octant -> mChildren[ 1 ][ 1 ][ 1 ] != 0 ) 
    704             walkOctree( camera, queue, octant -> mChildren[ 1 ][ 1 ][ 1 ], ( v == OctreeCamera::FULL ), onlyShadowCasters ); 
     694        Octree* child; 
     695        bool childfoundvisible = (v == OctreeCamera::FULL); 
     696        if ( (child = octant -> mChildren[ 0 ][ 0 ][ 0 ]) != 0 ) 
     697            walkOctree( camera, queue, child, childfoundvisible, onlyShadowCasters ); 
     698 
     699        if ( (child = octant -> mChildren[ 1 ][ 0 ][ 0 ]) != 0 ) 
     700            walkOctree( camera, queue, child, childfoundvisible, onlyShadowCasters ); 
     701 
     702        if ( (child = octant -> mChildren[ 0 ][ 1 ][ 0 ]) != 0 ) 
     703            walkOctree( camera, queue, child, childfoundvisible, onlyShadowCasters ); 
     704 
     705        if ( (child = octant -> mChildren[ 1 ][ 1 ][ 0 ]) != 0 ) 
     706            walkOctree( camera, queue, child, childfoundvisible, onlyShadowCasters ); 
     707 
     708        if ( (child = octant -> mChildren[ 0 ][ 0 ][ 1 ]) != 0 ) 
     709            walkOctree( camera, queue, child, childfoundvisible, onlyShadowCasters ); 
     710 
     711        if ( (child = octant -> mChildren[ 1 ][ 0 ][ 1 ]) != 0 ) 
     712            walkOctree( camera, queue, child, childfoundvisible, onlyShadowCasters ); 
     713 
     714        if ( (child = octant -> mChildren[ 0 ][ 1 ][ 1 ]) != 0 ) 
     715            walkOctree( camera, queue, child, childfoundvisible, onlyShadowCasters ); 
     716 
     717        if ( (child = octant -> mChildren[ 1 ][ 1 ][ 1 ]) != 0 ) 
     718            walkOctree( camera, queue, child, childfoundvisible, onlyShadowCasters ); 
    705719 
    706720    } 
     
    754768        } 
    755769 
    756  
    757  
    758         if ( octant -> mChildren[ 0 ][ 0 ][ 0 ] != 0 ) 
    759                 _findNodes( t, list, exclude, full, octant -> mChildren[ 0 ][ 0 ][ 0 ] ); 
    760  
    761         if ( octant -> mChildren[ 1 ][ 0 ][ 0 ] != 0 ) 
    762                 _findNodes( t, list, exclude, full, octant -> mChildren[ 1 ][ 0 ][ 0 ] ); 
    763  
    764         if ( octant -> mChildren[ 0 ][ 1 ][ 0 ] != 0 ) 
    765                 _findNodes( t, list, exclude, full, octant -> mChildren[ 0 ][ 1 ][ 0 ] ); 
    766  
    767         if ( octant -> mChildren[ 1 ][ 1 ][ 0 ] != 0 ) 
    768                 _findNodes( t, list, exclude, full, octant -> mChildren[ 1 ][ 1 ][ 0 ] ); 
    769  
    770         if ( octant -> mChildren[ 0 ][ 0 ][ 1 ] != 0 ) 
    771                 _findNodes( t, list, exclude, full, octant -> mChildren[ 0 ][ 0 ][ 1 ] ); 
    772  
    773         if ( octant -> mChildren[ 1 ][ 0 ][ 1 ] != 0 ) 
    774                 _findNodes( t, list, exclude, full, octant -> mChildren[ 1 ][ 0 ][ 1 ] ); 
    775  
    776         if ( octant -> mChildren[ 0 ][ 1 ][ 1 ] != 0 ) 
    777                 _findNodes( t, list, exclude, full, octant -> mChildren[ 0 ][ 1 ][ 1 ] ); 
    778  
    779         if ( octant -> mChildren[ 1 ][ 1 ][ 1 ] != 0 ) 
    780                 _findNodes( t, list, exclude, full, octant -> mChildren[ 1 ][ 1 ][ 1 ] ); 
     770        Octree* child; 
     771 
     772        if ( (child=octant -> mChildren[ 0 ][ 0 ][ 0 ]) != 0 ) 
     773                _findNodes( t, list, exclude, full, child ); 
     774 
     775        if ( (child=octant -> mChildren[ 1 ][ 0 ][ 0 ]) != 0 ) 
     776                _findNodes( t, list, exclude, full, child ); 
     777 
     778        if ( (child=octant -> mChildren[ 0 ][ 1 ][ 0 ]) != 0 ) 
     779                _findNodes( t, list, exclude, full, child ); 
     780 
     781        if ( (child=octant -> mChildren[ 1 ][ 1 ][ 0 ]) != 0 ) 
     782                _findNodes( t, list, exclude, full, child ); 
     783 
     784        if ( (child=octant -> mChildren[ 0 ][ 0 ][ 1 ]) != 0 ) 
     785                _findNodes( t, list, exclude, full, child ); 
     786 
     787        if ( (child=octant -> mChildren[ 1 ][ 0 ][ 1 ]) != 0 ) 
     788                _findNodes( t, list, exclude, full, child ); 
     789 
     790        if ( (child=octant -> mChildren[ 0 ][ 1 ][ 1 ]) != 0 ) 
     791                _findNodes( t, list, exclude, full, child ); 
     792 
     793        if ( (child=octant -> mChildren[ 1 ][ 1 ][ 1 ]) != 0 ) 
     794                _findNodes( t, list, exclude, full, child ); 
    781795 
    782796} 
     
    827841        } 
    828842 
    829  
    830  
    831         if ( octant -> mChildren[ 0 ][ 0 ][ 0 ] != 0 ) 
    832                 _findNodes( t, list, exclude, full, octant -> mChildren[ 0 ][ 0 ][ 0 ] ); 
    833  
    834         if ( octant -> mChildren[ 1 ][ 0 ][ 0 ] != 0 ) 
    835                 _findNodes( t, list, exclude, full, octant -> mChildren[ 1 ][ 0 ][ 0 ] ); 
    836  
    837         if ( octant -> mChildren[ 0 ][ 1 ][ 0 ] != 0 ) 
    838                 _findNodes( t, list, exclude, full, octant -> mChildren[ 0 ][ 1 ][ 0 ] ); 
    839  
    840         if ( octant -> mChildren[ 1 ][ 1 ][ 0 ] != 0 ) 
    841                 _findNodes( t, list, exclude, full, octant -> mChildren[ 1 ][ 1 ][ 0 ] ); 
    842  
    843         if ( octant -> mChildren[ 0 ][ 0 ][ 1 ] != 0 ) 
    844                 _findNodes( t, list, exclude, full, octant -> mChildren[ 0 ][ 0 ][ 1 ] ); 
    845  
    846         if ( octant -> mChildren[ 1 ][ 0 ][ 1 ] != 0 ) 
    847                 _findNodes( t, list, exclude, full, octant -> mChildren[ 1 ][ 0 ][ 1 ] ); 
    848  
    849         if ( octant -> mChildren[ 0 ][ 1 ][ 1 ] != 0 ) 
    850                 _findNodes( t, list, exclude, full, octant -> mChildren[ 0 ][ 1 ][ 1 ] ); 
    851  
    852         if ( octant -> mChildren[ 1 ][ 1 ][ 1 ] != 0 ) 
    853                 _findNodes( t, list, exclude, full, octant -> mChildren[ 1 ][ 1 ][ 1 ] ); 
     843        Octree* child; 
     844 
     845        if ( (child=octant -> mChildren[ 0 ][ 0 ][ 0 ]) != 0 ) 
     846                _findNodes( t, list, exclude, full, child ); 
     847 
     848        if ( (child=octant -> mChildren[ 1 ][ 0 ][ 0 ]) != 0 ) 
     849                _findNodes( t, list, exclude, full, child ); 
     850 
     851        if ( (child=octant -> mChildren[ 0 ][ 1 ][ 0 ]) != 0 ) 
     852                _findNodes( t, list, exclude, full, child ); 
     853 
     854        if ( (child=octant -> mChildren[ 1 ][ 1 ][ 0 ]) != 0 ) 
     855                _findNodes( t, list, exclude, full, child ); 
     856 
     857        if ( (child=octant -> mChildren[ 0 ][ 0 ][ 1 ]) != 0 ) 
     858                _findNodes( t, list, exclude, full, child ); 
     859 
     860        if ( (child=octant -> mChildren[ 1 ][ 0 ][ 1 ]) != 0 ) 
     861                _findNodes( t, list, exclude, full, child ); 
     862 
     863        if ( (child=octant -> mChildren[ 0 ][ 1 ][ 1 ]) != 0 ) 
     864                _findNodes( t, list, exclude, full, child ); 
     865 
     866        if ( (child=octant -> mChildren[ 1 ][ 1 ][ 1 ]) != 0 ) 
     867                _findNodes( t, list, exclude, full, child ); 
    854868 
    855869} 
     
    901915        } 
    902916 
    903  
    904  
    905         if ( octant -> mChildren[ 0 ][ 0 ][ 0 ] != 0 ) 
    906                 _findNodes( t, list, exclude, full, octant -> mChildren[ 0 ][ 0 ][ 0 ] ); 
    907  
    908         if ( octant -> mChildren[ 1 ][ 0 ][ 0 ] != 0 ) 
    909                 _findNodes( t, list, exclude, full, octant -> mChildren[ 1 ][ 0 ][ 0 ] ); 
    910  
    911         if ( octant -> mChildren[ 0 ][ 1 ][ 0 ] != 0 ) 
    912                 _findNodes( t, list, exclude, full, octant -> mChildren[ 0 ][ 1 ][ 0 ] ); 
    913  
    914         if ( octant -> mChildren[ 1 ][ 1 ][ 0 ] != 0 ) 
    915                 _findNodes( t, list, exclude, full, octant -> mChildren[ 1 ][ 1 ][ 0 ] ); 
    916  
    917         if ( octant -> mChildren[ 0 ][ 0 ][ 1 ] != 0 ) 
    918                 _findNodes( t, list, exclude, full, octant -> mChildren[ 0 ][ 0 ][ 1 ] ); 
    919  
    920         if ( octant -> mChildren[ 1 ][ 0 ][ 1 ] != 0 ) 
    921                 _findNodes( t, list, exclude, full, octant -> mChildren[ 1 ][ 0 ][ 1 ] ); 
    922  
    923         if ( octant -> mChildren[ 0 ][ 1 ][ 1 ] != 0 ) 
    924                 _findNodes( t, list, exclude, full, octant -> mChildren[ 0 ][ 1 ][ 1 ] ); 
    925  
    926         if ( octant -> mChildren[ 1 ][ 1 ][ 1 ] != 0 ) 
    927                 _findNodes( t, list, exclude, full, octant -> mChildren[ 1 ][ 1 ][ 1 ] ); 
     917        Octree* child; 
     918 
     919        if ( (child=octant -> mChildren[ 0 ][ 0 ][ 0 ]) != 0 ) 
     920                _findNodes( t, list, exclude, full, child ); 
     921 
     922        if ( (child=octant -> mChildren[ 1 ][ 0 ][ 0 ]) != 0 ) 
     923                _findNodes( t, list, exclude, full, child ); 
     924 
     925        if ( (child=octant -> mChildren[ 0 ][ 1 ][ 0 ]) != 0 ) 
     926                _findNodes( t, list, exclude, full, child ); 
     927 
     928        if ( (child=octant -> mChildren[ 1 ][ 1 ][ 0 ]) != 0 ) 
     929                _findNodes( t, list, exclude, full, child ); 
     930 
     931        if ( (child=octant -> mChildren[ 0 ][ 0 ][ 1 ]) != 0 ) 
     932                _findNodes( t, list, exclude, full, child ); 
     933 
     934        if ( (child=octant -> mChildren[ 1 ][ 0 ][ 1 ]) != 0 ) 
     935                _findNodes( t, list, exclude, full, child ); 
     936 
     937        if ( (child=octant -> mChildren[ 0 ][ 1 ][ 1 ]) != 0 ) 
     938                _findNodes( t, list, exclude, full, child ); 
     939 
     940        if ( (child=octant -> mChildren[ 1 ][ 1 ][ 1 ]) != 0 ) 
     941                _findNodes( t, list, exclude, full, child ); 
    928942 
    929943} 
     
    974988        } 
    975989 
    976  
    977  
    978         if ( octant -> mChildren[ 0 ][ 0 ][ 0 ] != 0 ) 
    979                 _findNodes( t, list, exclude, full, octant -> mChildren[ 0 ][ 0 ][ 0 ] ); 
    980  
    981         if ( octant -> mChildren[ 1 ][ 0 ][ 0 ] != 0 ) 
    982                 _findNodes( t, list, exclude, full, octant -> mChildren[ 1 ][ 0 ][ 0 ] ); 
    983  
    984         if ( octant -> mChildren[ 0 ][ 1 ][ 0 ] != 0 ) 
    985                 _findNodes( t, list, exclude, full, octant -> mChildren[ 0 ][ 1 ][ 0 ] ); 
    986  
    987         if ( octant -> mChildren[ 1 ][ 1 ][ 0 ] != 0 ) 
    988                 _findNodes( t, list, exclude, full, octant -> mChildren[ 1 ][ 1 ][ 0 ] ); 
    989  
    990         if ( octant -> mChildren[ 0 ][ 0 ][ 1 ] != 0 ) 
    991                 _findNodes( t, list, exclude, full, octant -> mChildren[ 0 ][ 0 ][ 1 ] ); 
    992  
    993         if ( octant -> mChildren[ 1 ][ 0 ][ 1 ] != 0 ) 
    994                 _findNodes( t, list, exclude, full, octant -> mChildren[ 1 ][ 0 ][ 1 ] ); 
    995  
    996         if ( octant -> mChildren[ 0 ][ 1 ][ 1 ] != 0 ) 
    997                 _findNodes( t, list, exclude, full, octant -> mChildren[ 0 ][ 1 ][ 1 ] ); 
    998  
    999         if ( octant -> mChildren[ 1 ][ 1 ][ 1 ] != 0 ) 
    1000                 _findNodes( t, list, exclude, full, octant -> mChildren[ 1 ][ 1 ][ 1 ] ); 
     990        Octree* child; 
     991 
     992        if ( (child=octant -> mChildren[ 0 ][ 0 ][ 0 ]) != 0 ) 
     993                _findNodes( t, list, exclude, full, child ); 
     994 
     995        if ( (child=octant -> mChildren[ 1 ][ 0 ][ 0 ]) != 0 ) 
     996                _findNodes( t, list, exclude, full, child ); 
     997 
     998        if ( (child=octant -> mChildren[ 0 ][ 1 ][ 0 ]) != 0 ) 
     999                _findNodes( t, list, exclude, full, child ); 
     1000 
     1001        if ( (child=octant -> mChildren[ 1 ][ 1 ][ 0 ]) != 0 ) 
     1002                _findNodes( t, list, exclude, full, child ); 
     1003 
     1004        if ( (child=octant -> mChildren[ 0 ][ 0 ][ 1 ]) != 0 ) 
     1005                _findNodes( t, list, exclude, full, child ); 
     1006 
     1007        if ( (child=octant -> mChildren[ 1 ][ 0 ][ 1 ]) != 0 ) 
     1008                _findNodes( t, list, exclude, full, child ); 
     1009 
     1010        if ( (child=octant -> mChildren[ 0 ][ 1 ][ 1 ]) != 0 ) 
     1011                _findNodes( t, list, exclude, full, child ); 
     1012 
     1013        if ( (child=octant -> mChildren[ 1 ][ 1 ][ 1 ]) != 0 ) 
     1014                _findNodes( t, list, exclude, full, child ); 
    10011015 
    10021016} 
     
    10381052 
    10391053    mOctree->mBox = box; 
     1054 
     1055        const Vector3 min = box.getMinimum(); 
     1056        const Vector3 max = box.getMaximum(); 
     1057        mOctree->mHalfSize = ( max - min ) * 0.5f; 
    10401058 
    10411059    it = nodes.begin(); 
Note: See TracChangeset for help on using the changeset viewer.