Tweak variable names

This commit is contained in:
Marianne Gagnon 2014-11-21 18:25:50 -05:00
parent 9e5eced8df
commit c7b43b49e7
3 changed files with 21 additions and 21 deletions

View File

@ -663,24 +663,24 @@ namespace UserConfigParams
"If the kart is driving backwards faster than this value,\n" "If the kart is driving backwards faster than this value,\n"
"switch automatically to reverse camera (set to 0 to disable).") ); "switch automatically to reverse camera (set to 0 to disable).") );
PARAM_PREFIX FloatUserConfigParam m_camera_direction_speed PARAM_PREFIX FloatUserConfigParam m_fspcam_direction_speed
PARAM_DEFAULT( FloatUserConfigParam(0.003f, "rotation_speed", PARAM_DEFAULT( FloatUserConfigParam(0.003f, "fspcam_rotation_speed",
&m_camera, &m_camera,
"How fast the first person camera's direction speed changes when\n" "How fast the first person camera's direction speed changes when\n"
"moving the mouse (means acceleration).") ); "moving the mouse (means acceleration).") );
PARAM_PREFIX FloatUserConfigParam m_camera_smooth_direction_max_speed PARAM_PREFIX FloatUserConfigParam m_fspcam_smooth_direction_max_speed
PARAM_DEFAULT( FloatUserConfigParam(0.04f, "smooth_rotation_max_speed", PARAM_DEFAULT( FloatUserConfigParam(0.04f, "fspcam_smooth_rotation_max_speed",
&m_camera, &m_camera,
"How fast the first person camera's direction can change.") ); "How fast the first person camera's direction can change.") );
PARAM_PREFIX FloatUserConfigParam m_camera_angular_velocity PARAM_PREFIX FloatUserConfigParam m_fspcam_angular_velocity
PARAM_DEFAULT( FloatUserConfigParam(0.02f, "angular_velocity", PARAM_DEFAULT( FloatUserConfigParam(0.02f, "fspcam_angular_velocity",
&m_camera, &m_camera,
"How fast the first person camera's rotation speed changes.") ); "How fast the first person camera's rotation speed changes.") );
PARAM_PREFIX FloatUserConfigParam m_camera_max_angular_velocity PARAM_PREFIX FloatUserConfigParam m_fspcam_max_angular_velocity
PARAM_DEFAULT( FloatUserConfigParam(1.0f, "max_angular_velocity", PARAM_DEFAULT( FloatUserConfigParam(1.0f, "fspcam_max_angular_velocity",
&m_camera, &m_camera,
"How fast the first person camera can rotate.") ); "How fast the first person camera can rotate.") );

View File

@ -501,13 +501,13 @@ void Camera::update(float dt)
// Angular velocity // Angular velocity
if (m_angular_velocity < m_target_angular_velocity) if (m_angular_velocity < m_target_angular_velocity)
{ {
m_angular_velocity += UserConfigParams::m_camera_angular_velocity; m_angular_velocity += UserConfigParams::m_fspcam_angular_velocity;
if (m_angular_velocity > m_target_angular_velocity) if (m_angular_velocity > m_target_angular_velocity)
m_angular_velocity = m_target_angular_velocity; m_angular_velocity = m_target_angular_velocity;
} }
else if (m_angular_velocity > m_target_angular_velocity) else if (m_angular_velocity > m_target_angular_velocity)
{ {
m_angular_velocity -= UserConfigParams::m_camera_angular_velocity; m_angular_velocity -= UserConfigParams::m_fspcam_angular_velocity;
if (m_angular_velocity < m_target_angular_velocity) if (m_angular_velocity < m_target_angular_velocity)
m_angular_velocity = m_target_angular_velocity; m_angular_velocity = m_target_angular_velocity;
} }
@ -525,13 +525,13 @@ void Camera::update(float dt)
diff = m_target_direction - direction; diff = m_target_direction - direction;
if (diff.X != 0 || diff.Y != 0 || diff.Z != 0) if (diff.X != 0 || diff.Y != 0 || diff.Z != 0)
{ {
diff.setLength(UserConfigParams::m_camera_direction_speed); diff.setLength(UserConfigParams::m_fspcam_direction_speed);
m_direction_velocity += diff; m_direction_velocity += diff;
if (m_direction_velocity.getLengthSQ() > if (m_direction_velocity.getLengthSQ() >
UserConfigParams::m_camera_smooth_direction_max_speed * UserConfigParams::m_fspcam_smooth_direction_max_speed *
UserConfigParams::m_camera_smooth_direction_max_speed) UserConfigParams::m_fspcam_smooth_direction_max_speed)
m_direction_velocity.setLength( m_direction_velocity.setLength(
UserConfigParams::m_camera_smooth_direction_max_speed); UserConfigParams::m_fspcam_smooth_direction_max_speed);
direction += m_direction_velocity; direction += m_direction_velocity;
m_target_direction = direction; m_target_direction = direction;
} }
@ -541,9 +541,9 @@ void Camera::update(float dt)
if (diff.X != 0 || diff.Y != 0 || diff.Z != 0) if (diff.X != 0 || diff.Y != 0 || diff.Z != 0)
{ {
if (diff.getLengthSQ() > if (diff.getLengthSQ() >
UserConfigParams::m_camera_angular_velocity * UserConfigParams::m_fspcam_angular_velocity *
UserConfigParams::m_camera_angular_velocity) UserConfigParams::m_fspcam_angular_velocity)
diff.setLength(UserConfigParams::m_camera_angular_velocity); diff.setLength(UserConfigParams::m_fspcam_angular_velocity);
up += diff; up += diff;
} }
} }

View File

@ -215,7 +215,7 @@ void InputManager::handleStaticAction(int key, int value)
Camera *active_cam = Camera::getActiveCamera(); Camera *active_cam = Camera::getActiveCamera();
active_cam->setAngularVelocity(value ? active_cam->setAngularVelocity(value ?
UserConfigParams::m_camera_max_angular_velocity : 0); UserConfigParams::m_fspcam_max_angular_velocity : 0);
break; break;
} }
case KEY_KEY_E: case KEY_KEY_E:
@ -225,7 +225,7 @@ void InputManager::handleStaticAction(int key, int value)
Camera *active_cam = Camera::getActiveCamera(); Camera *active_cam = Camera::getActiveCamera();
active_cam->setAngularVelocity(value ? active_cam->setAngularVelocity(value ?
-UserConfigParams::m_camera_max_angular_velocity : 0); -UserConfigParams::m_fspcam_max_angular_velocity : 0);
break; break;
} }
@ -971,9 +971,9 @@ EventPropagation InputManager::input(const SEvent& event)
int diff_x = event.MouseInput.X - m_mouse_val_x; int diff_x = event.MouseInput.X - m_mouse_val_x;
int diff_y = event.MouseInput.Y - m_mouse_val_y; int diff_y = event.MouseInput.Y - m_mouse_val_y;
float mouse_x = ((float) diff_x) * float mouse_x = ((float) diff_x) *
UserConfigParams::m_camera_direction_speed; UserConfigParams::m_fspcam_direction_speed;
float mouse_y = ((float) diff_y) * float mouse_y = ((float) diff_y) *
-UserConfigParams::m_camera_direction_speed; -UserConfigParams::m_fspcam_direction_speed;
// No movement the first time it's used // No movement the first time it's used
// At the moment there's also a hard limit because the mouse // At the moment there's also a hard limit because the mouse
// gets reset to the middle of the screen and sometimes there // gets reset to the middle of the screen and sometimes there