public virtual void OnNewPoses()
    {
        UpdateRenderModel();

        if (isActiveAndEnabled && m_applyTracking)
        {
            var deviceIndex = GetCurrentDeviceIndex();
            if (VivePose.IsValid(deviceIndex))
            {
                TrackPose(VivePose.GetPose(deviceIndex), m_origin);
            }
        }
    }
    private uint GetCurrentDeviceIndex()
    {
        uint result;

        switch (m_mode)
        {
        case Mode.ViveRole:
            result = m_viveRole.GetDeviceIndex();
            break;

        case Mode.DeivceIndex:
            result = (uint)m_deviceIndex;
            break;

        case Mode.Disable:
        default:
            return(ViveRole.INVALID_DEVICE_INDEX);
        }

        return(VivePose.IsValid(result) ? result : ViveRole.INVALID_DEVICE_INDEX);
    }