private void update ( float deltaTime ) { float vel = mAngularVelocity ; float velSqr = vel * vel ; if ( vel > 0f ) { //TODO the damping is not based on time mAngularVelocity -= velSqr * VELOCITY_FRICTION_COEFFICIENT + CONSTANT_FRICTION_COEFFICIENT ; if ( mAngularVelocity < 0f ) mAngularVelocity = 0f ; } else if ( vel < 0f ) { mAngularVelocity -= velSqr * - VELOCITY_FRICTION_COEFFICIENT - CONSTANT_FRICTION_COEFFICIENT ; if ( mAngularVelocity > 0f ) mAngularVelocity = 0f ; } if ( mAngularVelocity != 0f ) { addAngle ( mAngularVelocity * deltaTime ) ; } else { mRequiresUpdate = false ; } }
Estimates the wheel s new angle and angular velocity