- Timestamp:
- 05/20/05 10:20:05 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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)
Note: See TracChangeset
for help on using the changeset viewer.