#include "util/numeric.h"
#include <ICameraSceneNode.h>
+#include "client.h"
+
class LocalPlayer;
struct MapDrawControl;
class IGameDef;
+enum CameraModes {CAMERA_MODE_FIRST, CAMERA_MODE_THIRD, CAMERA_MODE_THIRD_FRONT};
+
/*
Client camera class, manages the player and camera scene nodes, the viewing distance
and performs view bobbing etc. It also displays the wielded tool in front of the
{
return m_camera_direction;
}
+
+ // Get the camera offset
+ inline v3s16 getOffset() const
+ {
+ return m_camera_offset;
+ }
// Horizontal field of view
inline f32 getFovX() const
void step(f32 dtime);
// Update the camera from the local player's position.
- // frametime is used to adjust the viewing range.
- void update(LocalPlayer* player, f32 frametime, v2u32 screensize,
- f32 tool_reload_ratio);
+ // busytime is used to adjust the viewing range.
+ void update(LocalPlayer* player, f32 frametime, f32 busytime,
+ v2u32 screensize, f32 tool_reload_ratio,
+ int current_camera_mode, ClientEnvironment &c_env);
// Render distance feedback loop
- void updateViewingRange(f32 frametime_in);
+ void updateViewingRange(f32 frametime_in, f32 busytime_in);
// Start digging animation
// Pass 0 for left click, 1 for right click
v3f m_camera_position;
// Absolute camera direction
v3f m_camera_direction;
+ // Camera offset
+ v3s16 m_camera_offset;
// Field of view and aspect ratio stuff
f32 m_aspect;
f32 m_fov_y;
// Stuff for viewing range calculations
- f32 m_added_frametime;
+ f32 m_added_busytime;
s16 m_added_frames;
f32 m_range_old;
- f32 m_frametime_old;
+ f32 m_busytime_old;
f32 m_frametime_counter;
f32 m_time_per_range;