From 7cea551157a5d15016154ae0179f4aedffa6c1ca Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 12:52:56 +0100 Subject: [PATCH] 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 Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD --- rendering/opengl46/opengl46renderer.cpp | 6 ++++-- rendering/vulkan14/vulkan14frame.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/rendering/opengl46/opengl46renderer.cpp b/rendering/opengl46/opengl46renderer.cpp index cbe7da7c9..bd510fe36 100644 --- a/rendering/opengl46/opengl46renderer.cpp +++ b/rendering/opengl46/opengl46renderer.cpp @@ -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) diff --git a/rendering/vulkan14/vulkan14frame.cpp b/rendering/vulkan14/vulkan14frame.cpp index 1b66ce0be..7f91c41b7 100644 --- a/rendering/vulkan14/vulkan14frame.cpp +++ b/rendering/vulkan14/vulkan14frame.cpp @@ -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)