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
This commit is contained in:
hikerstk 2007-12-17 13:42:19 +00:00
parent 0f0ae96039
commit 1ba22f42f1
3 changed files with 6 additions and 18 deletions

View File

@ -120,7 +120,7 @@
"stones.rgb" N N N 0.0 Y N 0.2 N N N N "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 "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 "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 "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 "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 "pyramidwall.rgb" N N N 0.0 Y N 1.0 N N N N

View File

@ -137,7 +137,6 @@ Kart::Kart (const KartProperties* kartProperties_, int position_ ,
m_finish_time = 0.0f; m_finish_time = 0.0f;
m_prev_accel = 0.0f; m_prev_accel = 0.0f;
m_wheelie_angle = 0.0f; m_wheelie_angle = 0.0f;
m_current_friction = 1.0f;
m_time_since_stuck = 0.0f; m_time_since_stuck = 0.0f;
m_smokepuff = NULL; m_smokepuff = NULL;
m_smoke_system = NULL; m_smoke_system = NULL;
@ -720,16 +719,7 @@ void Kart::update (float dt)
updatePhysics(dt); updatePhysics(dt);
sgCopyVec2 ( m_last_track_coords, m_curr_track_coords ); sgCopyVec2 ( m_last_track_coords, m_curr_track_coords );
if(m_material_hot && isOnGround())
{
float r=m_material_hot->getFriction();
if(r<m_current_friction)
{
m_velocity.xyz[1]-= (m_current_friction*m_current_friction-r*r)
*m_velocity.xyz[1];
} // r<m_current_friction
m_current_friction = r;
} // if m_material_hot
Moveable::update(dt); Moveable::update(dt);
btTransform trans; btTransform trans;
getTrans(&trans); getTrans(&trans);
@ -741,15 +731,13 @@ void Kart::update (float dt)
} }
else else
{ {
#ifdef TERRAIN_SPECIFIC_FRICTION
for(int i=0; i<m_vehicle->getNumWheels(); i++) for(int i=0; i<m_vehicle->getNumWheels(); i++)
{ {
// terrain dependent friction // terrain dependent friction
m_vehicle->getWheelInfo(i).m_frictionSlip = m_vehicle->getWheelInfo(i).m_frictionSlip = getFrictionSlip() *
m_kart_properties->getFrictionSlip() * getMaterial()->getFriction();
getMaterial()->getFriction();
} // for i<getNumWheels } // for i<getNumWheels
#endif
} // if there is terrain and it's not a reset material } // if there is terrain and it's not a reset material
doObjectInteractions(); doObjectInteractions();

View File

@ -88,7 +88,6 @@ protected:
float m_max_speed; // maximum speed of the kart, computed from float m_max_speed; // maximum speed of the kart, computed from
float m_max_speed_reverse_ratio; float m_max_speed_reverse_ratio;
float m_wheelie_angle ; float m_wheelie_angle ;
float m_current_friction; // current friction
float m_lap_start_time; // Time at start of a new lap float m_lap_start_time; // Time at start of a new lap
float m_kart_length; // length of kart float m_kart_length; // length of kart
char m_fastest_lap_message[255]; char m_fastest_lap_message[255];
@ -201,6 +200,7 @@ public:
float getWheelBase () const {return m_kart_properties->getWheelBase();} float getWheelBase () const {return m_kart_properties->getWheelBase();}
float getHeightCOG () const {return m_kart_properties->getHeightCOG();} float getHeightCOG () const {return m_kart_properties->getHeightCOG();}
float getTireGrip () const {return m_kart_properties->getTireGrip();} 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 getMaxSteerAngle () const {return m_kart_properties->getMaxSteerAngle();}
float getCornerStiffF () const {return m_kart_properties->getCornerStiffF();} float getCornerStiffF () const {return m_kart_properties->getCornerStiffF();}
float getCornerStiffR () const {return m_kart_properties->getCornerStiffR();} float getCornerStiffR () const {return m_kart_properties->getCornerStiffR();}