Removed unused post-skid-rotation property,

added post-skid-rotate-factor.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10654 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk
2012-01-12 02:20:05 +00:00
parent 46c11b9b6c
commit 18f86fff98
4 changed files with 33 additions and 23 deletions

View File

@@ -165,13 +165,16 @@
angular-velocity: Angular velocity to be used for the kart when skidding.
time-till-bonus: How long a kart needs to skid in order to get a bonus.
bonus-force: A speedup applied to the kart whick skidded for a while.
bonus-time: How long the bonus-force is applied. -->
<!-- Note: for now skidding is disabled, set angular-velocity to 2 to test it -->
bonus-time: How long the bonus-force is applied.
post-skid-rotate-factor: a factor to be used to determine how much
the chassis of a kart should rotate to match the graphical view.
A factor of 1 is identical, a smaller factor will rotate the kart
less (which might feel better). -->
<skid increase="1.05" decrease="0.95" max="2.5" time-till-max="0.4"
visual="0.16" visual-time="0"
angular-velocity="0" time-till-bonus="1.5 2"
bonus-force="100 200" bonus-time="3.0 3.0"
post-skid-rotation="1000" />
post-skid-rotate-factor="1" />
<!-- Slipstream: length: How far behind a kart slipstream works
collect-time: How many seconds of sstream give maximum benefit

View File

@@ -1793,8 +1793,8 @@ void Kart::updateSkidding(float dt)
? m_skid_time
: m_kart_properties->getSkidVisualTime();
float vso = getVisualSkidOffset();
btVector3 rot(0, vso, 0);
m_vehicle->setTimedRotation(t, rot/(3.0f*t));
btVector3 rot(0, vso*m_kart_properties->getPostSkidRotateFactor(), 0);
m_vehicle->setTimedRotation(t, rot);
m_skid_time = 0;
if(bonus_time>0)
{

View File

@@ -83,7 +83,8 @@ KartProperties::KartProperties(const std::string &filename)
m_plunger_in_face_duration[1] = m_plunger_in_face_duration[2] =
m_zipper_time = m_zipper_force = m_zipper_speed_gain =
m_zipper_max_speed_increase = m_zipper_fade_out_time =
m_time_till_max_skid = m_skid_angular_velocity = m_post_skid_rotation =
m_time_till_max_skid = m_skid_angular_velocity =
m_post_skid_rotate_factor =
m_skid_decrease = m_skid_increase = m_skid_visual = m_skid_max =
m_skid_visual_time = m_slipstream_length = m_slipstream_collect_time =
m_slipstream_use_time = m_slipstream_add_power =
@@ -294,18 +295,18 @@ void KartProperties::getAllData(const XMLNode * root)
}
if(const XMLNode *skid_node = root->getNode("skid"))
{
skid_node->get("increase", &m_skid_increase );
skid_node->get("decrease", &m_skid_decrease );
skid_node->get("max", &m_skid_max );
skid_node->get("time-till-max", &m_time_till_max_skid );
skid_node->get("visual", &m_skid_visual );
skid_node->get("visual-time", &m_skid_visual_time );
skid_node->get("enable", &m_has_skidmarks );
skid_node->get("time-till-bonus", &m_skid_time_till_bonus );
skid_node->get("bonus-force", &m_skid_bonus_force );
skid_node->get("bonus-time", &m_skid_bonus_time );
skid_node->get("angular-velocity", &m_skid_angular_velocity);
skid_node->get("post-skid-rotation",&m_post_skid_rotation );
skid_node->get("increase", &m_skid_increase );
skid_node->get("decrease", &m_skid_decrease );
skid_node->get("max", &m_skid_max );
skid_node->get("time-till-max", &m_time_till_max_skid );
skid_node->get("visual", &m_skid_visual );
skid_node->get("visual-time", &m_skid_visual_time );
skid_node->get("enable", &m_has_skidmarks );
skid_node->get("time-till-bonus", &m_skid_time_till_bonus );
skid_node->get("bonus-force", &m_skid_bonus_force );
skid_node->get("bonus-time", &m_skid_bonus_time );
skid_node->get("angular-velocity", &m_skid_angular_velocity );
skid_node->get("post-skid-rotate-factor",&m_post_skid_rotate_factor);
}
if(const XMLNode *slipstream_node = root->getNode("slipstream"))
@@ -634,7 +635,7 @@ void KartProperties::checkAllSet(const std::string &filename)
CHECK_NEG(m_skid_visual, "skid visual" );
CHECK_NEG(m_skid_visual_time, "skid visual-time" );
CHECK_NEG(m_skid_angular_velocity, "skid angular-velocity" );
CHECK_NEG(m_post_skid_rotation, "skid post-skid-rotation" );
CHECK_NEG(m_post_skid_rotate_factor, "skid post-skid-rotate-factor" );
CHECK_NEG(m_slipstream_length, "slipstream length" );
CHECK_NEG(m_slipstream_collect_time, "slipstream collect-time" );
CHECK_NEG(m_slipstream_use_time, "slipstream use-time" );

View File

@@ -302,8 +302,11 @@ private:
/** Angular velocity to be applied when skidding. */
float m_skid_angular_velocity;
/** A rotation to be applied to the rigid body when stopped skidding. */
float m_post_skid_rotation;
/** This factor is used to determine how much the chassis of a kart
* should rotate to match the graphical view. A factor of 1 is
* identical, a smaller factor will rotate the kart less (which might
* feel better). */
float m_post_skid_rotate_factor;
/** Kart leaves skid marks. */
bool m_has_skidmarks;
@@ -667,8 +670,11 @@ public:
/** Returns the angular velocity to be applied when skidding. */
float getSkidAngularVelocity () const { return m_skid_angular_velocity;}
/** Returns the rotation to be applied when stopping to skid. */
float getPostSkidRotation () const { return m_post_skid_rotation; }
/** Returns a factor to be used to determine how much the chassis of a
* kart should rotate to match the graphical view. A factor of 1 is
* identical, a smaller factor will rotate the kart less (which might
* feel better). */
float getPostSkidRotateFactor () const {return m_post_skid_rotate_factor;}
/** Returns if the kart leaves skidmarks or not. */
bool hasSkidmarks () const {return m_has_skidmarks; }