
11.2 Using the Physics Engine 239
* range give undefined results.
*/
void setControl(real value);
/**
* Applies the force to the given rigid body.
*/
virtual void updateForce(RigidBody *body, real duration);
};
Excerpt from file src/fgen.cpp
Matrix3 AeroControl::getTensor()
{
if (controlSetting <= -1.0f) return minTensor;
else if (controlSetting >= 1.0f) return maxTensor;
else if (controlSetting < 0)
{
return Matrix3::linearInterpolate(minTensor,
tensor,
controlSetting+1.0f);
}
else if (controlSetting > 0)
{
return Matrix3::linearInterpolate(tensor,
maxTensor,
controlSetting);
}
else return tensor;
}
void AeroControl::updateForce(RigidBody *body, real duration)
{
Matrix3 ...