From 1ba22f42f1a7bbea776159b690c31c5eb091ead9 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Mon, 17 Dec 2007 13:42:19 +0000 Subject: [PATCH] 1) Enables triangle dependent friction setting, and therefore skidding (currently only for sand). git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1362 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- data/materials.dat | 2 +- src/kart.cpp | 20 ++++---------------- src/kart.hpp | 2 +- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/data/materials.dat b/data/materials.dat index 171f5719b..b0debec53 100644 --- a/data/materials.dat +++ b/data/materials.dat @@ -120,7 +120,7 @@ "stones.rgb" N N N 0.0 Y N 0.2 N N N N "pebbles.rgb" N N N 0.0 Y N 1.0 N N N N "floor.rgb" N N N 0.0 Y N 1.0 N N N N -"sand.rgb" N N N 0.0 Y N 0.5 N N N N +"sand.rgb" N N N 0.0 Y N 0.0000001 N N N N "sandgrass.rgb" N N N 0.0 Y N 0.5 N N N N "egypt.rgb" N N N 0.0 Y N 1.0 N N N Y "pyramidwall.rgb" N N N 0.0 Y N 1.0 N N N N diff --git a/src/kart.cpp b/src/kart.cpp index eed626c89..80ed1cef2 100644 --- a/src/kart.cpp +++ b/src/kart.cpp @@ -137,7 +137,6 @@ Kart::Kart (const KartProperties* kartProperties_, int position_ , m_finish_time = 0.0f; m_prev_accel = 0.0f; m_wheelie_angle = 0.0f; - m_current_friction = 1.0f; m_time_since_stuck = 0.0f; m_smokepuff = NULL; m_smoke_system = NULL; @@ -720,16 +719,7 @@ void Kart::update (float dt) updatePhysics(dt); sgCopyVec2 ( m_last_track_coords, m_curr_track_coords ); - if(m_material_hot && isOnGround()) - { - float r=m_material_hot->getFriction(); - if(rgetNumWheels(); i++) { // terrain dependent friction - m_vehicle->getWheelInfo(i).m_frictionSlip = - m_kart_properties->getFrictionSlip() * - getMaterial()->getFriction(); + m_vehicle->getWheelInfo(i).m_frictionSlip = getFrictionSlip() * + getMaterial()->getFriction(); } // for igetWheelBase();} float getHeightCOG () const {return m_kart_properties->getHeightCOG();} float getTireGrip () const {return m_kart_properties->getTireGrip();} + float getFrictionSlip () const {return m_kart_properties->getFrictionSlip();} float getMaxSteerAngle () const {return m_kart_properties->getMaxSteerAngle();} float getCornerStiffF () const {return m_kart_properties->getCornerStiffF();} float getCornerStiffR () const {return m_kart_properties->getCornerStiffR();}