public:t-gede-14-1:lab5
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| public:t-gede-14-1:lab5 [2014/02/17 07:05] – [Bonus points] marino | public:t-gede-14-1:lab5 [2024/04/29 13:33] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 167: | Line 167: | ||
| // Add these lines, dont forget to break :) | // Add these lines, dont forget to break :) | ||
| case 2: | case 2: | ||
| - | _walkMagnitude = value / 32768; // Map the range to -1 to 1 | + | _walkMagnitude = (float)value / -float(_Joystick-> |
| break; | break; | ||
| case 3: | case 3: | ||
| - | _turnMagnitude = value / 32768; // Map the range to -1 to 1 | + | _turnMagnitude = (float)value / -float(_Joystick-> |
| - | break; | + | break; |
| } | } | ||
| return true; | return true; | ||
| Line 203: | Line 203: | ||
| } | } | ||
| // Create the translation vector. | // Create the translation vector. | ||
| - | if (0 != _walkMagnitude) { | + | SinbadTranslate = _node-> |
| - | SinbadTranslate = _node-> | + | walked = true; |
| - | walked = true; | + | |
| - | } | + | |
| // Increment the roation angle. | // Increment the roation angle. | ||
| - | if (0 != _turnMagnitude) { | + | _orientation += evt.timeSinceLastFrame * _turnMagnitude*2; |
| - | _orientation += evt.timeSinceLastFrame * _turnMagnitude*2; | + | |
| - | } | + | |
| // Now finally apply the rotation and translation. | // Now finally apply the rotation and translation. | ||
| _node-> | _node-> | ||
| Line 216: | Line 214: | ||
| </ | </ | ||
| - **As of now the camera follows Sinbad in a strange manner.** By adding buffered keyboard input, create a method of toggling the camera from following Sinbad behind his back, and a free roaming camera that you cam move with the mouse and " | - **As of now the camera follows Sinbad in a strange manner.** By adding buffered keyboard input, create a method of toggling the camera from following Sinbad behind his back, and a free roaming camera that you cam move with the mouse and " | ||
| - | // This will make the camera a child of the Sinbad Scene node, and thus all translation | + | // This will make the camera a child of the Sinbad Scene node, and thus all transformation |
| _node-> | _node-> | ||
| </ | </ | ||
| Line 243: | Line 241: | ||
| //... | //... | ||
| } | } | ||
| - | </ | + | </ |
| </ | </ | ||
/var/www/cadia.ru.is/wiki/data/attic/public/t-gede-14-1/lab5.1392620753.txt.gz · Last modified: 2024/04/29 13:32 (external edit)