them more accurately.
// First off, make sure that the gear "tip" is below the ground.
// If it's not, there's no force.
float a = ground[3] - Math::dot3(_pos, ground);
+ _compressDist = -a;
if(a > 0) {
_wow = 0;
_frac = 0;
+ _compressDist = 0;
_rollSpeed = 0;
_casterAngle = 0;
return;
void getForce(float* force, float* contact);
float getWoW();
float getCompressFraction();
+ float getCompressDist() { return _compressDist; }
private:
float calcFriction(float wgt, float v);
float _contact[3];
float _wow;
float _frac;
+ float _compressDist;
double _global_ground[4];
float _global_vel[3];
float _casterAngle;
node->setBoolValue("has-brake", g->getBrake() != 0);
node->setBoolValue("wow", g->getCompressFraction() != 0);
node->setFloatValue("compression-norm", g->getCompressFraction());
+ node->setFloatValue("compression-m", g->getCompressDist());
node->setFloatValue("caster-angle-deg", g->getCasterAngle() * RAD2DEG);
node->setFloatValue("rollspeed-ms", g->getRollSpeed());
}