Get Head Rotation

Actions to get head rotation

public void OnHeadRotation(Quaternion quaternion)

ParameterDescription

Quaternion

Rotation of head in world coordinate system

Action gives the updated head rotation.

Action will be called only when it’s subscribed to a method. Action must be subscribed to the method with a matching signature.

using JMRSDK;
using UnityEngine;

public class TrackingHeadRotationExample : MonoBehaviour
{
    void OnEnable()
    {
        // subscribing to the action
        JMRTrackerManager.OnHeadRotation += onHeadRotationLocal;
    }
    void OnDisable()
    {
        // unsubscribing to the action
        JMRTrackerManager.OnHeadRotation -= onHeadRotationLocal;
    }
    //this action will be called per frame automatically
    // get rotation when rotation updating
    public void onHeadRotationLocal(Quaternion rotation)
    {
        Quaternion Rot = rotation;
    }
}