style fixes

This commit is contained in:
UnknownShadow200 2020-04-15 23:22:23 +10:00
parent acf6f7bd18
commit 8593eeb74d
2 changed files with 5 additions and 6 deletions

View File

@ -63,14 +63,13 @@ static Vec2 PerspectiveCamera_GetMouseDelta(double delta) {
newSpeedX = accelX * (float)delta + speedX; newSpeedX = accelX * (float)delta + speedX;
newSpeedY = accelY * (float)delta + speedY; newSpeedY = accelY * (float)delta + speedY;
// High acceleration means velocity overshoots the correct position on low FPS, /* High acceleration means velocity overshoots the correct position on low FPS, */
// causing wiggling. If newSpeed has opposite sign of speed, set speed to 0; /* causing wiggling. If newSpeed has opposite sign of speed, set speed to 0 */
if (newSpeedX * speedX < 0) speedX = 0; if (newSpeedX * speedX < 0) speedX = 0;
else speedX = newSpeedX; else speedX = newSpeedX;
if (newSpeedY * speedY < 0) speedY = 0; if (newSpeedY * speedY < 0) speedY = 0;
else speedY = newSpeedY; else speedY = newSpeedY;
} } else {
else {
speedX = (float)cam_deltaX; speedX = (float)cam_deltaX;
speedY = (float)cam_deltaY; speedY = (float)cam_deltaY;
} }

View File

@ -18,8 +18,6 @@ extern struct _CameraData {
cc_bool Clipping; cc_bool Clipping;
/* Whether to invert vertical mouse movement. */ /* Whether to invert vertical mouse movement. */
cc_bool Invert; cc_bool Invert;
/* The mass (i.e. smoothness) of the smooth camera. */
float Mass;
/* Tilt effect applied to the camera. */ /* Tilt effect applied to the camera. */
struct Matrix TiltM; struct Matrix TiltM;
@ -30,6 +28,8 @@ extern struct _CameraData {
Vec3 CurrentPos; Vec3 CurrentPos;
/* Camera user is currently using. */ /* Camera user is currently using. */
struct Camera* Active; struct Camera* Active;
/* The mass (i.e. smoothness) of the smooth camera. */
float Mass;
} Camera; } Camera;
struct Camera { struct Camera {