Changeset 74 for trunk/VUT/work


Ignore:
Timestamp:
05/01/05 23:29:27 (20 years ago)
Author:
mattausch
Message:

added support for release mode

Location:
trunk/VUT/work
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/work/TestCulling/TestCulling.vcproj

    r64 r74  
    2121                                Name="VCCLCompilerTool" 
    2222                                Optimization="0" 
    23                                 AdditionalIncludeDirectories=""$(OGRE_PATH)\Dependencies\include";"$(OGRE_PATH)\OgreMain\include";"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\Dependencies\include\CEGUI";"$(OGRE_PATH)\PlugIns\OctreeSceneManager\include";"$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\include";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include";../include" 
    24                                 PreprocessorDefinitions="_WINDOWS;_STLP_USE_DYNAMIC_LIB;OGRE_LIBRARY_IMPORTS;_DEBUG;WIN32;_STLP_DEBUG;PLUGIN_TERRAIN_IMPORTS" 
     23                                AdditionalIncludeDirectories=""$(OGRE_PATH)\Dependencies\include";"$(OGRE_PATH)\OgreMain\include";"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\Dependencies\include\CEGUI";"$(OGRE_PATH)\PlugIns\OctreeSceneManager\include";"$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\include";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include";../include;../../GtpVisibility/include" 
     24                                PreprocessorDefinitions="_WINDOWS;_STLP_USE_DYNAMIC_LIB;OGRE_LIBRARY_IMPORTS;_DEBUG;WIN32;_STLP_DEBUG;PLUGIN_TERRAIN_IMPORTS;GTP_VISIBILITY_MODIFIED_OGRE" 
    2525                                MinimalRebuild="TRUE" 
    2626                                BasicRuntimeChecks="3" 
     
    3737                                OutputFile="$(OGRE_PATH)/Samples/Common/bin/Debug/TestCulling.exe" 
    3838                                LinkIncremental="2" 
    39                                 AdditionalLibraryDirectories=""$(OGRE_PATH)\Dependencies\Lib\Debug";"$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\bin\debug";"$(OGRE_PATH)\OgreMain\Lib\Debug";"$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\debug";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib"" 
     39                                AdditionalLibraryDirectories=""$(OGRE_PATH)\Dependencies\Lib\$(ConfigurationName)";"$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\bin\$(ConfigurationName)";"$(OGRE_PATH)\OgreMain\Lib\$(ConfigurationName)";"$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib"" 
    4040                                GenerateDebugInformation="TRUE" 
    4141                                ProgramDatabaseFile="$(OutDir)/TestCulling.pdb" 
     
    6666                <Configuration 
    6767                        Name="Release|Win32" 
    68                         OutputDirectory="Release" 
    69                         IntermediateDirectory="Release" 
     68                        OutputDirectory=".\bin\$(ConfigurationName)" 
     69                        IntermediateDirectory=".\obj\$(ConfigurationName)" 
    7070                        ConfigurationType="1" 
    7171                        CharacterSet="2"> 
    7272                        <Tool 
    7373                                Name="VCCLCompilerTool" 
    74                                 AdditionalIncludeDirectories="..\..\..\Samples\Common\Include, ..\..\..\OgreMain\include" 
    75                                 PreprocessorDefinitions="_WINDOWS,_STLP_USE_DYNAMIC_LIB,OGRE_LIBRARY_IMPORTS,_RELEASE,WIN32,_STLP_RELEASE" 
     74                                AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\Dependencies\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include&quot;;&quot;$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;../include;../../GtpVisibility/include" 
     75                                PreprocessorDefinitions="_WINDOWS;_STLP_USE_DYNAMIC_LIB;OGRE_LIBRARY_IMPORTS;_RELEASE;WIN32;_STLP_RELEASE;GTP_VISIBILITY_MODIFIED_OGRE" 
    7676                                RuntimeLibrary="2" 
    7777                                UsePrecompiledHeader="0" 
     
    8383                        <Tool 
    8484                                Name="VCLinkerTool" 
    85                                 AdditionalDependencies="OGREMain.LIB" 
    86                                 OutputFile="..\..\..\Samples\Common\Bin\Release\TestCulling.exe" 
     85                                AdditionalDependencies="OGREMain.LIB Plugin_OctreeSceneManager.lib CEGUIBase.lib OgreGUIRenderer.lib" 
     86                                OutputFile="$(OGRE_PATH)/Samples/Common/bin/Release/TestCulling.exe" 
    8787                                LinkIncremental="1" 
    88                                 AdditionalLibraryDirectories="..\..\..\OgreMain\Lib\Release" 
     88                                AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\Dependencies\Lib\$(ConfigurationName)&quot;;&quot;$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\OgreMain\Lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;" 
    8989                                GenerateDebugInformation="TRUE" 
    9090                                SubSystem="2" 
  • trunk/VUT/work/TestCulling/TestCullingApplication.cpp

    r61 r74  
    33        TestCullingApplication.cpp 
    44    \brief 
    5         Tests the occlusion culling algorithm 
     5        Tests the visibility culling algorithm 
    66*/ 
    77 
     
    1515#include "Ogre.h" 
    1616#include "TestCullingApplication.h" 
    17 //#include "OgreVisibilitySceneTraverser.h" 
    1817 
    1918#define WIN32_LEAN_AND_MEAN 
     
    9392//----------------------------------------------------------------------- 
    9493void TestCullingApplication::generateSceneObject(const Vector3 &translationRatio,  
    95                                                                                                  const Vector3 &rotationRatio, const int idx, const String& entName) 
     94                                                                                                 const Vector3 &rotationRatio,  
     95                                                                                                 const int idx,  
     96                                                                                                 const String& entName) 
    9697{ 
    9798        Vector3 rotation = mMinAngle + rotationRatio * (mMaxAngle - mMinAngle); 
    98         Vector3 translation = mMinTranslation + translationRatio * (mMaxTranslation - mMinTranslation); 
     99        Vector3 translation = mMinTranslation +  
     100                translationRatio * (mMaxTranslation - mMinTranslation); 
    99101 
    100102        char name[16]; 
    101103    sprintf( name, "object%d", idx ); 
    102104 
    103     Entity *ent = mSceneMgr->createEntity( name, entName ); 
    104         SceneNode *node = mSceneMgr->getRootSceneNode()->createChildSceneNode( String(name) + "Node", translation); 
     105    Entity *ent = mSceneMgr->createEntity(name, entName); 
     106        SceneNode *node = mSceneMgr->getRootSceneNode()-> 
     107                createChildSceneNode(String(name) + "Node", translation); 
    105108        node->attachObject(ent); 
    106109        node->scale(0.1,0.1,0.1); 
     
    150153        mRotateSpeed *= 2; 
    151154 
    152         mCurrentAlgorithm = 0;//VisibilitySceneTraverser::RENDER_COHERENT; 
     155        mCurrentAlgorithm = GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING; 
    153156        mThreshold = 0; 
    154157     
     
    161164        Overlay* pOver = OverlayManager::getSingleton().getByName("Example/VisibilityDemoOverlay");  
    162165 
    163         mAlgorithmInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/AlgorithmInfo"); 
    164         mThresholdInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/ThresholdInfo"); 
    165         mFrustumCulledNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/FrustumCulledNodesInfo"); 
    166         mQueryCulledNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/QueryCulledNodesInfo"); 
    167     mTraversedNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/TraversedNodesInfo"); 
    168         mSceneNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/SceneNodesInfo"); 
    169         mHierarchyNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/HierarchyNodesInfo"); 
    170         mRenderedNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/RenderedNodesInfo"); 
     166        mAlgorithmInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/AlgorithmInfo"); 
     167        mThresholdInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/ThresholdInfo"); 
     168        mFrustumCulledNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/FrustumCulledNodesInfo"); 
     169        mQueryCulledNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/QueryCulledNodesInfo"); 
     170    mTraversedNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/TraversedNodesInfo"); 
     171        mHierarchyNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/HierarchyNodesInfo"); 
     172        mRenderedNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/RenderedNodesInfo"); 
    171173 
    172174        mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]); 
     
    175177        mQueryCulledNodesInfo->setCaption(": 0"); 
    176178        mTraversedNodesInfo->setCaption(": 0"); 
    177         mSceneNodesInfo->setCaption(": 0"); 
    178179        mHierarchyNodesInfo->setCaption(": 0"); 
    179180        mRenderedNodesInfo->setCaption(": 0"); 
     
    275276void MouseQueryListener::changeAlgorithm() 
    276277{ 
    277     //mCurrentAlgorithm = ++mCurrentAlgorithm % VisibilitySceneTraverser::NUM_RENDERMODES; 
     278    mCurrentAlgorithm = ++mCurrentAlgorithm % GtpVisibility::VisibilityEnvironment::NUM_CULLING_MANAGERS, 
    278279 
    279280        mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]); 
     
    295296        mTraversedNodesInfo->setCaption(str); 
    296297 
    297         mSceneMgr->getOption("NumSceneNodes", &opt); sprintf(str,": %d", opt);  
    298         mSceneNodesInfo->setCaption(str); 
    299  
    300         mSceneMgr->getOption("NumOctreeNodes", &opt); sprintf(str,": %d", opt);  
     298        mSceneMgr->getOption("NumHierarchyNodes", &opt); sprintf(str,": %d", opt);  
    301299        mHierarchyNodesInfo->setCaption(str); 
    302300 
  • trunk/VUT/work/TestCulling/TestCullingApplication.h

    r61 r74  
    55#include "CEGUIForwardRefs.h" 
    66#include "ExampleApplication.h" 
    7 //#include "OgreVisibilitySceneTraverser.h" 
     7#include "VisibilityEnvironment.h" 
    88 
    99 
     
    1818} 
    1919 
    20 String mCurrentAlgorithmCaptions[3] =  
     20String mCurrentAlgorithmCaptions[GtpVisibility::VisibilityEnvironment::NUM_CULLING_MANAGERS] =  
    2121{ 
    22     "Cull Frustum",  
    23         "Stop and Wait",  
    24         "Coherent Occlusion Culling" 
     22    "View Frustum Culling",  
     23        "Stop and Wait Culling",  
     24        "Coherent Hierarchical Culling" 
    2525}; 
    2626 
     
    8080    OverlayElement *mTraversedNodesInfo; 
    8181        OverlayElement *mHierarchyNodesInfo; 
    82         OverlayElement *mSceneNodesInfo; 
    8382        OverlayElement *mRenderedNodesInfo; 
    8483}; 
  • trunk/VUT/work/TestCullingTerrain/TerrainContentGenerator.cpp

    r61 r74  
    33        TerrainContentGenerator.cpp 
    44    \brief 
    5         Creates content for the terrain, 
     5        Creates content for the terrain. 
    66*/ 
    77#include "TerrainContentGenerator.h" 
    88 
     9/********************************************/ 
     10/*  TerrainContentGenerator implementation  */ 
     11/********************************************/ 
    912//----------------------------------------------------------------------- 
    1013TerrainContentGenerator::TerrainContentGenerator( SceneManager *sm, RayQueryExecutor *rayQueryEx ) 
     
    1316        mRayQueryExecutor = rayQueryEx; 
    1417 
    15         mMinTranslation = Vector3(-70.0f, -70.0f, 0.0f); 
    16         mMaxTranslation = Vector3(70.0f, 70.0f, 600.0f); 
     18        mMinPos = Vector3(-200.0f, -70.0f, 200.0f); 
     19        mMaxPos = Vector3(200.0f, 70.0f, 200.0f); 
    1720 
    1821        mMinAngle = 0; 
     
    4851        // Setup the ray scene query 
    4952        Real rotation = mMinAngle + rotationRatio.x * (mMaxAngle - mMinAngle); 
    50         Vector3 translation = mMinTranslation + translationRatio * (mMaxTranslation - mMinTranslation); 
     53        Vector3 position = mMinPos + translationRatio * (mMaxPos - mMinPos); 
    5154 
    52         translation.y = 5000; 
     55        position.y = 5000; 
    5356     
    5457        Vector3 queryResult; 
    5558 
    56         if(mRayQueryExecutor->executeRayQuery(&queryResult, translation, Vector3::NEGATIVE_UNIT_Y)) 
     59        if(mRayQueryExecutor->executeRayQuery(&queryResult, position, Vector3::NEGATIVE_UNIT_Y)) 
    5760        { 
    5861                char name[16]; 
     
    6063 
    6164                Entity *ent = mSceneMgr->createEntity(name, entName); 
    62                 SceneNode *currentObject = mSceneMgr->getRootSceneNode( )->createChildSceneNode( String(name) + "Node", queryResult); 
     65                SceneNode *currentObject = mSceneMgr->getRootSceneNode()-> 
     66                        createChildSceneNode(String(name) + "Node", queryResult); 
    6367                currentObject->attachObject(ent); 
    6468                currentObject->setScale(0.1f, 0.1f, 0.1f); 
    6569        } 
    6670} 
     71/****************************************/ 
     72/*  RayQueryExecutor implementation     */ 
     73/****************************************/ 
    6774//----------------------------------------------------------------------- 
    68 RayQueryExecutor::RayQueryExecutor( SceneManager *sm ) 
     75RayQueryExecutor::RayQueryExecutor(SceneManager *sm) 
    6976{ 
    7077        mRaySceneQuery = sm->createRayQuery(Ray()); 
     
    7683} 
    7784//----------------------------------------------------------------------- 
    78 bool RayQueryExecutor::executeRayQuery( Vector3 *result, const Vector3 &pos, const Vector3 &dir ) 
     85bool RayQueryExecutor::executeRayQuery(Vector3 *result, const Vector3 &pos, const Vector3 &dir) 
    7986{ 
    80         Ray ray(pos, dir); 
     87        return executeRayQuery(result, Ray(pos, dir)); 
     88} 
     89 
     90bool RayQueryExecutor::executeRayQuery(Vector3 *result, const Ray &ray) 
     91{ 
    8192    mRaySceneQuery->setRay(ray); 
    8293 
    8394    // Perform the scene query 
    8495    RaySceneQueryResult &queryResult = mRaySceneQuery->execute(); 
    85     RaySceneQueryResult::iterator it = queryResult.begin( ); 
     96    RaySceneQueryResult::iterator it = queryResult.begin(); 
    8697 
    8798        if (it != queryResult.end() && it->worldFragment) 
  • trunk/VUT/work/TestCullingTerrain/TerrainContentGenerator.h

    r61 r74  
    55#include "ExampleApplication.h" 
    66 
     7/** Class which executes a simple ray query. 
     8*/ 
    79class RayQueryExecutor 
    810{ 
    911public: 
    10         RayQueryExecutor( SceneManager *sm ); 
    11         ~RayQueryExecutor( ); 
    12         bool executeRayQuery( Vector3 *result, const Vector3 &pos, const Vector3 &dir ); 
     12        RayQueryExecutor(SceneManager *sm); 
     13        ~RayQueryExecutor(); 
     14         
     15        bool executeRayQuery(Vector3 *result, const Vector3 &pos, const Vector3 &dir); 
     16        bool RayQueryExecutor::executeRayQuery( Vector3 *result, const Ray &ray); 
     17 
    1318protected: 
    1419        RaySceneQuery *mRaySceneQuery; 
    1520}; 
    16  
     21/** Class which fills a terrain with content in a random way. 
     22*/ 
    1723class TerrainContentGenerator 
    1824{ 
    1925public: 
    20         TerrainContentGenerator(  SceneManager *sm, RayQueryExecutor *rayQueryEx ); 
     26        TerrainContentGenerator(SceneManager *sm, RayQueryExecutor *rayQueryEx); 
    2127        /** Generates a the scene hierarchy with random values . 
    22         @param number of objects to generate 
     28                @param number of objects to generate 
    2329        */ 
    24         void generateScene( int numObjects ); 
    25         /**  
    26                 generates a new scene object  
     30        void generateScene(int numObjects); 
     31        /** Generates a new scene object  
    2732                @param tranlationRatio ratio between minimal and maximal possible translation 
    2833                @param rotationRatio ratio between minimal and maximal possible rotation 
     
    3035                @entName the name of the object entity 
    3136        */ 
    32         void generateSceneObject( const Vector3 &translationRatio, const Vector3 &rotationRatio,  
    33                                                           const int idx, const String &entName ); 
     37        void generateSceneObject(const Vector3 &translationRatio, const Vector3 &rotationRatio,  
     38                                                         const int idx, const String &entName); 
    3439 
    3540protected: 
     
    3742        Real mMinAngle; 
    3843        Real mMaxAngle; 
    39         Vector3 mMaxTranslation; 
    40         Vector3 mMinTranslation; 
     44        Vector3 mMaxPos; 
     45        Vector3 mMinPos; 
    4146 
    4247        RayQueryExecutor *mRayQueryExecutor; 
  • trunk/VUT/work/TestCullingTerrain/TestCullingTerrain.vcproj

    r64 r74  
    2121                                Name="VCCLCompilerTool" 
    2222                                Optimization="0" 
    23                                 AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\Dependencies\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include&quot;;&quot;$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;../include" 
    24                                 PreprocessorDefinitions="_WINDOWS;_STLP_USE_DYNAMIC_LIB;OGRE_LIBRARY_IMPORTS;_DEBUG;WIN32;_STLP_DEBUG;PLUGIN_TERRAIN_IMPORTS" 
     23                                AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\Dependencies\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include&quot;;&quot;$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;../../GtpVisibility/include;../include" 
     24                                PreprocessorDefinitions="_WINDOWS;_STLP_USE_DYNAMIC_LIB;OGRE_LIBRARY_IMPORTS;_DEBUG;WIN32;_STLP_DEBUG;PLUGIN_TERRAIN_IMPORTS;GTP_VISIBILITY_MODIFIED_OGRE" 
    2525                                MinimalRebuild="TRUE" 
    2626                                BasicRuntimeChecks="3" 
     
    3737                                OutputFile="$(OGRE_PATH)/Samples/Common/bin/Debug/TestCullingTerrain.exe" 
    3838                                LinkIncremental="2" 
    39                                 AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\Dependencies\Lib\Debug&quot;;&quot;$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\bin\debug&quot;;&quot;$(OGRE_PATH)\OgreMain\Lib\Debug&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\debug&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;" 
     39                                AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\Dependencies\Lib\$(ConfigurationName)&quot;;&quot;$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\OgreMain\Lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;" 
    4040                                GenerateDebugInformation="TRUE" 
    4141                                ProgramDatabaseFile="$(OutDir)/TestCullingTerrain.pdb" 
     
    6666                <Configuration 
    6767                        Name="Release|Win32" 
    68                         OutputDirectory="Release" 
    69                         IntermediateDirectory="Release" 
     68                        OutputDirectory=".\bin\$(ConfigurationName)" 
     69                        IntermediateDirectory=".\obj\$(ConfigurationName)" 
    7070                        ConfigurationType="1" 
    7171                        CharacterSet="2"> 
    7272                        <Tool 
    7373                                Name="VCCLCompilerTool" 
    74                                 AdditionalIncludeDirectories="..\..\..\Samples\Common\Include, ..\..\..\OgreMain\include" 
    75                                 PreprocessorDefinitions="_WINDOWS,_STLP_USE_DYNAMIC_LIB,OGRE_LIBRARY_IMPORTS,_RELEASE,WIN32,_STLP_RELEASE" 
     74                                AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\Dependencies\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include&quot;;&quot;$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;../../GtpVisibility/include;../include" 
     75                                PreprocessorDefinitions="_WINDOWS;_STLP_USE_DYNAMIC_LIB;OGRE_LIBRARY_IMPORTS;_RELEASE;WIN32;_STLP_RELEASE;GTP_VISIBILITY_MODIFIED_OGRE" 
    7676                                RuntimeLibrary="2" 
    7777                                UsePrecompiledHeader="0" 
     
    8383                        <Tool 
    8484                                Name="VCLinkerTool" 
    85                                 AdditionalDependencies="OGREMain.LIB" 
    86                                 OutputFile="..\..\..\Samples\Common\Bin\Release\TestCullingTerrain.exe" 
     85                                AdditionalDependencies="OGREMain.LIB Plugin_OctreeSceneManager.lib CEGUIBase.lib OgreGUIRenderer.lib" 
     86                                OutputFile="$(OGRE_PATH)/Samples/Common/bin/Release/TestCullingTerrain.exe" 
    8787                                LinkIncremental="1" 
    88                                 AdditionalLibraryDirectories="..\..\..\OgreMain\Lib\Release" 
     88                                AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\Dependencies\Lib\$(ConfigurationName)&quot;;&quot;$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\OgreMain\Lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;" 
    8989                                GenerateDebugInformation="TRUE" 
    9090                                SubSystem="2" 
  • trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp

    r61 r74  
    33        TestCullingTerrainApplication.cpp 
    44    \brief 
    5         Tests the occlusion culling algorithm 
     5        Tests the visibility culling algorithm 
    66*/ 
    77 
     
    4444} 
    4545//----------------------------------------------------------------------- 
    46 void TestCullingTerrainApplication::generateSceneObject(const Vector3 &translationRatio,  
    47                                          const Vector3 &rotationRatio, const int idx, const String& entName) 
    48 { 
    49         // Setup the ray scene query 
    50         /*Vector3 rotation = mMinAngle + rotationRatio * (mMaxAngle - mMinAngle); 
    51         Vector3 translation = mMinTranslation + translationRatio * (mMaxTranslation - mMinTranslation); 
    52  
    53         translation.y = 5000; 
    54     Ray ray(translation, Vector3::NEGATIVE_UNIT_Y); 
    55     mRaySceneQuery->setRay(ray); 
    56  
    57     // Execute query 
    58         RaySceneQueryResult &result = mRaySceneQuery->execute(); 
    59         RaySceneQueryResult::iterator itr = result.begin( ); 
    60  
    61         // Get results, create a node/entity on the position 
    62         if ( itr != result.end() && itr->worldFragment ) 
    63         { 
    64                 char name[16]; 
    65                 sprintf( name, "%s%d", entName.c_str(), mCount++ ); 
    66  
    67                 Entity *ent = mSceneMgr->createEntity( name, entName ); 
    68                 SceneNode currentObject = mSceneMgr->getRootSceneNode( )->createChildSceneNode( String(name) + "Node", itr->worldFragment->singleIntersection ); 
    69                 currentObject->attachObject( ent ); 
    70                 currentObject->setScale( 0.1f, 0.1f, 0.1f ); 
    71         }*/ 
    72 } 
    73  
    74 //----------------------------------------------------------------------- 
    7546void TestCullingTerrainApplication::createScene( void ) 
    7647{ 
    7748        mRayQueryExecutor = new RayQueryExecutor(mSceneMgr); 
    7849        mTerrainContentGenerator = new TerrainContentGenerator(mSceneMgr, mRayQueryExecutor); 
     50 
    7951        // Set ambient light 
    8052        mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5)); 
     
    11183        terrain_cfg = mResourcePath + terrain_cfg; 
    11284#endif 
    113         mSceneMgr -> setWorldGeometry( terrain_cfg ); 
     85        mSceneMgr->setWorldGeometry(terrain_cfg); 
    11486        // Infinite far plane? 
    11587        if (mRoot->getRenderSystem()->getCapabilities()->hasCapability(RSC_INFINITE_FAR_PLANE)) 
     
    12496        // CEGUI setup 
    12597        setupGui(); 
     98 
     99        mTerrainContentGenerator->generateScene(100); 
    126100} 
    127101//----------------------------------------------------------------------- 
     
    149123void TestCullingTerrainApplication::chooseSceneManager(void) 
    150124{ 
    151     //mSceneMgr = mRoot->getSceneManager(ST_GENERIC); 
    152125        mSceneMgr = mRoot->getSceneManager(ST_EXTERIOR_CLOSE); 
    153126} 
     
    171144        mRotateSpeed *= 2; 
    172145 
    173         mCurrentAlgorithm = 0;//VisibilitySceneTraverser::RENDER_COHERENT; 
     146        mCurrentAlgorithm = GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING, 
    174147        mThreshold = 0; 
    175148     
     
    179152        mEventProcessor->addKeyListener(this); 
    180153 
    181         mRaySceneQuery = mSceneMgr->createRayQuery(Ray()); 
     154        mRayQueryExecutor = new RayQueryExecutor(mSceneMgr); 
    182155 
    183156        // show overlay 
    184157        Overlay* pOver = OverlayManager::getSingleton().getByName("Example/VisibilityDemoOverlay");  
    185158 
    186         mAlgorithmInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/AlgorithmInfo"); 
    187         mThresholdInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/ThresholdInfo"); 
    188         mFrustumCulledNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/FrustumCulledNodesInfo"); 
    189         mQueryCulledNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/QueryCulledNodesInfo"); 
    190     mTraversedNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/TraversedNodesInfo"); 
    191         mSceneNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/SceneNodesInfo"); 
    192         mHierarchyNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/HierarchyNodesInfo"); 
    193         mRenderedNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/RenderedNodesInfo"); 
     159        mAlgorithmInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/AlgorithmInfo"); 
     160        mThresholdInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/ThresholdInfo"); 
     161        mFrustumCulledNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/FrustumCulledNodesInfo"); 
     162        mQueryCulledNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/QueryCulledNodesInfo"); 
     163    mTraversedNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/TraversedNodesInfo"); 
     164        mHierarchyNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/HierarchyNodesInfo"); 
     165        mRenderedNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/RenderedNodesInfo"); 
    194166 
    195167        mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]); 
     
    198170        mQueryCulledNodesInfo->setCaption(": 0"); 
    199171        mTraversedNodesInfo->setCaption(": 0"); 
    200         mSceneNodesInfo->setCaption(": 0"); 
    201172        mHierarchyNodesInfo->setCaption(": 0"); 
    202173        mRenderedNodesInfo->setCaption(": 0"); 
     
    207178MouseQueryListener::~MouseQueryListener( ) 
    208179{ 
    209         delete mRaySceneQuery; 
     180        delete mRayQueryExecutor; 
    210181} 
    211182//----------------------------------------------------------------------- 
     
    225196                 // Setup the ray scene query 
    226197         Ray mouseRay = mCamera->getCameraToViewportRay( e->getX(), e->getY() ); 
    227          mRaySceneQuery->setRay( mouseRay ); 
    228  
    229          // Execute query 
    230          RaySceneQueryResult &result = mRaySceneQuery->execute(); 
    231          RaySceneQueryResult::iterator itr = result.begin( ); 
    232  
     198    
     199                 Vector3 queryResult; 
    233200         // Get results, create a node/entity on the position 
    234          if ( itr != result.end() && itr->worldFragment ) 
     201                 if(mRayQueryExecutor->executeRayQuery(&queryResult, mouseRay)) 
    235202         { 
    236203                         char name[16]; 
    237204             sprintf( name, "Robot%d", mCount++ ); 
    238205 
    239              Entity *ent = mSceneMgr->createEntity( name, "robot.mesh" ); 
    240              mCurrentObject = mSceneMgr->getRootSceneNode( )->createChildSceneNode( String(name) + "Node", itr->worldFragment->singleIntersection ); 
     206             Entity *ent = mSceneMgr->createEntity(name, "robot.mesh"); 
     207             mCurrentObject = mSceneMgr->getRootSceneNode()-> 
     208                                 createChildSceneNode( String(name) + "Node", queryResult); 
    241209             mCurrentObject->attachObject( ent ); 
    242210             mCurrentObject->setScale( 0.1f, 0.1f, 0.1f ); 
     
    275243         if ( mLMouseDown ) 
    276244     { 
    277                  Ray mouseRay = mCamera->getCameraToViewportRay( e->getX(), e->getY() ); 
    278                  mRaySceneQuery->setRay( mouseRay ); 
    279  
    280                  RaySceneQueryResult &result = mRaySceneQuery->execute(); 
    281                  RaySceneQueryResult::iterator itr = result.begin( ); 
    282  
    283                  if ( itr != result.end() && itr->worldFragment ) 
     245                 Vector3 queryResult; 
     246                 Ray mouseRay = mCamera->getCameraToViewportRay(e->getX(), e->getY()); 
     247 
     248                 if(mRayQueryExecutor->executeRayQuery(&queryResult, mouseRay)) 
    284249                 { 
    285                          mCurrentObject->setPosition( itr->worldFragment->singleIntersection ); 
    286                  }  
     250                         mCurrentObject->setPosition(queryResult); 
     251                 } 
    287252     } 
    288253         // If we are dragging the right mouse button. 
     
    297262{ 
    298263        // clamp to terrain 
    299         Vector3 camPos = mCamera->getPosition( ); 
    300     Ray cameraRay( Vector3(camPos.x, 5000.0f, camPos.z), Vector3::NEGATIVE_UNIT_Y ); 
    301     mRaySceneQuery->setRay( cameraRay ); 
    302  
    303     // Perform the scene query 
    304     RaySceneQueryResult &queryResult = mRaySceneQuery->execute(); 
    305     RaySceneQueryResult::iterator it = queryResult.begin( ); 
    306  
    307         if (it != queryResult.end() && it->worldFragment) 
     264        Vector3 camPos = mCamera->getPosition(); 
     265        Vector3 queryResult; 
     266 
     267    if(mRayQueryExecutor->executeRayQuery(&queryResult,  
     268                Vector3(camPos.x, 5000.0f, camPos.z), Vector3::NEGATIVE_UNIT_Y)) 
    308269        { 
    309                 SceneQuery::WorldFragment* wf = it->worldFragment; 
    310  
    311                 mCamera->setPosition(mCamera->getPosition().x, wf->singleIntersection.y + 10,  
     270                mCamera->setPosition(mCamera->getPosition().x, queryResult.y + 10,  
    312271                        mCamera->getPosition().z); 
    313272        } 
     
    347306void MouseQueryListener::changeAlgorithm() 
    348307{ 
    349     //mCurrentAlgorithm = ++mCurrentAlgorithm % VisibilitySceneTraverser::NUM_RENDERMODES; 
     308        mCurrentAlgorithm = ++mCurrentAlgorithm %  
     309                GtpVisibility::VisibilityEnvironment::NUM_CULLING_MANAGERS, 
    350310 
    351311        mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]); 
     
    367327        mTraversedNodesInfo->setCaption(str); 
    368328 
    369         mSceneMgr->getOption("NumSceneNodes", &opt); sprintf(str,": %d", opt);  
    370         mSceneNodesInfo->setCaption(str); 
    371  
    372         mSceneMgr->getOption("NumOctreeNodes", &opt); sprintf(str,": %d", opt);  
     329        mSceneMgr->getOption("NumHierarchyNodes", &opt); sprintf(str,": %d", opt);  
    373330        mHierarchyNodesInfo->setCaption(str); 
    374331 
  • trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.h

    r61 r74  
    66#include "ExampleApplication.h" 
    77#include "TerrainContentGenerator.h" 
     8#include "VisibilityEnvironment.h" 
    89 
    910Real timeDelay = 0; 
     
    1718} 
    1819 
    19 String mCurrentAlgorithmCaptions[3/*VisibilitySceneTraverser::NUM_RENDERMODES*/] =  
     20String mCurrentAlgorithmCaptions[GtpVisibility::VisibilityEnvironment::NUM_CULLING_MANAGERS] =  
    2021{ 
    21     "Cull Frustum",  
    22         "Stop and Wait",  
    23         "Coherent Occlusion Culling" 
     22    "View Frustum Culling",  
     23        "Stop and Wait Culling",  
     24        "Coherent Hierarchical Culling" 
    2425}; 
    2526 
     
    8384 
    8485        SceneNode *mCurrentObject;         // The newly created object 
    85         RaySceneQuery *mRaySceneQuery;     // The ray scene query pointer 
    8686        int mCount;                        // The number of robots on the screen 
    8787 
     
    101101        virtual void createCamera(void); 
    102102 
    103         /**  
    104                 generates a new scene object  
    105                 @param tranlationRatio ratio between minimal and maximal possible translation 
    106                 @param rotationRatio ratio between minimal and maximal possible rotation 
    107                 @idx the index of the new object 
    108                 @entName the name of the object entity 
    109         */ 
    110         void generateSceneObject(const Vector3 &translationRatio, const Vector3 &rotationRatio,  
    111                                                          const int idx, const String &entName); 
    112  
    113103        CEGUI::OgreCEGUIRenderer *mGUIRenderer; 
    114104        CEGUI::System *mGUISystem; 
  • trunk/VUT/work/ogre_changes/OgreMain/include/OgreSceneManager.h

    r61 r74  
    130130                */ 
    131131                void _renderSceneNode( Camera *cam, SceneNode *node ); 
    132                  
    133132                /** deletes all queues which we were currently processing 
    134133                        @remark clears renderqueue after rendering scene node 
    135134                */ 
    136135                void _deleteRenderedQueueGroups(); 
    137          
    138                  
    139                 void myrenderSingleObject(Renderable* rend, Pass* pass, bool doLightIteration,  
    140             const LightList* manualLightList = 0) 
    141                 { 
    142                         setPass(pass); 
    143                         renderSingleObject(rend, pass, doLightIteration, manualLightList);} 
    144  
     136                /** Internal method used by _renderVisibleObjects to deal with renderables 
     137            which override the camera's own view / projection materices.  
     138                        @remark made public by matt  
     139                */ 
     140        void useRenderableViewProjMode(Renderable* pRend); 
     141                /** Method for setting up the renderstate for a rendering pass. 
     142            @param 
     143                pass The Pass details to set. 
     144            @returns 
     145                A Pass object that was used instead of the one passed in, can 
     146                happen when rendering shadow passes 
     147                        @remark made public by matt 
     148        */ 
     149        virtual Pass* setPass(Pass* pass); 
    145150#endif // GTP_VISIBILITY_MODIFIED_OGRE 
    146                 /** Internal method used by _renderVisibleObjects to deal with renderables 
    147             which override the camera's own view / projection materices. made 
    148                         public by matt */ 
    149         void useRenderableViewProjMode(Renderable* pRend); 
    150                  
     151 
    151152    protected: 
    152153 
     
    250251        /** Retrieves the internal render queue. */ 
    251252        virtual RenderQueue* getRenderQueue(void); 
     253#ifndef GTP_VISIBILITY_MODIFIED_OGRE // made public, is found in the modfified section 
    252254        /** Internal method for setting up the renderstate for a rendering pass. 
    253255            @param 
     
    258260        */ 
    259261        virtual Pass* setPass(Pass* pass); 
     262#endif 
    260263        /// A pass designed to let us render shadow colour on white for texture shadows 
    261264        Pass* mShadowCasterPlainBlackPass; 
     
    332335        AnimationList mAnimationsList; 
    333336        AnimationStateSet mAnimationStates; 
    334  
     337#ifndef GTP_VISIBILITY_MODIFIED_OGRE // made public, is found in the modfified section 
     338        /** Internal method used by _renderVisibleObjects to deal with renderables 
     339            which override the camera's own view / projection materices. */ 
     340        void useRenderableViewProjMode(Renderable* pRend); 
     341#endif 
    335342        /// Controller flag for determining if we need to set view/proj matrices 
    336343        bool mCamChanged; 
Note: See TracChangeset for help on using the changeset viewer.