18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-02 06:12:41 +01:00

Wipers and insects: the views from outside the cab follow the train driven

The new views of the consist put the camera at any vehicle of the train, one with an active cab of
its own too: taken for another vehicle, it wiped the insects met and the memory of the blades, so
the insects were gone from the glass after a change of the view. Outside the cab (FreeFlyModeFlag)
the glasses now follow the train driven, in both renderers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
This commit is contained in:
Claude
2026-11-29 12:52:56 +01:00
parent 5d6f443450
commit 7cea551157
2 changed files with 8 additions and 4 deletions
+4 -2
View File
@@ -1700,8 +1700,10 @@ void opengl46_renderer::Render_pass(viewport_config &vp, rendermode const Mode)
}
// the wipers of the vehicle the camera is in, or of the train driven when the camera is outside it: the moments the blades
// were at the ends of their sweep (the drops on the glass come back from then) are kept while the camera is away, so the glass
// looks as the blades left it when it's back in the cab. they're forgotten only for another vehicle
TDynamicObject const *owner = Global.pCamera.m_owner;
// looks as the blades left it when it's back in the cab. they're forgotten only for another vehicle. the views from outside
// (freefly, the views of the consist) put the camera at any vehicle of the train, one with an active cab of its own too: they
// follow the train driven, so going round them doesn't wipe the insects and the memory of the blades
TDynamicObject const *owner = FreeFlyModeFlag ? nullptr : Global.pCamera.m_owner;
if ((owner == nullptr) || (owner->physics->CabActive == 0))
owner = (simulation::Train != nullptr) ? simulation::Train->Dynamic() : nullptr;
if (owner != m_wipervehicle)
+4 -2
View File
@@ -1573,8 +1573,10 @@ void vulkan14_renderer::render_viewport(std::size_t const Index)
}
// the wipers of the vehicle the camera is in, or of the train driven when the camera is outside it: the moments the blades
// were at the ends of their sweep (the drops on the glass come back from then) are kept while the camera is away, so the glass
// looks as the blades left it when it's back in the cab. they're forgotten only for another vehicle
TDynamicObject const *owner = Global.pCamera.m_owner;
// looks as the blades left it when it's back in the cab. they're forgotten only for another vehicle. the views from outside
// (freefly, the views of the consist) put the camera at any vehicle of the train, one with an active cab of its own too: they
// follow the train driven, so going round them doesn't wipe the insects and the memory of the blades
TDynamicObject const *owner = FreeFlyModeFlag ? nullptr : Global.pCamera.m_owner;
if ((owner == nullptr) || (owner->physics->CabActive == 0))
owner = (simulation::Train != nullptr) ? simulation::Train->Dynamic() : nullptr;
if (owner != m_wipervehicle)