- Timestamp:
- 05/19/05 17:30:36 (20 years ago)
- Location:
- trunk/VUT
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/Ogre/src/OgreVisibilitySceneManagerDll.cpp
r100 r104 39 39 namespace Ogre { 40 40 41 // VisibilityDotSceneManager * occlusionDotPlugin;41 // VisibilityDotSceneManager *cullingDotPlugin; 42 42 VisibilityOctreeSceneManager *cullingOctreePlugin; 43 43 VisibilityTerrainSceneManager *cullingTerrainPlugin; -
trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
r103 r104 93 93 { 94 94 TerrainSceneManager::_renderVisibleObjects(); 95 95 96 return; 96 97 } -
trunk/VUT/work/TestCulling/SceneContentGenerator.cpp
r94 r104 73 73 currentObject->roll(Degree(rotation.z)); 74 74 75 /*76 char msg[100];77 sprintf(msg, "pos: %3.3f %3.3f %3.3f\n", position.x, position.y, position.z);78 OutputDebugString(msg);79 */80 81 75 return currentObject; 82 76 } -
trunk/VUT/work/TestCullingTerrain/TerrainContentGenerator.cpp
r97 r104 82 82 } 83 83 //----------------------------------------------------------------------- 84 RayQueryExecutor *TerrainContentGenerator::GetRayQueryExecutor() 85 { 86 return mRayQueryExecutor; 87 } 88 //----------------------------------------------------------------------- 84 89 void TerrainContentGenerator::SetMaxHeight(Real maxHeight) 85 90 { -
trunk/VUT/work/TestCullingTerrain/TerrainContentGenerator.h
r85 r104 35 35 void SetMaxHeight(Real maxHeight); 36 36 37 RayQueryExecutor *GetRayQueryExecutor(); 38 37 39 protected: 38 40 RayQueryExecutor *mRayQueryExecutor; -
trunk/VUT/work/TestCullingTerrain/TestCullingTerrain.vcproj
r100 r104 122 122 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> 123 123 <File 124 RelativePath=".\IoManager.cpp"> 125 </File> 126 <File 124 127 RelativePath="..\TestCulling\SceneContentGenerator.cpp"> 125 128 </File> … … 136 139 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> 137 140 <File 141 RelativePath=".\IoManager.h"> 142 </File> 143 <File 138 144 RelativePath="..\TestCulling\SceneContentGenerator.h"> 139 145 </File> -
trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp
r103 r104 68 68 else 69 69 { 70 mVizCamera->setFarClipDistance( 1000);71 mCamera->setFarClipDistance( 1000);70 mVizCamera->setFarClipDistance(20000); 71 mCamera->setFarClipDistance(20000); 72 72 } 73 73 } … … 191 191 mVizCameraHeight(Real(2500.0)), 192 192 mCamNode(camNode), 193 mCullCamera(false) 193 mCullCamera(false), 194 mDirection(Vector3::ZERO), 195 mDistance(0) 194 196 { 195 197 // Reduce move speed … … 238 240 mSceneMgr->setOption("ShowVisualization", &mShowVisualization); 239 241 mSceneMgr->setOption("RenderNodesForViz", &mRenderNodesForViz); 242 243 // Create the walking list 244 Vector3 queryResult; 245 246 mWalkList.push_back(Vector3(1550.0f, 5000.0f, 250.0f)); 247 mWalkList.push_back(Vector3(100.0f, 5000.0f, 750.0f)); 248 249 mTerrainContentGenerator->GenerateSceneObject(mCamera->getPosition(), Vector3::ZERO, "knot.mesh"); 250 mTerrainContentGenerator->GenerateSceneObject(Vector3(1550.0f, 5000.0f, 250.0f), Vector3::ZERO, "knot.mesh"); 251 mTerrainContentGenerator->GenerateSceneObject(Vector3(100.0f, 5000.0f, 750.0f), Vector3::ZERO, "knot.mesh"); 240 252 241 253 pOver->show(); … … 322 334 } 323 335 //----------------------------------------------------------------------- 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 //----------------------------------------------------------------------- 324 365 bool MouseQueryListener::frameStarted(const FrameEvent &evt) 325 366 { 326 clamp2Terrain(); 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(); 327 386 328 387 if (mShowVisualization) … … 346 405 mVizCamera->yaw(Math::ATan2(-mCamera->getDerivedDirection().x, 347 406 -mCamera->getDerivedDirection().z)); 407 408 mVizCamera->moveRelative(Vector3(0, 800, 0)); 348 409 } 349 410 … … 351 412 } 352 413 //----------------------------------------------------------------------- 353 void MouseQueryListener:: clamp2Terrain()414 void MouseQueryListener::Clamp2Terrain() 354 415 { 355 416 // clamp to terrain … … 379 440 KEY_PRESSED(KC_1, 0.3, toggleShowViz()); 380 441 KEY_PRESSED(KC_2, 0.3, toggleRenderNodesForViz()); 381 382 if (!mShowVisualization) 383 { 384 KEY_PRESSED(KC_SUBTRACT, 0, changeThreshold(-10)); 385 KEY_PRESSED(KC_ADD, 0, changeThreshold(10)); 386 } 387 else 388 { 389 KEY_PRESSED(KC_SUBTRACT, 0, zoomVizCamera(50)); 390 KEY_PRESSED(KC_ADD, 0, zoomVizCamera(-50)); 391 } 392 442 KEY_PRESSED(KC_SUBTRACT, 0, changeThreshold(-10)); 443 KEY_PRESSED(KC_ADD, 0, changeThreshold(10)); 444 KEY_PRESSED(KC_3, 0, zoomVizCamera(50)); 445 KEY_PRESSED(KC_4, 0, zoomVizCamera(-50)); 446 393 447 updateStats(); 394 448 … … 521 575 //vizvp->setClearEveryFrame(false); 522 576 523 // Create a skyplane (for visualization) 524 /*Plane plane; 525 plane.d = 1000; 577 // Create a skyplane (for visualization background) 578 /* 579 Plane plane; 580 plane.d = -1000; 526 581 plane.normal = Vector3::UNIT_Y; 527 mSceneMgr->setSkyPlane( true, plane, "Examples/Rockwall", 4000, 75, false);582 mSceneMgr->setSkyPlane(true, plane, "Examples/TransparentTest", 4000, 75, false); 528 583 */ 584 529 585 } 530 586 else -
trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.h
r103 r104 88 88 void moveCamera(); 89 89 90 90 91 protected: 91 void clamp2Terrain(); 92 void Clamp2Terrain(); 93 94 bool NextLocation(); 92 95 93 96 bool mLMouseDown, mRMouseDown; // True if the mouse buttons are down … … 128 131 Camera *mVizCamera; 129 132 SceneNode *mCamNode; 133 Real mWalkSpeed; 134 Real mDistance; 135 Vector3 mDestination; 136 Vector3 mDirection; 130 137 138 std::deque<Vector3> mWalkList; // The list of points we are walking to 131 139 }; 132 140 -
trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreOctree.h
r61 r104 156 156 Octree * mParent; 157 157 158 #ifdef OGRE_COHERENT_OCCLUSION_CULLING158 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 159 159 public: 160 160 /** Returns last visited frame id. */ … … 194 194 int mDepth; 195 195 196 #endif // OGRE_COHERENT_OCCLUSION_CULLING196 #endif // GTP_VISIBILITY_MODIFIED_OGRE 197 197 }; 198 198
Note: See TracChangeset
for help on using the changeset viewer.