Changeset 1849 for GTP/trunk/App/Demos
- Timestamp:
- 12/05/06 10:52:28 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/src/ReflectionTest/include/ReflectionTest.h
r1847 r1849 45 45 46 46 { 47 this->mMoveSpeed = 0. 5;47 this->mMoveSpeed = 0.1; 48 48 framecount = 0; 49 49 this->objectNode = objectNode; … … 65 65 bool processUnbufferedKeyInput(const FrameEvent& evt) 66 66 { 67 static float objmove = 0.01; 67 static float lastTime = 0.0; 68 float thisTime = (float) Root::getSingleton().getTimer()->getMilliseconds() / 1000.0f; 69 float elapsed = thisTime - lastTime; 70 float move = elapsed * 0.25; 71 float rotate = 80.0 * move; 72 68 73 if (mInputDevice->isKeyDown(KC_UP)) 69 74 { 70 objectNode->translate(0,0, objmove);75 objectNode->translate(0,0,move); 71 76 } 72 77 if (mInputDevice->isKeyDown(KC_MULTIPLY)) 73 78 { 74 79 //objectNode->scale(1.1,1.1,1.1); 75 objectNode->rotate(Vector3(0,0,1), Degree( 10));80 objectNode->rotate(Vector3(0,0,1), Degree(rotate)); 76 81 mTimeUntilNextToggle = 1; 77 82 } … … 79 84 { 80 85 //objectNode->scale(1.0/1.1,1.0/1.1,1.0/1.1); 81 objectNode->rotate(Vector3(1,0,0), Degree( 10));86 objectNode->rotate(Vector3(1,0,0), Degree(rotate)); 82 87 mTimeUntilNextToggle = 1; 83 88 } 84 89 if (mInputDevice->isKeyDown(KC_ADD)) 85 90 { 86 objectNode->rotate(Vector3(0,1,0), Degree( 10));91 objectNode->rotate(Vector3(0,1,0), Degree(rotate)); 87 92 } 88 93 if (mInputDevice->isKeyDown(KC_HOME)) 89 94 { 90 objectNode->translate(0, objmove,0);95 objectNode->translate(0,move,0); 91 96 } 92 97 if (mInputDevice->isKeyDown(KC_END)) 93 98 { 94 objectNode->translate(0,- objmove,0);99 objectNode->translate(0,-move,0); 95 100 } 96 101 if (mInputDevice->isKeyDown(KC_DOWN)) 97 102 { 98 objectNode->translate(0,0,- objmove);103 objectNode->translate(0,0,-move); 99 104 } 100 105 if (mInputDevice->isKeyDown(KC_RIGHT)) 101 106 { 102 objectNode->translate(- objmove,0,0);107 objectNode->translate(-move,0,0); 103 108 } 104 109 if (mInputDevice->isKeyDown(KC_LEFT)) 105 110 { 106 objectNode->translate( objmove,0,0);111 objectNode->translate(move,0,0); 107 112 } 108 113 … … 208 213 "O: " + StringConverter::toString(mCamera->getDerivedOrientation())); 209 214 } 210 215 lastTime = thisTime; 211 216 // Return true to continue rendering 212 217 return true; … … 291 296 292 297 capture->addAnimableNode(mCamera->getParentSceneNode()); 298 capture->addAnimableNode(objectNode); 293 299 294 300 Entity* room = mSceneMgr->createEntity("scene", "difflab.mesh");
Note: See TracChangeset
for help on using the changeset viewer.