50 lines
995 B
C++
50 lines
995 B
C++
#include "player.hpp"
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// PLAYER
|
|
//-----------------------------------------------------------------------------
|
|
Player::Player()
|
|
{
|
|
x = 0;
|
|
y = 0;
|
|
z = 0;
|
|
yaw = 0;
|
|
pitch = 0;
|
|
|
|
height = 16;//16
|
|
total_height = 18;
|
|
belly = 5;
|
|
|
|
action_distance = 20;
|
|
|
|
moving = false;
|
|
jumping = false;
|
|
turning = false;
|
|
|
|
translation_speed = 0;
|
|
rotation_speed = 0;
|
|
jump_speed = 0;
|
|
|
|
translation_speed_max = 1.5;
|
|
translation_acceleration = 0.1;
|
|
rotation_speed_max = 7;
|
|
int hauteur_saut_max = 2; // en metre
|
|
jump_speed_max = sqrtf(hauteur_saut_max * 2 * 9.81);
|
|
|
|
dissociate_camera = false;
|
|
can_move = true;
|
|
}
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// TELEPORT
|
|
//-----------------------------------------------------------------------------
|
|
void Player::teleport(float _x, float _y, float _z, float _yaw, float _pitch)
|
|
{
|
|
x = _x;
|
|
y = _y;
|
|
z = _z;
|
|
yaw = _yaw;
|
|
pitch = _pitch;
|
|
}
|