parent
a85b803e5c
commit
00fe2e6aa7
|
@ -36,11 +36,15 @@ void Camera_FPSV2::SetPosition( const Float3 &translation )
|
|||
this->body.translation = translation;
|
||||
}
|
||||
|
||||
void Camera_FPSV2::SetRotation( const Quaternion &rotation )
|
||||
{
|
||||
this->body.rotation = rotation;
|
||||
this->head.SetRotation( rotation * Rotation(this->pitchUp, this->GetNormalOf(Float3::standard_unit_x) ) );
|
||||
}
|
||||
|
||||
void Camera_FPSV2::SetAngular( const Float3 &axis )
|
||||
{
|
||||
this->body.rotation = Rotation( axis );
|
||||
this->head.SetRotation( this->body.rotation );
|
||||
this->pitchUp = 0.0f;
|
||||
this->SetRotation( Rotation(axis) );
|
||||
}
|
||||
|
||||
void Camera_FPSV2::SetProjection( const Float4x4 &matrix )
|
||||
|
|
|
@ -14,6 +14,7 @@ public:
|
|||
|
||||
void SetHeadOffset( const ::Oyster::Math::Float3 &translation );
|
||||
void SetPosition( const ::Oyster::Math::Float3 &translation );
|
||||
void SetRotation( const ::Oyster::Math::Quaternion &rotation );
|
||||
void SetAngular( const ::Oyster::Math::Float3 &axis );
|
||||
void SetProjection( const ::Oyster::Math::Float4x4 &matrix );
|
||||
void SetOrthographicProjection( ::Oyster::Math::Float width, ::Oyster::Math::Float height, ::Oyster::Math::Float nearClip, ::Oyster::Math::Float farClip );
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include "DllInterfaces/GFXAPI.h"
|
||||
#include <Protocols.h>
|
||||
#include "NetworkClient.h"
|
||||
#include "Camera_FPS.h"
|
||||
#include "Camera_FPSV2.h"
|
||||
#include <GameServerAPI.h>
|
||||
|
||||
#include "C_obj/C_Player.h"
|
||||
|
@ -39,7 +39,7 @@ struct GameState::MyData
|
|||
bool key_Reload_Shaders;
|
||||
|
||||
C_Player player;
|
||||
Camera_FPS camera;
|
||||
Camera_FPSV2 camera;
|
||||
|
||||
int myId;
|
||||
|
||||
|
@ -357,7 +357,7 @@ const GameClientState::NetEvent & GameState::DataRecieved( const GameClientState
|
|||
|
||||
// if is this player. Remember to change camera
|
||||
if( this->privData->myId == decoded.object_ID )
|
||||
this->privData->camera.SetAngular( AngularAxis(rotation) );
|
||||
this->privData->camera.SetRotation( rotation );
|
||||
|
||||
(*this->privData->dynamicObjects)[decoded.object_ID]->setRot( rotation );
|
||||
}
|
||||
|
@ -372,7 +372,7 @@ const GameClientState::NetEvent & GameState::DataRecieved( const GameClientState
|
|||
if( this->privData->myId == decoded.object_ID )
|
||||
{
|
||||
this->privData->camera.SetPosition( position );
|
||||
this->privData->camera.SetAngular( AngularAxis(rotation) );
|
||||
this->privData->camera.SetRotation( rotation );
|
||||
}
|
||||
|
||||
C_DynamicObj *object = (*this->privData->dynamicObjects)[decoded.object_ID];
|
||||
|
|
Loading…
Reference in New Issue