Skip to main content

Class HandlebarCalibration

Aligns the real handlebar with the virtual one by moving the XR Origin. Hold throttle and brake together for holdDuration seconds with both hands on the handlebar grips; the origin is then moved so the tracked hands sit on the virtual grips.

public class HandlebarCalibration : MonoBehaviour

Inheritance​

Fields​

onCalibrated​

public UnityEvent onCalibrated

Field Value​

UnityEvent

onCalibrationFailed​

public UnityEvent<string> onCalibrationFailed

Field Value​

UnityEvent<string>

onHoldProgress​

[Header("EVENTS")]
public UnityEvent<float> onHoldProgress

Field Value​

UnityEvent<float>

Methods​

Calibrate()​

Moves the XR Origin so the tracked hands land on the virtual grips. Only yaw (around the pivot's up axis) and position are corrected; the headset already tracks pitch and roll.

public void Calibrate()

ResetCalibration()​

Clears the stored calibration and puts the XR Origin back on the pivot.

public void ResetCalibration()
  • Fields
    • onCalibrated
    • onCalibrationFailed
    • onHoldProgress
  • Methods
    • Calibrate()
    • ResetCalibration()