#define CAMERA_OFFSET_STEP 200
#define WIELDMESH_OFFSET_X 55.0f
#define WIELDMESH_OFFSET_Y -35.0f
+#define WIELDMESH_AMPLITUDE_X 7.0f
+#define WIELDMESH_AMPLITUDE_Y 10.0f
Camera::Camera(MapDrawControl &draw_control, Client *client):
m_draw_control(draw_control),
m_last_cam_pos.X = player_yaw;
m_wieldmesh_offset.X = rangelim(m_wieldmesh_offset.X,
- WIELDMESH_OFFSET_X - 7.0f, WIELDMESH_OFFSET_X + 7.0f);
+ WIELDMESH_OFFSET_X - (WIELDMESH_AMPLITUDE_X * 0.5f),
+ WIELDMESH_OFFSET_X + (WIELDMESH_AMPLITUDE_X * 0.5f));
}
if (m_cam_vel.Y > 1.0f) {
m_last_cam_pos.Y = m_camera_direction.Y;
m_wieldmesh_offset.Y = rangelim(m_wieldmesh_offset.Y,
- WIELDMESH_OFFSET_Y - 10.0f, WIELDMESH_OFFSET_Y + 5.0f);
+ WIELDMESH_OFFSET_Y - (WIELDMESH_AMPLITUDE_Y * 0.5f),
+ WIELDMESH_OFFSET_Y + (WIELDMESH_AMPLITUDE_Y * 0.5f));
}
m_arm_dir = dir(m_wieldmesh_offset);
following a vector, with a smooth deceleration factor.
*/
- f32 dec_X = 0.12f * (m_cam_vel_old.X * (1.0f +
+ f32 dec_X = 0.35f * (std::min(15.0f, m_cam_vel_old.X) * (1.0f +
(1.0f - m_arm_dir.X))) * (gap_X / 20.0f);
- f32 dec_Y = 0.06f * (m_cam_vel_old.Y * (1.0f +
+ f32 dec_Y = 0.25f * (std::min(15.0f, m_cam_vel_old.Y) * (1.0f +
(1.0f - m_arm_dir.Y))) * (gap_Y / 15.0f);
if (gap_X < 0.1f)