Gets the rotation of the device around its z axis (into the screen). For example when you steer with the iPhone in a driving game.
Base Orientation
How the user is expected to hold the device (where angle will be zero).
Store Angle
Store the roll angle in a Float Variable.
Limit Angle
Limit the roll angle.
Smoothing
Smooth the roll angle as it changes. You can play with this value to balance responsiveness and lag/smoothness.
Every Frame
Repeat every frame.