I have been following the space shooter tutorial and am confused with how the accelerometer calibration works . These are the 2 functions that was used
void CalibrateAccelerometer()
{
Vector3 accelerationSnapShot = Input.acceleration;
Quaternion rotateQuaternion = Quaternion.FromToRotation(new Vector3(0.0f, 0.0f, -1.0f), accelerationSnapShot);
calibrationQuaternion = Quaternion.Inverse(rotateQuaternion);
}
Vector3 FixAccleeration(Vector3 acceleration)
{
Vector3 fixedAcceleration = calibrationQuaternion * acceleration;
return fixedAcceleration
}
I am not able to understand how the accelerometer is calibrated with the above code .