- Timestamp:
- 05/20/05 10:20:05 (20 years ago)
- Location:
- trunk/VUT
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/work/TestCullingTerrain/IoManager.cpp
r104 r105 25 25 } 26 26 27 void IoManager::AddNode( SceneNode *node)27 void IoManager::AddNode(Ogre::SceneNode *node) 28 28 { 29 29 mPositions.push_back(node->getPosition()); -
trunk/VUT/work/TestCullingTerrain/IoManager.h
r104 r105 5 5 #include <OgreMath.h> 6 6 #include <Ogre.h> 7 #include <OgreSceneNode.h> 7 8 8 9 class IoManager … … 12 13 13 14 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; 15 19 16 20 protected: 17 21 std::ofstream mFile; 18 std::vector<Ogre::Vector3> mPositions;19 std::vector<Ogre::Quaternion> mOrientations;20 22 }; 21 23 -
trunk/VUT/work/TestCullingTerrain/TestCullingTerrain.vcproj
r104 r105 122 122 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> 123 123 <File 124 RelativePath=".\IoManager.cpp">125 </File>126 <File127 124 RelativePath="..\TestCulling\SceneContentGenerator.cpp"> 128 125 </File> … … 139 136 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> 140 137 <File 141 RelativePath=".\IoManager.h">142 </File>143 <File144 138 RelativePath="..\TestCulling\SceneContentGenerator.h"> 145 139 </File> -
trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp
r104 r105 242 242 243 243 // Create the walking list 244 Vector3 queryResult; 245 244 /*Vector3 queryResult; 246 245 mWalkList.push_back(Vector3(1550.0f, 5000.0f, 250.0f)); 247 246 mWalkList.push_back(Vector3(100.0f, 5000.0f, 750.0f)); … … 250 249 mTerrainContentGenerator->GenerateSceneObject(Vector3(1550.0f, 5000.0f, 250.0f), Vector3::ZERO, "knot.mesh"); 251 250 mTerrainContentGenerator->GenerateSceneObject(Vector3(100.0f, 5000.0f, 750.0f), Vector3::ZERO, "knot.mesh"); 252 251 */ 253 252 pOver->show(); 254 253 } … … 334 333 } 335 334 //----------------------------------------------------------------------- 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 deque344 mWalkList.pop_front(); // this removes the front of the deque345 346 mDirection = mDestination - mCamNode->getPosition();347 mDistance = mDirection.normalise();348 349 // change facing350 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 else357 {358 Ogre::Quaternion quat = src.getRotationTo(mDirection);359 mCamNode->rotate(quat);360 }361 362 return true;363 }364 //-----------------------------------------------------------------------365 335 bool MouseQueryListener::frameStarted(const FrameEvent &evt) 366 336 { 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 386 355 387 356 if (mShowVisualization) -
trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.h
r104 r105 8 8 #include "VisibilityEnvironment.h" 9 9 #include <OgreRenderTargetListener.h> 10 10 #include <vector.h> 11 11 12 12 Real timeDelay = 0; … … 26 26 "Coherent Hierarchical Culling" 27 27 }; 28 typedef struct frame_info 29 { 28 30 31 } 32 Position 33 typedef std::pair<Vector3 frame_pair 29 34 class VisualizationRenderTargetListener: public RenderTargetListener 30 35 { … … 136 141 Vector3 mDirection; 137 142 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 139 148 }; 140 149
Note: See TracChangeset
for help on using the changeset viewer.