IEnumerator SetCamConfig(int iCamera, float fov, float offset_x, float offset_y, float offset_z, float rot_x, int img_w, int img_h, int img_d, string img_enc, float fish_eye_x, float fish_eye_y) { CameraSensor cam = null; if (iCamera == 0) { cam = camSensor; } else { cam = camSensorB; if (cam != null && !cam.gameObject.activeInHierarchy) { cam.gameObject.SetActive(true); } } if (cam) { cam.SetConfig(fov, offset_x, offset_y, offset_z, rot_x, img_w, img_h, img_d, img_enc); Fisheye fe = cam.gameObject.GetComponent <Fisheye>(); if (fe != null && (fish_eye_x != 0.0f || fish_eye_y != 0.0f)) { fe.enabled = true; fe.strengthX = fish_eye_x; fe.strengthY = fish_eye_y; } } yield return(null); }
IEnumerator SetCamConfig(float fov, float offset_x, float offset_y, float offset_z, float rot_x, int img_w, int img_h, int img_d, string img_enc, float fish_eye_x, float fish_eye_y) { CameraSensor camSensor = carObj.transform.GetComponentInChildren <CameraSensor>(); if (camSensor) { camSensor.SetConfig(fov, offset_x, offset_y, offset_z, rot_x, img_w, img_h, img_d, img_enc); Fisheye fe = camSensor.gameObject.GetComponent <Fisheye>(); if (fe != null && (fish_eye_x != 0.0f || fish_eye_y != 0.0f)) { fe.enabled = true; fe.strengthX = fish_eye_x; fe.strengthY = fish_eye_y; } } yield return(null); }