Make z-offset after rescue a configurable parameter (z-rescue-offset)
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3888 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
329124a3ba
commit
779003befe
@ -140,6 +140,9 @@
|
||||
;; and will be in the air longer
|
||||
(jump-velocity 3.0 )
|
||||
|
||||
;; z-axis offset when kart is being put back on track after being rescued
|
||||
(z-rescue-offset 0.0 ) ;; fraction of kart height
|
||||
|
||||
;; The following two vectors define at what ratio of the maximum speed what
|
||||
;; gear is selected, e.g. 0.25 means: if speed <=0.25*maxSpeed --> gear 1,
|
||||
;; 0.5 means: if speed <=0.5 *maxSpeed --> gear 2
|
||||
|
@ -57,7 +57,8 @@ KartProperties::KartProperties() : m_icon_material(0)
|
||||
m_wheel_damping_compression = m_friction_slip = m_roll_influence =
|
||||
m_wheel_radius = m_chassis_linear_damping =
|
||||
m_chassis_angular_damping = m_suspension_rest =
|
||||
m_max_speed_reverse_ratio = m_jump_velocity = m_upright_tolerance =
|
||||
m_max_speed_reverse_ratio = m_jump_velocity =
|
||||
m_z_rescue_offset = m_upright_tolerance =
|
||||
m_upright_max_force = m_suspension_travel_cm =
|
||||
m_track_connection_accel = m_min_speed_turn = m_angle_at_min =
|
||||
m_max_speed_turn = m_angle_at_max =
|
||||
@ -248,6 +249,7 @@ void KartProperties::getAllData(const lisp::Lisp* lisp)
|
||||
lisp->get("suspension-rest", m_suspension_rest );
|
||||
lisp->get("suspension-travel-cm", m_suspension_travel_cm );
|
||||
lisp->get("jump-velocity", m_jump_velocity );
|
||||
lisp->get("z-rescue-offset", m_z_rescue_offset );
|
||||
lisp->get("upright-tolerance", m_upright_tolerance );
|
||||
lisp->get("upright-max-force", m_upright_max_force );
|
||||
lisp->get("track-connection-accel", m_track_connection_accel );
|
||||
@ -341,6 +343,7 @@ void KartProperties::checkAllSet(const std::string &filename)
|
||||
CHECK_NEG(m_suspension_rest, "suspension-rest" );
|
||||
CHECK_NEG(m_suspension_travel_cm, "suspension-travel-cm" );
|
||||
CHECK_NEG(m_jump_velocity, "jump-velocity" );
|
||||
CHECK_NEG(m_z_rescue_offset, "z-rescue-offset" );
|
||||
CHECK_NEG(m_upright_tolerance, "upright-tolerance" );
|
||||
CHECK_NEG(m_upright_max_force, "upright-max-force" );
|
||||
CHECK_NEG(m_track_connection_accel, "track-connection-accel" );
|
||||
|
@ -121,6 +121,7 @@ private:
|
||||
float m_suspension_rest;
|
||||
float m_suspension_travel_cm;
|
||||
float m_jump_velocity; // z velocity set when jumping
|
||||
float m_z_rescue_offset; // z offset after rescue
|
||||
float m_upright_tolerance;
|
||||
float m_upright_max_force;
|
||||
|
||||
@ -211,6 +212,7 @@ public:
|
||||
float getSuspensionRest () const {return m_suspension_rest; }
|
||||
float getSuspensionTravelCM () const {return m_suspension_travel_cm; }
|
||||
float getJumpVelocity () const {return m_jump_velocity; }
|
||||
float getZRescueOffset () const {return m_z_rescue_offset; }
|
||||
float getUprightTolerance () const {return m_upright_tolerance; }
|
||||
float getUprightMaxForce () const {return m_upright_max_force; }
|
||||
float getTrackConnectionAccel () const {return m_track_connection_accel; }
|
||||
|
@ -497,11 +497,10 @@ void LinearWorld::moveKartAfterRescue(Kart* kart, btRigidBody* body)
|
||||
|
||||
if (kart_over_ground)
|
||||
{
|
||||
//add vertical offset so that the kart starts off above track
|
||||
|
||||
//TODO - offset needs to be a configurable parameter
|
||||
//float vertical_offset = 0.5f * kart->getKartHeight();
|
||||
//body->translate(btVector3(0, 0, vertical_offset));
|
||||
//add vertical offset so that the kart starts off above the track
|
||||
float vertical_offset = kart->getKartProperties()->getZRescueOffset() *
|
||||
kart->getKartHeight();
|
||||
body->translate(btVector3(0, 0, vertical_offset));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user