public void BuildMesh(bool left, int plat, Material mat) { curPlatform = plat; if (left) { leftEye = true; } if (curPlatform != 0) { androidCalib = new AndroidCalibration(); androidCalib.UpdateCalibration(); this.xSize = androidCalib.GetGridSizeX(); this.ySize = androidCalib.GetGridSizeY(); android = true; } else if (curPlatform == 0) { pcPlugin = new CalibrationData(); this.xSize = pcPlugin.GridX(); this.ySize = pcPlugin.GridY(); } meshMat = mat; if (android == false) { this.rotation = new Vector3(0.0f, 0.0f, -90.0f); } else if (android == true) { if (leftEye) { this.rotation = new Vector3(0.0f, 0.0f, -90.0f); } else { this.rotation = new Vector3(0.0f, 0.0f, 90.0f); } } GenerateMesh(); WarpMesh(); FindCenters(); CreateScreenCamera(); Destroy(GetComponent <Distortion>()); }
public void Initialization(int plat, int track, bool capture) { editorCam = this.GetComponent <Camera>(); platform = plat; tracking = track; if (platform == 0) { pcPlugin = new CalibrationData(); } else if (platform != 0) { androidPlugin = new AndroidCalibration(); androidPlugin.UpdateCalibration(); if (platform == 1) { Screen.orientation = ScreenOrientation.LandscapeRight; } else if (platform > 1) { Screen.orientation = ScreenOrientation.LandscapeLeft; } } RigSettings(); if (!capture) { Destroy(editorCam); } RTCameraPosition(); CreateMeshes(); if (track == 2) { this.transform.localPosition = new Vector3(0.0f, -.05f, -.03f); } else { this.transform.localPosition = new Vector3(0.0f, -eyeHeight, -eyeDepth); } Destroy(GetComponent <RigSetup>()); }