Enabled jumping again, and implemented some test jumping in bullet.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1256 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2007-09-23 14:52:39 +00:00
parent 385e042cb3
commit e41829cedd
2 changed files with 9 additions and 8 deletions

View File

@ -959,9 +959,16 @@ void Kart::updatePhysics (float dt)
m_vehicle->applyEngineForce(-m_controls.accel*engine_power*0.1f, 3);
}
}
if(m_controls.jump)
{ // ignore gravity down when jumping
// no jumping yet
{
//Vector3 impulse(0.0f, 0.0f, 10.0f);
// getVehicle()->getRigidBody()->applyCentralImpulse(impulse);
btVector3 velocity = m_kart_body->getLinearVelocity();
velocity.setZ( 3.0f );
getVehicle()->getRigidBody()->setLinearVelocity( velocity );
}
const float steering = getMaxSteerAngle() * m_controls.lr * 0.00444;
m_vehicle->setSteeringValue(steering, 0);
@ -1117,11 +1124,7 @@ void Kart::updatePhysics (float dt)
}
if(m_controls.jump)
{ // ignore gravity down when jumping
#ifdef ENABLE_JUMPING
ForceGravity = stk_config->m_jump_impulse*WORLD_GRAVITY;
#else
ForceGravity = -WORLD_GRAVITY * MASS;
#endif
}
else
{ // kart is on groud and not jumping

View File

@ -71,9 +71,7 @@ void PlayerKart::action(KartActions action, int value)
m_camera->setReverseHeading(value);
break;
case KC_JUMP:
#ifdef ENABLE_JUMPING
m_controls.jump = value;
#endif
break;
}
}