Test to see if the physics work better.

This commit is contained in:
hiker 2014-08-16 09:44:00 +10:00
parent af33992691
commit 6d5651f357
2 changed files with 21 additions and 5 deletions

View File

@ -606,10 +606,26 @@ void Kart::createPhysics()
if (y == -1)
{
int index = (x + 1) / 2 + 1 - z; // get index of wheel
float f = getKartProperties()->getPhysicalWheelPosition();
wheel_pos[index] = p*(orig_factor*(1.0f-f) + bevel_factor*f);
wheel_pos[index].setY(0);
} // if z==-1
if(true)
{
const Vec3 cs = getKartProperties()->getGravityCenterShift();
wheel_pos[index].setX(x*0.5f*getKartWidth()+cs.getX());
float radius = getKartProperties()->getWheelRadius();
// Set the connection point so that a maximum compressed wheel
// (susp. length=0) will still poke a little bit out under the
// kart
wheel_pos[index].setY(radius - 0.05f);
wheel_pos[index].setZ((0.5f*getKartLength() - radius)* z
+ cs.getZ());
}
else
{
float f = getKartProperties()->getPhysicalWheelPosition();
wheel_pos[index] = p*(orig_factor*(1.0f - f) + bevel_factor*f);
wheel_pos[index].setY(0);
}
} // if y==-1
} // for x
} // for z
} // for y

View File

@ -273,7 +273,7 @@ void KartProperties::load(const std::string &filename, const std::string &node)
}
//FIXME: magix 0.25 factor to keep it compatible with previous tourning
m_wheel_base = fabsf( m_kart_model->getLength()-0.25f);
m_wheel_base = fabsf( m_kart_model->getLength() - (true ? 0 : -0.25f));
// Now convert the turn radius into turn angle:
for(unsigned int i=0; i<m_turn_angle_at_speed.size(); i++)