示例#1
0
        private void RefreshCamera()
        {
            CardboardLensDistortion.RetrieveEyeMeshes();
            CardboardLensDistortion.RefreshProjectionMatrix();

            Matrix4x4 leftMatrix = CardboardLensDistortion.GetProjectionMatrix(CardboardEye.kLeft);

            if (!leftMatrix.Equals(Matrix4x4.zero))
            {
                leftCam.projectionMatrix = leftMatrix;
            }
            Matrix4x4 rightMatrix = CardboardLensDistortion.GetProjectionMatrix(CardboardEye.kRight);

            if (!rightMatrix.Equals(Matrix4x4.zero))
            {
                rightCam.projectionMatrix = rightMatrix;
            }

            (CardboardMesh, CardboardMesh)eyeMeshes = CardboardLensDistortion.GetEyeMeshes();
            CardboardDistortionRenderer.SetEyeMeshes(eyeMeshes.Item1, eyeMeshes.Item2);
            CardboardManager.SetEyeMesh(
                CardboardUtility.ConvertCardboardMesh_Triangle(eyeMeshes.Item1),
                CardboardUtility.ConvertCardboardMesh_Triangle(eyeMeshes.Item2));
            testEyeMeshLeft.mesh  = CardboardManager.viewMeshLeft;
            testEyeMeshRight.mesh = CardboardManager.viewMeshRight;

            NativeDataExtract.Save_MeshJson(eyeMeshes.Item1);
            NativeDataExtract.Save_MeshJson(eyeMeshes.Item2);
        }
示例#2
0
        private void RefreshCameraProperty()
        {
            testEyeMeshLeft.mesh  = CardboardManager.viewMeshLeft;
            testEyeMeshRight.mesh = CardboardManager.viewMeshRight;

            if (!Application.isEditor)
            {
                NativeDataExtract.Save_MeshJson(CardboardManager.viewMeshLeftRaw);
                NativeDataExtract.Save_MeshJson(CardboardManager.viewMeshRightRaw);
            }

            // (byte[], int) paramDetailVar = CardboardQrCode.GetDeviceParamsByte();
            // NativeDataExtract.Save_EncodedParam(paramDetailVar.Item1, paramDetailVar.Item2);
        }