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

maintenance: minor code tweaks

This commit is contained in:
tmj-fstate
2019-08-20 12:40:55 +02:00
parent 4dddf2dc45
commit 07d43956af
6 changed files with 11 additions and 7 deletions

View File

@@ -123,7 +123,8 @@ basic_precipitation::update() {
m_camerapos = Global.pCamera.Pos;
// intercept sudden user-induced camera jumps
// intercept sudden user-induced camera jumps...
// ...from free fly mode change
if( m_freeflymode != FreeFlyModeFlag ) {
m_freeflymode = FreeFlyModeFlag;
if( true == m_freeflymode ) {
@@ -138,14 +139,17 @@ basic_precipitation::update() {
}
cameramove = glm::dvec3{ 0.0 };
}
// ...from jump between cab and window/mirror view
if( m_windowopen != Global.CabWindowOpen ) {
m_windowopen = Global.CabWindowOpen;
cameramove = glm::dvec3{ 0.0 };
}
// ... from cab change
if( ( simulation::Train != nullptr ) && ( simulation::Train->iCabn != m_activecab ) ) {
m_activecab = simulation::Train->iCabn;
cameramove = glm::dvec3{ 0.0 };
}
// ... from camera jump to another location
if( glm::length( cameramove ) > 100.0 ) {
cameramove = glm::dvec3{ 0.0 };
}