Ejemplo n.º 1
0
        public virtual void UpdatePoseFunction()
        {
            if (MicroLightManager.Instance.deviceType == TrackingDeviceType.MicroLightIR)
            {
                if (UpdatePosition)
                {
                    Vector3 position = MicroLightPlugin.Tracker.GetPosition(MicroLightManager.Instance.mTracker, serialnumber);

                    transform.localPosition = position;
                }
                if (UpdateRotation)
                {
                    Quaternion quaternion = MicroLightPlugin.Tracker.GetRotation(MicroLightManager.Instance.mTracker, serialnumber);

                    transform.localRotation = quaternion * localRotation;
                }
            }
            else if (MicroLightManager.Instance.deviceType == TrackingDeviceType.LightHouse)
            {
                TrackedDevicePose pose = MicroLightPlugin.Tracker.GetControllerPose(MicroLightManager.Instance.mTracker, (int)TrackingUniverseOrigin.TrackingUniverseStanding, serialnumber);



                if (UpdatePosition)
                {
                    Vector3 position = Calibration.GetPosition(Calibration.GetMatrix(pose.mDeviceToAbsoluteTracking));

                    transform.localPosition = position;
                }
                if (UpdateRotation)
                {
                    Quaternion quaternion = Calibration.GetRotation(Calibration.GetMatrix(pose.mDeviceToAbsoluteTracking));

                    transform.localRotation     = quaternion * localRotation;
                    transform.localEulerAngles += new Vector3(0, 180, 0);
                }
            }
        }
Ejemplo n.º 2
0
 public static extern void HmdCenterCalibration(IntPtr tracker, [MarshalAs(UnmanagedType.LPStr)] string serialnumber, Vector3 sizexz, TrackedDevicePose pose);