16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 00:09:19 +02:00

working vehicle spotlights

This commit is contained in:
tmj-fstate
2017-02-25 21:02:27 +01:00
parent 259e9042e1
commit 493340e602
11 changed files with 353 additions and 184 deletions

View File

@@ -32,8 +32,8 @@ cSun::update() {
move();
Math3D::vector3 position( 0.0f, 0.0f, -2000.0f );
position.RotateX( (float)( m_body.elevref * ( M_PI / 180.0 ) ) );
position.RotateY( (float)( ( 90.0 - m_body.hrang ) * ( M_PI / 180.0 ) ) );
position.RotateX( (float)( m_body.elevref * ( M_PI / 180.0 ) ) );
position.RotateY( (float)( -m_body.hrang * ( M_PI / 180.0 ) ) );
m_position = position;
}
@@ -69,8 +69,8 @@ Math3D::vector3
cSun::getDirection() {
Math3D::vector3 position( 0.f, 0.f, -1.f );
position.RotateX( (float)(m_body.elevref * (M_PI/180.0)) );
position.RotateY( (float)((90.0 - m_body.hrang) * (M_PI/180.0)) );
position.RotateX( (float)( m_body.elevref * (M_PI/180.0)) );
position.RotateY( (float)( -m_body.hrang * (M_PI/180.0)) );
position.Normalize();
return position;
}