| 240 | } |
| 241 | |
| 242 | void CalculateBounce(bool binocularMode) |
| 243 | { |
| 244 | if (Camera.bounce == 0) |
| 245 | return; |
| 246 | |
| 247 | if (Camera.bounce <= 0) |
| 248 | { |
| 249 | if (binocularMode) |
| 250 | { |
| 251 | Camera.target.x += (CLICK(0.25f) / 4) * (GetRandomControl() % (-Camera.bounce) - (-Camera.bounce / 2)); |
| 252 | Camera.target.y += (CLICK(0.25f) / 4) * (GetRandomControl() % (-Camera.bounce) - (-Camera.bounce / 2)); |
| 253 | Camera.target.z += (CLICK(0.25f) / 4) * (GetRandomControl() % (-Camera.bounce) - (-Camera.bounce / 2)); |
| 254 | } |
| 255 | else |
| 256 | { |
| 257 | int bounce = -Camera.bounce; |
| 258 | int bounce2 = bounce / 2; |
| 259 | Camera.target.x += GetRandomControl() % bounce - bounce2; |
| 260 | Camera.target.y += GetRandomControl() % bounce - bounce2; |
| 261 | Camera.target.z += GetRandomControl() % bounce - bounce2; |
| 262 | } |
| 263 | |
| 264 | Camera.bounce += 5; |
| 265 | RumbleFromBounce(); |
| 266 | } |
| 267 | else |
| 268 | { |
| 269 | Camera.pos.y += Camera.bounce; |
| 270 | Camera.target.y += Camera.bounce; |
| 271 | Camera.bounce = 0; |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | void InitializeCamera() |
| 276 | { |
no test coverage detected