diff --git a/src/karts/kart_rewinder.cpp b/src/karts/kart_rewinder.cpp index a67b7b28a..cfe038f50 100644 --- a/src/karts/kart_rewinder.cpp +++ b/src/karts/kart_rewinder.cpp @@ -56,6 +56,7 @@ void KartRewinder::reset() Rewinder::reset(); SmoothNetworkBody::setEnable(true); SmoothNetworkBody::setSmoothRotation(true); + SmoothNetworkBody::setAdjustVerticalOffset(true); } // reset // ---------------------------------------------------------------------------- diff --git a/src/network/smooth_network_body.cpp b/src/network/smooth_network_body.cpp index 6401bdb64..c29e3a5af 100644 --- a/src/network/smooth_network_body.cpp +++ b/src/network/smooth_network_body.cpp @@ -159,7 +159,7 @@ void SmoothNetworkBody::updateSmoothedGraphics( m_smoothed_transform.setOrigin(cur_xyz); m_smoothed_transform.setRotation(cur_rot); - if (m_smoothing != SS_NONE) + if (m_adjust_vertical_offset && m_smoothing != SS_NONE) { Vec3 lc = current_transform.inverse()(cur_xyz); // Adjust vertical position for up/down-sloping diff --git a/src/network/smooth_network_body.hpp b/src/network/smooth_network_body.hpp index 404841d6a..6769fe439 100644 --- a/src/network/smooth_network_body.hpp +++ b/src/network/smooth_network_body.hpp @@ -56,12 +56,15 @@ private: bool m_smooth_rotation; + bool m_adjust_vertical_offset; + public: SmoothNetworkBody(bool enable = false) { reset(); m_enabled = enable; m_smooth_rotation = true; + m_adjust_vertical_offset = true; } // ------------------------------------------------------------------------ void reset() @@ -79,6 +82,8 @@ public: // ------------------------------------------------------------------------ void setSmoothRotation(bool val) { m_smooth_rotation = val; } // ------------------------------------------------------------------------ + void setAdjustVerticalOffset(bool val) { m_adjust_vertical_offset = val; } + // ------------------------------------------------------------------------ void prepareSmoothing(const btTransform& current_transform, const Vec3& current_velocity); // ------------------------------------------------------------------------ diff --git a/src/physics/physical_object.cpp b/src/physics/physical_object.cpp index 5ec3cf782..d7434414e 100644 --- a/src/physics/physical_object.cpp +++ b/src/physics/physical_object.cpp @@ -790,6 +790,7 @@ void PhysicalObject::addForRewind() { SmoothNetworkBody::setEnable(true); SmoothNetworkBody::setSmoothRotation(false); + SmoothNetworkBody::setAdjustVerticalOffset(false); Rewinder::setUniqueIdentity(std::string("P") + StringUtils::toString (Track::getCurrentTrack()->getPhysicalObjectUID())); Rewinder::add();