MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / CalculateBounce

Function CalculateBounce

TombEngine/Game/camera.cpp:242–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242void 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
275void InitializeCamera()
276{

Callers 3

CalculateSpotCamerasFunction · 0.85
MoveCameraFunction · 0.85
BinocularCameraFunction · 0.85

Calls 2

GetRandomControlFunction · 0.85
RumbleFromBounceFunction · 0.85

Tested by

no test coverage detected