Added setting for maximum suspension force (currently set at the

old default value).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10296 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2011-12-01 12:14:20 +00:00
parent bb6e9f6f2c
commit 422788bc20
4 changed files with 18 additions and 8 deletions

View File

@ -234,9 +234,10 @@
rest: Length of suspension when at rest.
travel-cm: maximum movement of suspension - in cm!!
exp-string-response: dampen the suspension spring reaction
exponentially -->
exponentially.
max-force: Maximum suspension force -->
<suspension stiffness="248" rest="0.2" travel-cm="19"
exp-spring-response="false"/>
exp-spring-response="false" max-force="6000"/>
<!-- Wheel related parameters: damping-relaxation/compression: for
bullet, damping parameters. Radius and width of wheel.

View File

@ -292,7 +292,10 @@ void Kart::createPhysics()
btVector3 wheel_axle(-1.0f, 0.0f, 0.0f);
btKart::btVehicleTuning tuning;
tuning.m_maxSuspensionTravelCm = m_kart_properties->getSuspensionTravelCM();
tuning.m_maxSuspensionTravelCm =
m_kart_properties->getSuspensionTravelCM();
tuning.m_maxSuspensionForce =
m_kart_properties->getMaxSuspensionForce();
for(unsigned int i=0; i<4; i++)
{

View File

@ -70,7 +70,7 @@ KartProperties::KartProperties(const std::string &filename)
m_nitro_max_speed_increase = m_nitro_duration = m_nitro_fade_out_time =
m_suspension_stiffness = m_wheel_damping_relaxation = m_wheel_base =
m_wheel_damping_compression = m_friction_slip = m_roll_influence =
m_wheel_radius = m_chassis_linear_damping =
m_wheel_radius = m_chassis_linear_damping = m_max_suspension_force =
m_chassis_angular_damping = m_suspension_rest =
m_max_speed_reverse_ratio =
m_rescue_vert_offset = m_upright_tolerance = m_collision_side_impulse =
@ -385,10 +385,11 @@ void KartProperties::getAllData(const XMLNode * root)
if(const XMLNode *suspension_node = root->getNode("suspension"))
{
suspension_node->get("stiffness", &m_suspension_stiffness);
suspension_node->get("rest", &m_suspension_rest );
suspension_node->get("travel-cm", &m_suspension_travel_cm);
suspension_node->get("exp-spring-response", &m_exp_spring_response );
suspension_node->get("stiffness", &m_suspension_stiffness);
suspension_node->get("rest", &m_suspension_rest );
suspension_node->get("travel-cm", &m_suspension_travel_cm);
suspension_node->get("exp-spring-response", &m_exp_spring_response );
suspension_node->get("max-force", &m_max_suspension_force);
}
if(const XMLNode *wheels_node = root->getNode("wheels"))
@ -585,6 +586,7 @@ void KartProperties::checkAllSet(const std::string &filename)
CHECK_NEG(m_suspension_stiffness, "suspension stiffness" );
CHECK_NEG(m_suspension_rest, "suspension rest" );
CHECK_NEG(m_suspension_travel_cm, "suspension travel-cm" );
CHECK_NEG(m_max_suspension_force, "suspension max-force" );
CHECK_NEG(m_collision_side_impulse, "collision side-impulse" );
CHECK_NEG(m_upright_tolerance, "upright tolerance" );
CHECK_NEG(m_upright_max_force, "upright max-force" );

View File

@ -214,6 +214,7 @@ private:
float m_suspension_stiffness;
float m_wheel_damping_relaxation;
float m_wheel_damping_compression;
float m_max_suspension_force;
float m_friction_slip;
float m_roll_influence;
float m_wheel_radius;
@ -419,6 +420,9 @@ public:
float getWheelDampingCompression() const
{return m_wheel_damping_compression;}
/** Returns maximum suspension force. */
float getMaxSuspensionForce() const {return m_max_suspension_force; }
/** Returns friction slip. */
float getFrictionSlip () const {return m_friction_slip; }