Remove SKID_OLD code
This commit is contained in:
parent
d2ca7d11d7
commit
84e3b9dbe9
@ -67,7 +67,7 @@ Skidding::~Skidding()
|
|||||||
void Skidding::reset()
|
void Skidding::reset()
|
||||||
{
|
{
|
||||||
m_skid_time = 0.0f;
|
m_skid_time = 0.0f;
|
||||||
m_skid_state = m_skid_visual_time<=0 ? SKID_OLD : SKID_NONE;
|
m_skid_state = SKID_NONE;
|
||||||
m_skid_factor = 1.0f;
|
m_skid_factor = 1.0f;
|
||||||
m_real_steering = 0.0f;
|
m_real_steering = 0.0f;
|
||||||
m_visual_rotation = 0.0f;
|
m_visual_rotation = 0.0f;
|
||||||
@ -95,20 +95,8 @@ void Skidding::reset()
|
|||||||
*/
|
*/
|
||||||
void Skidding::updateSteering(float steer, float dt)
|
void Skidding::updateSteering(float steer, float dt)
|
||||||
{
|
{
|
||||||
if(m_skid_state==SKID_OLD)
|
|
||||||
{
|
|
||||||
float speed = m_kart->getSpeed();
|
|
||||||
float current_max_speed = m_kart->getCurrentMaxSpeed();
|
|
||||||
float speed_ratio = speed / current_max_speed;
|
|
||||||
m_real_steering = steer * m_skid_factor;
|
|
||||||
m_visual_rotation = m_real_steering /m_skid_max * speed_ratio;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Now only new skidding is happening
|
|
||||||
switch(m_skid_state)
|
switch(m_skid_state)
|
||||||
{
|
{
|
||||||
case SKID_OLD: assert(false);
|
|
||||||
break;
|
|
||||||
case SKID_SHOW_GFX_LEFT:
|
case SKID_SHOW_GFX_LEFT:
|
||||||
case SKID_SHOW_GFX_RIGHT:
|
case SKID_SHOW_GFX_RIGHT:
|
||||||
case SKID_NONE:
|
case SKID_NONE:
|
||||||
@ -178,7 +166,6 @@ float Skidding::getSteeringWhenSkidding(float steering) const
|
|||||||
{
|
{
|
||||||
switch(m_skid_state)
|
switch(m_skid_state)
|
||||||
{
|
{
|
||||||
case SKID_OLD: assert(false); break;
|
|
||||||
case SKID_SHOW_GFX_LEFT:
|
case SKID_SHOW_GFX_LEFT:
|
||||||
case SKID_SHOW_GFX_RIGHT:
|
case SKID_SHOW_GFX_RIGHT:
|
||||||
case SKID_BREAK:
|
case SKID_BREAK:
|
||||||
@ -257,13 +244,6 @@ void Skidding::update(float dt, bool is_on_ground,
|
|||||||
else
|
else
|
||||||
if(m_skid_factor<1.0f) m_skid_factor = 1.0f;
|
if(m_skid_factor<1.0f) m_skid_factor = 1.0f;
|
||||||
|
|
||||||
// FIXME hiker: remove once the new skidding code is finished.
|
|
||||||
if(m_skid_state == SKID_OLD)
|
|
||||||
{
|
|
||||||
updateSteering(steering, dt);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If skidding was started and a graphical jump should still
|
// If skidding was started and a graphical jump should still
|
||||||
// be displayed, update the data
|
// be displayed, update the data
|
||||||
if(m_remaining_jump_time>0)
|
if(m_remaining_jump_time>0)
|
||||||
@ -456,8 +436,6 @@ void Skidding::update(float dt, bool is_on_ground,
|
|||||||
m_kart->getKartGFX()->updateSkidLight(0);
|
m_kart->getKartGFX()->updateSkidLight(0);
|
||||||
m_skid_state = SKID_NONE;
|
m_skid_state = SKID_NONE;
|
||||||
}
|
}
|
||||||
case SKID_OLD:
|
|
||||||
break;
|
|
||||||
} // switch
|
} // switch
|
||||||
updateSteering(steering, dt);
|
updateSteering(steering, dt);
|
||||||
} // update
|
} // update
|
||||||
|
@ -74,7 +74,6 @@ private:
|
|||||||
float m_jump_speed;
|
float m_jump_speed;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** SKID_OLD: old skidding, will be removed. */
|
|
||||||
/** SKID_NONE: Kart is currently not skidding.
|
/** SKID_NONE: Kart is currently not skidding.
|
||||||
* SKID_ACCUMULATE_LEFT: Kart is skidding to the left and accumulating
|
* SKID_ACCUMULATE_LEFT: Kart is skidding to the left and accumulating
|
||||||
* for bonus.
|
* for bonus.
|
||||||
@ -83,9 +82,8 @@ public:
|
|||||||
* and the kart was turning left.
|
* and the kart was turning left.
|
||||||
* SKID_SHOW_GFX_RIGHT: Similar for turning right.
|
* SKID_SHOW_GFX_RIGHT: Similar for turning right.
|
||||||
* SKID_BREAK: Skidding was stopped without bonus */
|
* SKID_BREAK: Skidding was stopped without bonus */
|
||||||
enum SkidState {SKID_OLD, SKID_NONE, SKID_ACCUMULATE_LEFT,
|
enum SkidState { SKID_NONE, SKID_ACCUMULATE_LEFT, SKID_ACCUMULATE_RIGHT,
|
||||||
SKID_ACCUMULATE_RIGHT, SKID_SHOW_GFX_LEFT,
|
SKID_SHOW_GFX_LEFT, SKID_SHOW_GFX_RIGHT, SKID_BREAK} ;
|
||||||
SKID_SHOW_GFX_RIGHT, SKID_BREAK} ;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** The current skidding state. */
|
/** The current skidding state. */
|
||||||
|
Loading…
Reference in New Issue
Block a user