diff --git a/src/tracks/track.cpp b/src/tracks/track.cpp index 6e5210df2..78e299068 100644 --- a/src/tracks/track.cpp +++ b/src/tracks/track.cpp @@ -2149,7 +2149,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 016b588ff..7686f95eb 100644 --- a/src/tracks/track_object_presentation.hpp +++ b/src/tracks/track_object_presentation.hpp @@ -147,6 +147,7 @@ public: TrackObjectPresentation(xyz, hpr, scale) { m_node = node; + m_force_always_hidden = false; } // TrackObjectPresentationSceneNode // ------------------------------------------------------------------------ @@ -166,6 +167,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 // ============================================================================