Ejemplo n.º 1
0
        public void RefreshIPD()
        {
            if (!isConfigured)
            {
                return;
            }
            Vector3 lPos = leftEyeIPDTransform.localPosition;
            Vector3 rPos = rightEyeIPDTransform.localPosition;

            lPos.x = -ipd / 2f; rPos.x = ipd / 2f;
            lPos.y = heightOffset; rPos.y = heightOffset;
            lPos.z = depthOffset; rPos.z = depthOffset;
            leftEyeIPDTransform.localPosition  = lPos;
            rightEyeIPDTransform.localPosition = rPos;

            leapTransform.localEulerAngles = new Vector3(pitchOffset, yawOffset, 0f);

            //if (Application.isPlaying) {
            //  leftScreenTransform.localPosition = startingScreenLeft + (leftScreenTransform.localRotation * Vector3.forward) * screenForwardOffset;
            //  rightScreenTransform.localPosition = startingScreenRight + (rightScreenTransform.localRotation * Vector3.forward) * screenForwardOffset;
            //}

            OpticalCalibrationManager manager = GetComponent <OpticalCalibrationManager>();

            if (manager != null)
            {
                manager.currentCalibration.leftEye.eyePosition  = lPos;
                manager.currentCalibration.rightEye.eyePosition = rPos;
                manager.UpdateCalibrationFromObjects();
            }

            leftEyeARRaytracer.ScheduleCreateDistortionMesh();
            rightEyeARRaytracer.ScheduleCreateDistortionMesh();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Loads the calibration from the positions of the objects in the scene and
 /// updates the calibration struct.
 /// </summary>
 public void UpdateCalibrationFromObjects(bool onlyOneEye = false, bool updateLeftEye = true)
 {
     currentCalibration.leapTracker = new PhysicalComponent(
         provider.deviceOrigin.ToLocalPose(), provider.gameObject.name);
     if (!onlyOneEye || (onlyOneEye && updateLeftEye))
     {
         currentCalibration.leftEye = constructLeftEyeOptics();
         leftEye.ScheduleCreateDistortionMesh(true);
     }
     if (!onlyOneEye || (onlyOneEye && !updateLeftEye))
     {
         currentCalibration.rightEye = constructRightEyeOptics();
         rightEye.ScheduleCreateDistortionMesh(true);
     }
 }