/// <summary> /// /// </summary> public void OnUpdate() { // If hidden,apply directly. if (id == -1) { pose.position = pose.rawPosition = position; pose.DispatchEvent(VirtualPose.EVENT_MISS_POSITION); return; } // isDirty = true; int i = 0, imax = listeners.Count; for (; i < imax; ++i) { listeners[i].OnBlobUpdate(this); } ; pose.DispatchEvent(VirtualPose.EVENT_UPDATE_POSITION); }
/// <summary> /// /// </summary> public override int Parse(byte[] buffer, int offset, int count) { // int i = 0; LibXHawkAPI.BytesToEuler(s_FloatsHelper, buffer, offset); rawEuler.Set(s_FloatsHelper[i++], s_FloatsHelper[i++], s_FloatsHelper[i++]); // m_Pose.rawEulerAngles = rawEuler; // //rawEuler=(Quaternion.Euler(rawEuler)*deviceRotation).eulerAngles; // rotation = runtimeRotation * Quaternion.Euler(rawEuler); eulerAngles = rotation.eulerAngles; // TODO --> // Just do it. m_Pose.rotation = rotation; m_Pose.DispatchEvent(VirtualPose.EVENT_UPDATE_ROTATION); return(IMU_BUFFER_SIZE); }