Changeset 1834 for GTP/trunk/App/Demos/Illum/Ogre/src/DiffuseTest
- Timestamp:
- 11/30/06 17:13:59 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/src/DiffuseTest/include/DiffuseTest.h
r1691 r1834 49 49 bool processUnbufferedKeyInput(const FrameEvent& evt) 50 50 { 51 static float lastTime = 0.0; 52 float thisTime = (float) Root::getSingleton().getTimer()->getMilliseconds() / 1000.0f; 53 float elapsed = thisTime - lastTime; 54 float move = elapsed * 0.25; 55 float rotate = 80.0 * move; 56 51 57 if (mInputDevice->isKeyDown(KC_UP)) 52 58 { 53 objectNode->translate(0,0, 0.1);59 objectNode->translate(0,0,move); 54 60 } 55 61 if (mInputDevice->isKeyDown(KC_MULTIPLY)) 56 62 { 57 63 //objectNode->scale(1.1,1.1,1.1); 58 objectNode->rotate(Vector3(0,0,1), Degree( 10));64 objectNode->rotate(Vector3(0,0,1), Degree(rotate)); 59 65 mTimeUntilNextToggle = 1; 60 66 } … … 62 68 { 63 69 //objectNode->scale(1.0/1.1,1.0/1.1,1.0/1.1); 64 objectNode->rotate(Vector3(1,0,0), Degree( 10));70 objectNode->rotate(Vector3(1,0,0), Degree(rotate)); 65 71 mTimeUntilNextToggle = 1; 66 72 } 67 73 if (mInputDevice->isKeyDown(KC_ADD)) 68 74 { 69 objectNode->rotate(Vector3(0,1,0), Degree( 10));75 objectNode->rotate(Vector3(0,1,0), Degree(rotate)); 70 76 } 71 77 if (mInputDevice->isKeyDown(KC_HOME)) 72 78 { 73 objectNode->translate(0, 0.1,0);79 objectNode->translate(0,move,0); 74 80 } 75 81 if (mInputDevice->isKeyDown(KC_END)) 76 82 { 77 objectNode->translate(0,- 0.1,0);83 objectNode->translate(0,-move,0); 78 84 } 79 85 if (mInputDevice->isKeyDown(KC_DOWN)) 80 86 { 81 objectNode->translate(0,0,- 0.1);87 objectNode->translate(0,0,-move); 82 88 } 83 89 if (mInputDevice->isKeyDown(KC_RIGHT)) 84 90 { 85 objectNode->translate( 0.5,0,0);91 objectNode->translate(move,0,0); 86 92 } 87 93 if (mInputDevice->isKeyDown(KC_LEFT)) 88 94 { 89 objectNode->translate(- 0.5,0,0);95 objectNode->translate(-move,0,0); 90 96 } 91 97 … … 214 220 } 215 221 222 223 lastTime = thisTime; 216 224 // Return true to continue rendering 217 225 return true;
Note: See TracChangeset
for help on using the changeset viewer.