#include #include "vtPhysXAll.h" #include "pVTireFunction.h" pTireFunction::pTireFunction() { setToDefault(); } void pTireFunction::setToDefault() { extremumSlip = 1.0f; extremumValue = 0.02f; asymptoteSlip = 2.0f; asymptoteValue = 0.01f; stiffnessFactor = 1000000.0f; //quite stiff by default. xmlLink =0; } bool pTireFunction::isValid() const { if(!(0.0f < extremumSlip)) return false; if(!(extremumSlip < asymptoteSlip)) return false; if(!(0.0f < extremumValue)) return false; if(!(0.0f < asymptoteValue)) return false; if(!(0.0f <= stiffnessFactor)) return false; return true; } float pTireFunction::hermiteEval(float t) const { // This fix for TTP 3429 & 3675 is from Sega. // Assume blending functions (look these up in a graph): // H0(t) = 2ttt - 3tt + 1 // H1(t) = -2ttt + 3tt // H2(t) = ttt - 2tt + t // H3(t) = ttt - tt float v = NxMath::abs(t); float s = (t>=0) ? 1.0f : -1.0f; float F; if(v