private static void InitDeviceProfile() { (IntPtr, int)par = CardboardQrCode.GetDeviceParamsPointer(); if (par.Item2 == 0 && !Application.isEditor) { isProfileAvailable = false; LoadDefaultProfile(); par = CardboardQrCode.GetDeviceParamsPointer(); } // if (par.Item2 == 0 && !Application.isEditor) // { // CardboardQrCode.RetrieveCardboardDeviceV1Params(); // par = CardboardQrCode.GetDeviceParamsPointer(); // } if (par.Item2 > 0 || Application.isEditor) { deviceParameter = CardboardQrCode.GetDecodedDeviceParams(); //todo do we need to destroy it before create it? CardboardLensDistortion.CreateLensDistortion(par.Item1, par.Item2); isProfileAvailable = true; } }
private static void InitCameraProperties() { if (!isProfileAvailable) { return; } CardboardLensDistortion.RetrieveEyeMeshes(); CardboardLensDistortion.RefreshProjectionMatrix(); projectionMatrixLeft = CardboardLensDistortion.GetProjectionMatrix(CardboardEye.kLeft); projectionMatrixRight = CardboardLensDistortion.GetProjectionMatrix(CardboardEye.kRight); eyeFromHeadMatrixLeft = CardboardLensDistortion.GetEyeFromHeadMatrix(CardboardEye.kLeft); eyeFromHeadMatrixRight = CardboardLensDistortion.GetEyeFromHeadMatrix(CardboardEye.kRight); (CardboardMesh, CardboardMesh)eyeMeshes = CardboardLensDistortion.GetEyeMeshes(); viewMeshLeftRaw = eyeMeshes.Item1; viewMeshRightRaw = eyeMeshes.Item2; viewMeshLeft = CardboardUtility.ConvertCardboardMesh_Triangle(eyeMeshes.Item1); viewMeshRight = CardboardUtility.ConvertCardboardMesh_Triangle(eyeMeshes.Item2); }