diff --git a/src/tracks/track.cpp b/src/tracks/track.cpp index 73b560a2e..c1ec73e27 100644 --- a/src/tracks/track.cpp +++ b/src/tracks/track.cpp @@ -2148,7 +2148,15 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id) for (auto* to : m_track_object_manager->getObjects().m_contents_vector) { if (to->joinToMainTrack()) + { m_track_object_manager->removeDriveableObject(to); + TrackObjectPresentationSceneNode* ts = + to->getPresentation(); + // physicial only node is always hidden, remove it from stk after + // joining to track mesh + if (ts && ts->isAlwaysHidden()) + m_track_object_manager->removeObject(to); + } } createPhysicsModel(main_track_count); diff --git a/src/tracks/track_object_presentation.hpp b/src/tracks/track_object_presentation.hpp index 177159f93..f84dbc386 100644 --- a/src/tracks/track_object_presentation.hpp +++ b/src/tracks/track_object_presentation.hpp @@ -149,6 +149,7 @@ public: TrackObjectPresentation(xyz, hpr, scale) { m_node = node; + m_force_always_hidden = false; } // TrackObjectPresentationSceneNode // ------------------------------------------------------------------------ @@ -168,6 +169,8 @@ public: // ------------------------------------------------------------------------ /** Returns a pointer to the scene node, const version. */ const scene::ISceneNode* getNode() const { return m_node; } + // ------------------------------------------------------------------------ + bool isAlwaysHidden() const { return m_force_always_hidden; } }; // class TrackObjectPresentationSceneNode // ============================================================================