diff --git a/src/karts/kart_model.cpp b/src/karts/kart_model.cpp index add90030c..403b2582d 100644 --- a/src/karts/kart_model.cpp +++ b/src/karts/kart_model.cpp @@ -113,8 +113,8 @@ KartModel::KartModel(bool is_master) // default value for kart suspensions. move to config file later // if we find each kart needs custom values - m_min_suspension[i] = -0.59f; - m_max_suspension[i] = 0.59f; + m_min_suspension[i] = -0.07; + m_max_suspension[i] = 0.20f; m_dampen_suspension_amplitude[i] = 2.5f; } m_wheel_filename[0] = ""; @@ -782,15 +782,16 @@ void KartModel::update(float dt, float rotation_dt, float steer, float speed) m_wheel_node[i]->setVisible(wi.m_raycastInfo.m_isInContact); } #endif - float rel_suspension = m_default_physics_suspension[i] - - wi.m_raycastInfo.m_suspensionLength; + float rel_suspension = wi.m_raycastInfo.m_suspensionLength + - m_default_physics_suspension[i]; + // If the suspension is too compressed if(rel_suspension< m_min_suspension[i]) rel_suspension = m_min_suspension[i]; else if(rel_suspension > m_max_suspension[i]) rel_suspension = m_max_suspension[i]; core::vector3df pos = m_wheel_graphics_position[i].toIrrVector(); - pos.Y += rel_suspension; + pos.Y -= rel_suspension; m_wheel_node[i]->setPosition(pos); diff --git a/src/karts/kart_model.hpp b/src/karts/kart_model.hpp index a5cd92201..733fd8aba 100644 --- a/src/karts/kart_model.hpp +++ b/src/karts/kart_model.hpp @@ -172,12 +172,13 @@ private: /** Length of the physics suspension when the kart is at rest. */ float m_default_physics_suspension[4]; - /** Minimum suspension length. If the displayed suspension is - * shorter than this, the wheel would look wrong. */ + /** Minimum suspension length (i.e. most compressed). If the displayed + * suspension is shorter than this, the wheel would look wrong. */ float m_min_suspension[4]; - /** Maximum suspension length. If the displayed suspension is - * any longer, the wheel would look too far away from the chassis. */ + /** Maximum suspension length (i.e. most extended). If the displayed + * suspension is any longer, the wheel would look too far away from the + * chassis. */ float m_max_suspension[4]; /** value used to divide the visual movement of wheels (because the actual movement