diff options
Diffstat (limited to 'src/sky.h')
0 files changed, 0 insertions, 0 deletions
/*
Minetest
Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "camera.h"
#include "debug.h"
#include "client.h"
#include "main.h" // for g_settings
#include "map.h"
#include "clientmap.h" // MapDrawControl
#include "mesh.h"
#include "player.h"
#include "tile.h"
#include <cmath>
#include "settings.h"
#include "itemdef.h" // For wield visualization
#include "noise.h" // easeCurve
#include "gamedef.h"
#include "sound.h"
#include "event.h"
#include "profiler.h"
#include "util/numeric.h"
#include "util/mathconstants.h"
#include "constants.h"
#define CAMERA_OFFSET_STEP 200
Camera::Camera(scene::ISceneManager* smgr, MapDrawControl& draw_control,
IGameDef *gamedef):
m_smgr(smgr),
m_playernode(NULL),
m_headnode(NULL),
m_cameranode(NULL),
m_wieldmgr(NULL),
m_wieldnode(NULL),
m_wieldlight(0),
m_draw_control(draw_control),
m_gamedef(gamedef),
m_camera_position(0,0,0),
m_camera_direction(0,0,0),
m_camera_offset(0,0,0),
m_aspect(1.0),
m_fov_x(1.0),
m_fov_y(1.0),
m_added_busytime(0),
m_added_frames(0),
m_range_old(0),
m_busytime_old(0),
m_frametime_counter(0),
m_time_per_range(30. / 50), // a sane default of 30ms per 50 nodes of range
m_view_bobbing_anim(0),
m_view_bobbing_state(0),
m_view_bobbing_speed(0),
m_view_bobbing_fall(0),
m_digging_anim(0),
m_digging_button(-1),
m_dummymesh(createCubeMesh(v3f(1,1,1))),
m_wield_change_timer(0.125),
m_wield_mesh_next(NULL),
m_previous_playeritem(-1),
m_previous_itemname("")
{
//dstream<<__FUNCTION_NAME<<std::endl;
// note: making the camera node a child of the player node
// would lead to unexpected behaviour, so we don't do that.