Changeset 105 for trunk


Ignore:
Timestamp:
05/20/05 10:20:05 (19 years ago)
Author:
mattausch
Message:
 
Location:
trunk/VUT
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/work/TestCullingTerrain/IoManager.cpp

    r104 r105  
    2525} 
    2626 
    27 void IoManager::AddNode(SceneNode *node) 
     27void IoManager::AddNode(Ogre::SceneNode *node) 
    2828{ 
    2929        mPositions.push_back(node->getPosition()); 
  • trunk/VUT/work/TestCullingTerrain/IoManager.h

    r104 r105  
    55#include <OgreMath.h> 
    66#include <Ogre.h> 
     7#include <OgreSceneNode.h> 
    78 
    89class IoManager 
     
    1213 
    1314        void Write(); 
    14         AddNode(SceneNode *node); 
     15        void AddNode(Ogre::SceneNode *node); 
     16 
     17        std::vector<Ogre::Vector3> mPositions; 
     18        std::vector<Ogre::Quaternion> mOrientations; 
    1519 
    1620protected: 
    1721        std::ofstream mFile; 
    18         std::vector<Ogre::Vector3> mPositions; 
    19         std::vector<Ogre::Quaternion> mOrientations; 
    2022}; 
    2123 
  • trunk/VUT/work/TestCullingTerrain/TestCullingTerrain.vcproj

    r104 r105  
    122122                        UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> 
    123123                        <File 
    124                                 RelativePath=".\IoManager.cpp"> 
    125                         </File> 
    126                         <File 
    127124                                RelativePath="..\TestCulling\SceneContentGenerator.cpp"> 
    128125                        </File> 
     
    139136                        UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> 
    140137                        <File 
    141                                 RelativePath=".\IoManager.h"> 
    142                         </File> 
    143                         <File 
    144138                                RelativePath="..\TestCulling\SceneContentGenerator.h"> 
    145139                        </File> 
  • trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp

    r104 r105  
    242242 
    243243        // Create the walking list 
    244         Vector3 queryResult; 
    245  
     244        /*Vector3 queryResult; 
    246245        mWalkList.push_back(Vector3(1550.0f, 5000.0f, 250.0f)); 
    247246        mWalkList.push_back(Vector3(100.0f, 5000.0f, 750.0f)); 
     
    250249        mTerrainContentGenerator->GenerateSceneObject(Vector3(1550.0f, 5000.0f, 250.0f), Vector3::ZERO, "knot.mesh"); 
    251250        mTerrainContentGenerator->GenerateSceneObject(Vector3(100.0f, 5000.0f, 750.0f), Vector3::ZERO, "knot.mesh"); 
    252  
     251*/ 
    253252        pOver->show(); 
    254253}  
     
    334333} 
    335334//----------------------------------------------------------------------- 
    336 bool MouseQueryListener::NextLocation() 
    337 { 
    338         if (mWalkList.empty()) 
    339         { 
    340                 return false; 
    341         } 
    342  
    343         mDestination = mWalkList.front();  // this gets the front of the deque 
    344         mWalkList.pop_front();             // this removes the front of the deque 
    345   
    346         mDirection = mDestination - mCamNode->getPosition(); 
    347         mDistance = mDirection.normalise(); 
    348   
    349         // change facing 
    350         Vector3 src = mCamNode->getOrientation() * Vector3::UNIT_X; 
    351  
    352         if ((1.0f + src.dotProduct(mDirection)) < 0.0001f) 
    353         { 
    354                 mCamNode->yaw(Degree(180)); 
    355         } 
    356         else 
    357         { 
    358                 Ogre::Quaternion quat = src.getRotationTo(mDirection); 
    359                 mCamNode->rotate(quat); 
    360         } 
    361  
    362         return true; 
    363 } 
    364 //----------------------------------------------------------------------- 
    365335bool MouseQueryListener::frameStarted(const FrameEvent &evt) 
    366336{ 
    367         if (mDirection != Vector3::ZERO) 
    368         { 
    369                 Real move = mWalkSpeed * evt.timeSinceLastFrame; 
    370                 mDistance -= move; 
    371   
    372                 // If we are very close, just jump to the point 
    373                 if (mDistance <= 0.0f) 
    374                 { 
    375                         mCamNode->setPosition(mDestination); 
    376                         mDirection = Vector3::ZERO; 
    377                 }  
    378                 // Otherwise, move some some 
    379                 else 
    380                 { 
    381                         mCamNode->translate(mDirection * move); 
    382                 } 
    383         }  
    384  
    385         Clamp2Terrain(); 
     337        switch (mState) 
     338        { 
     339        case STATE_RECORD: 
     340                Clamp2Terrain(); 
     341        case STATE_REPLAY: 
     342                 
     343                mCamera->setPosition(mPosition[mCurrentFrame]); 
     344                mCamera->setOrientation( 
     345        case STATE_: 
     346         
     347 
     348        // save for walkthrough 
     349        if(mState == STATE_RECORD) 
     350        { 
     351                mPositions.push_back(mCamera->GetPosition()); 
     352                mOrientations.push_back(mCamera->GetOrientation()); 
     353        } 
     354         
    386355 
    387356        if (mShowVisualization) 
  • trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.h

    r104 r105  
    88#include "VisibilityEnvironment.h" 
    99#include <OgreRenderTargetListener.h> 
    10  
     10#include <vector.h> 
    1111 
    1212Real timeDelay = 0; 
     
    2626        "Coherent Hierarchical Culling" 
    2727}; 
     28typedef struct frame_info 
     29{ 
    2830 
     31} 
     32        Position 
     33typedef std::pair<Vector3 frame_pair 
    2934class VisualizationRenderTargetListener: public RenderTargetListener 
    3035{ 
     
    136141        Vector3 mDirection; 
    137142 
    138         std::deque<Vector3> mWalkList;   // The list of points we are walking to 
     143        //std::deque<Vector3> mWalkList;   // The list of points we are walking to 
     144        vector< 
     145        std::vector<Ogre::Vector3> mPositions; 
     146        std::vector<Ogre::Quaternion> mOrientations; 
     147 
    139148}; 
    140149 
Note: See TracChangeset for help on using the changeset viewer.