mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 21:57:00 +02:00
commit
ab73b67541
1 changed files with 2 additions and 11 deletions
|
@ -9,9 +9,6 @@
|
||||||
|
|
||||||
#include "Camera.h"
|
#include "Camera.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------
|
|
||||||
Camera::Camera()
|
Camera::Camera()
|
||||||
{
|
{
|
||||||
_mode = CAMERA_MODE_THIRD_PERSON;
|
_mode = CAMERA_MODE_THIRD_PERSON;
|
||||||
|
@ -30,15 +27,11 @@ Camera::Camera()
|
||||||
_orientation.setToIdentity();
|
_orientation.setToIdentity();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------
|
|
||||||
void Camera::update( float deltaTime )
|
void Camera::update( float deltaTime )
|
||||||
{
|
{
|
||||||
float radian = ( _yaw / 180.0 ) * PIE;
|
float radian = ( _yaw / 180.0 ) * PIE;
|
||||||
|
|
||||||
//these need to be checked to make sure they correspond to the cordinate system.
|
// these need to be checked to make sure they correspond to the cordinate system.
|
||||||
float x = _distance * -sin( radian );
|
float x = _distance * -sin( radian );
|
||||||
float z = _distance * cos( radian );
|
float z = _distance * cos( radian );
|
||||||
float y = _up;
|
float y = _up;
|
||||||
|
@ -52,9 +45,7 @@ void Camera::update( float deltaTime )
|
||||||
|
|
||||||
_position += ( _idealPosition - _position ) * t;
|
_position += ( _idealPosition - _position ) * t;
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
// geterate the ortho-normals for the orientation based on the Euler angles
|
||||||
//geterate the ortho-normals for the orientation based on the Euler angles
|
|
||||||
//------------------------------------------------------------------------
|
|
||||||
_orientation.setToIdentity();
|
_orientation.setToIdentity();
|
||||||
_orientation.yaw ( _yaw );
|
_orientation.yaw ( _yaw );
|
||||||
_orientation.pitch ( _pitch );
|
_orientation.pitch ( _pitch );
|
||||||
|
|
Loading…
Reference in a new issue