Made the skidding frame rate independent.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2784 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
a74923349a
commit
77914fcf05
@ -74,6 +74,7 @@
|
||||
;; in each frame.
|
||||
(skid-max 2.5 ) ;; Maximum skidding factor = maximum increase
|
||||
;; of steering angle.
|
||||
(time-till-max-skid 0.4 ) ;; Time till maximum skidding is reached.
|
||||
(skid-visual 0.16) ;; Additional graphical rotation of kart.
|
||||
|
||||
;; Bullet physics attributes
|
||||
|
@ -721,7 +721,8 @@ void Kart::updatePhysics (float dt)
|
||||
//apply the brakes
|
||||
for(int i=0; i<4; i++) m_vehicle->setBrake(getBrakeFactor() * 4.0f, i);
|
||||
m_skidding*= 1.08f;//skid a little when the brakes are hit (just enough to make the skiding sound)
|
||||
if(m_skidding>2.0f) m_skidding=2.0f;
|
||||
if(m_skidding>m_kart_properties->getMaxSkid())
|
||||
m_skidding=m_kart_properties->getMaxSkid();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -769,7 +770,8 @@ void Kart::updatePhysics (float dt)
|
||||
#endif
|
||||
if(m_controls.m_drift)
|
||||
{
|
||||
m_skidding*= m_kart_properties->getSkidIncrease();
|
||||
m_skidding += m_kart_properties->getSkidIncrease()
|
||||
*dt/m_kart_properties->getTimeTillMaxSkid();
|
||||
if(m_skidding>m_kart_properties->getMaxSkid())
|
||||
m_skidding=m_kart_properties->getMaxSkid();
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ KartProperties::KartProperties() : m_icon_material(0)
|
||||
m_track_connection_accel = m_min_speed_turn = m_angle_at_min =
|
||||
m_max_speed_turn = m_angle_at_max =
|
||||
m_rubber_band_max_length = m_rubber_band_force =
|
||||
m_rubber_band_duration =
|
||||
m_rubber_band_duration = m_time_till_max_skid =
|
||||
m_skid_decrease = m_skid_increase = m_skid_visual = m_skid_max =
|
||||
m_camera_max_accel = m_camera_max_brake =
|
||||
m_camera_distance = UNDEFINED;
|
||||
@ -253,6 +253,7 @@ void KartProperties::getAllData(const lisp::Lisp* lisp)
|
||||
|
||||
lisp->get("skid-increase", m_skid_increase );
|
||||
lisp->get("skid-decrease", m_skid_decrease );
|
||||
lisp->get("time-till-max-skid", m_time_till_max_skid );
|
||||
lisp->get("skid-max", m_skid_max );
|
||||
lisp->get("skid-visual", m_skid_visual );
|
||||
|
||||
@ -339,6 +340,7 @@ void KartProperties::checkAllSet(const std::string &filename)
|
||||
CHECK_NEG(m_rubber_band_force, "rubber-band-force" );
|
||||
CHECK_NEG(m_rubber_band_duration, "rubber-band-duration" );
|
||||
CHECK_NEG(m_skid_decrease, "skid-decrease" );
|
||||
CHECK_NEG(m_time_till_max_skid, "time-till-max-skid" );
|
||||
CHECK_NEG(m_skid_increase, "skid-increase" );
|
||||
CHECK_NEG(m_skid_max, "skid-max" );
|
||||
CHECK_NEG(m_skid_visual, "skid-visual" );
|
||||
|
@ -136,6 +136,8 @@ protected:
|
||||
* m_skid_increase. */
|
||||
float m_skid_decrease; /**< Skidding is multiplied by this when
|
||||
* not skidding to decrease to 1.0. */
|
||||
float m_time_till_max_skid; /**< Time till maximum skidding is
|
||||
* reached. */
|
||||
// Camera related setting
|
||||
// ----------------------
|
||||
float m_camera_max_accel; // maximum acceleration of camera
|
||||
@ -218,6 +220,9 @@ public:
|
||||
/** Returns the factor by which m_skidding is multiplied when the kart is
|
||||
* not skidding to decrease it back to 1.0f . */
|
||||
float getSkidDecrease () const {return m_skid_decrease; }
|
||||
/** Returns the time (in seconds) of drifting till the maximum skidding
|
||||
* is reached. */
|
||||
float getTimeTillMaxSkid () const {return m_time_till_max_skid; }
|
||||
const std::vector<float>&
|
||||
getGearSwitchRatio () const {return m_gear_switch_ratio; }
|
||||
const std::vector<float>&
|
||||
|
Loading…
Reference in New Issue
Block a user