Fix little issues and remove wheel position from characteristics
This commit is contained in:
parent
acbc629610
commit
1c29ce7636
@ -34,7 +34,7 @@
|
||||
http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&t=7369\&p=25236&hilit=vehicle#p25236
|
||||
for details.
|
||||
max-force: Maximum suspension force -->
|
||||
<suspension stiffness="140" rest="0.3" travel-cm="29"
|
||||
<suspension stiffness="140" rest="0.3" travel="29"
|
||||
exp-spring-response="false" max-force="12000" />
|
||||
|
||||
<!-- Values related to stability of the chassis: damping, and reduced
|
||||
|
@ -54,7 +54,7 @@ AbstractCharacteristic::ValueType AbstractCharacteristic::getType(Characteristic
|
||||
return TYPE_FLOAT;
|
||||
case SUSPENSION_REST:
|
||||
return TYPE_FLOAT;
|
||||
case SUSPENSION_TRAVEL_CM:
|
||||
case SUSPENSION_TRAVEL:
|
||||
return TYPE_FLOAT;
|
||||
case SUSPENSION_EXP_SPRING_RESPONSE:
|
||||
return TYPE_BOOL;
|
||||
@ -98,10 +98,6 @@ AbstractCharacteristic::ValueType AbstractCharacteristic::getType(Characteristic
|
||||
return TYPE_FLOAT;
|
||||
case WHEELS_DAMPING_COMPRESSION:
|
||||
return TYPE_FLOAT;
|
||||
case WHEELS_RADIUS:
|
||||
return TYPE_FLOAT;
|
||||
case WHEELS_POSITION:
|
||||
return TYPE_FLOAT_VECTOR;
|
||||
case CAMERA_DISTANCE:
|
||||
return TYPE_FLOAT;
|
||||
case CAMERA_FORWARD_UP_ANGLE:
|
||||
@ -222,7 +218,8 @@ AbstractCharacteristic::ValueType AbstractCharacteristic::getType(Characteristic
|
||||
return TYPE_FLOAT;
|
||||
case SLIPSTREAM_FADE_OUT_TIME:
|
||||
return TYPE_FLOAT;
|
||||
/* <characteristics-start getProp1> */
|
||||
|
||||
/* <characteristics-end getProp1> */
|
||||
}
|
||||
Log::fatal("AbstractCharacteristic::getType", "Unknown type");
|
||||
return TYPE_FLOAT;
|
||||
@ -287,8 +284,6 @@ std::string AbstractCharacteristic::getName(CharacteristicType type)
|
||||
return "WHEELS_DAMPING_RELAXATION";
|
||||
case WHEELS_DAMPING_COMPRESSION:
|
||||
return "WHEELS_DAMPING_COMPRESSION";
|
||||
case WHEELS_POSITION:
|
||||
return "WHEELS_POSITION";
|
||||
case CAMERA_DISTANCE:
|
||||
return "CAMERA_DISTANCE";
|
||||
case CAMERA_FORWARD_UP_ANGLE:
|
||||
@ -661,16 +656,6 @@ float AbstractCharacteristic::getWheelsDampingCompression() const
|
||||
return result;
|
||||
}
|
||||
|
||||
std::vector<float> AbstractCharacteristic::getWheelsPosition() const
|
||||
{
|
||||
std::vector<float> result;
|
||||
bool is_set = false;
|
||||
process(WHEELS_POSITION, &result, &is_set);
|
||||
if (!is_set)
|
||||
Log::fatal("AbstractCharacteristic", "Can't get characteristic %s", getName(WHEELS_POSITION).c_str());
|
||||
return result;
|
||||
}
|
||||
|
||||
float AbstractCharacteristic::getCameraDistance() const
|
||||
{
|
||||
float result;
|
||||
|
@ -109,7 +109,6 @@ public:
|
||||
// Wheels
|
||||
WHEELS_DAMPING_RELAXATION,
|
||||
WHEELS_DAMPING_COMPRESSION,
|
||||
WHEELS_POSITION,
|
||||
|
||||
// Camera
|
||||
CAMERA_DISTANCE,
|
||||
@ -270,7 +269,6 @@ public:
|
||||
|
||||
float getWheelsDampingRelaxation() const;
|
||||
float getWheelsDampingCompression() const;
|
||||
std::vector<float> getWheelsPosition() const;
|
||||
|
||||
float getCameraDistance() const;
|
||||
float getCameraForwardUpAngle() const;
|
||||
|
@ -673,7 +673,7 @@ void Kart::createPhysics()
|
||||
|
||||
btKart::btVehicleTuning tuning;
|
||||
tuning.m_maxSuspensionTravel =
|
||||
m_characteristic->getSuspensionTravelCm();
|
||||
m_characteristic->getSuspensionTravel();
|
||||
tuning.m_maxSuspensionForce =
|
||||
m_characteristic->getSuspensionMaxForce();
|
||||
|
||||
@ -2138,11 +2138,11 @@ void Kart::updatePhysics(float dt)
|
||||
// Only apply if near ground instead of purely based on speed avoiding
|
||||
// the "parachute on top" look.
|
||||
const Vec3 &v = m_body->getLinearVelocity();
|
||||
if(/*isNearGround() &&*/ v.getY() < - m_characteristic->getSuspensionTravelCm()*0.01f*60)
|
||||
if(/*isNearGround() &&*/ v.getY() < - m_characteristic->getSuspensionTravel() * 0.01f * 60)
|
||||
{
|
||||
Vec3 v_clamped = v;
|
||||
// clamp the speed to 99% of the maxium falling speed.
|
||||
v_clamped.setY(-m_characteristic->getSuspensionTravelCm()*0.01f*60 * 0.99f);
|
||||
v_clamped.setY(-m_characteristic->getSuspensionTravel() * 0.01f * 60 * 0.99f);
|
||||
//m_body->setLinearVelocity(v_clamped);
|
||||
}
|
||||
|
||||
|
@ -342,7 +342,6 @@ void XmlCharacteristic::load(const XMLNode *node)
|
||||
{
|
||||
sub_node->get("damping-relaxation", &m_values[WHEELS_DAMPING_RELAXATION]);
|
||||
sub_node->get("damping-compression", &m_values[WHEELS_DAMPING_COMPRESSION]);
|
||||
sub_node->get("position", &m_values[WHEELS_POSITION]);
|
||||
}
|
||||
|
||||
if (const XMLNode *sub_node = node->getNode("camera"))
|
||||
|
@ -30,7 +30,7 @@ Turn: radius(InterpolationArray), timeResetSteer, timeFullSteer(InterpolationArr
|
||||
Engine: power, maxSpeed, brakeFactor, brakeTimeIncrease, maxSpeedReverseRatio
|
||||
Gear: switchRatio(std::vector<float>/floatVector), powerIncrease(std::vector<float>/floatVector)
|
||||
Mass
|
||||
Wheels: dampingRelaxation, dampingCompression, position(std::vector<float>/floatVector)
|
||||
Wheels: dampingRelaxation, dampingCompression
|
||||
Camera: distance, forwardUpAngle, backwardUpAngle
|
||||
Jump: animationTime
|
||||
Lean: max, speed
|
||||
|
Loading…
x
Reference in New Issue
Block a user