reverted pantograph control changes, removed some of the type conversion warnings

This commit is contained in:
tmj-fstate
2017-07-28 20:28:08 +02:00
parent 9b4dc83a2d
commit 3a26ccb2fd
15 changed files with 211 additions and 433 deletions

View File

@@ -379,35 +379,9 @@ void TCamera::Update()
}
}
vector3 TCamera::GetDirection()
{
matrix4x4 mat;
vector3 Vec;
Vec = vector3(0, 0, 1);
Vec.RotateY(Yaw);
vector3 TCamera::GetDirection() {
return (Normalize(Vec));
}
bool TCamera::SetMatrix()
{
glRotated( -Roll * 180.0 / M_PI, 0.0, 0.0, 1.0 ); // po wyłączeniu tego kręci się pojazd, a sceneria nie
glRotated( -Pitch * 180.0 / M_PI, 1.0, 0.0, 0.0 );
glRotated( -Yaw * 180.0 / M_PI, 0.0, 1.0, 0.0 ); // w zewnętrznym widoku: kierunek patrzenia
if( Type == tp_Follow )
{
gluLookAt(
Pos.x, Pos.y, Pos.z,
LookAt.x, LookAt.y, LookAt.z,
vUp.x, vUp.y, vUp.z); // Ra: pOffset is zero
}
else {
glTranslated( -Pos.x, -Pos.y, -Pos.z ); // nie zmienia kierunku patrzenia
}
Global::SetCameraPosition(Pos); // było +pOffset
return true;
return glm::normalize( glm::rotateY<float>( glm::vec3{ 0.f, 0.f, 1.f }, Yaw ) );
}
bool TCamera::SetMatrix( glm::dmat4 &Matrix ) {
@@ -427,7 +401,6 @@ bool TCamera::SetMatrix( glm::dmat4 &Matrix ) {
Matrix = glm::translate( Matrix, glm::dvec3{ -Pos } ); // nie zmienia kierunku patrzenia
}
Global::SetCameraPosition( Pos ); // było +pOffset
return true;
}
@@ -446,4 +419,3 @@ void TCamera::Stop()
Type = tp_Follow;
Velocity = vector3(0, 0, 0);
};