From 0f4413a5278191afea1f6093c53aa4acbde4b50d Mon Sep 17 00:00:00 2001 From: rosehendrix Date: Fri, 19 Jul 2024 11:22:34 -0700 Subject: [PATCH] try to un-delete second camera --- .../Assets/Scripts/StretchAgentController.cs | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/unity/Assets/Scripts/StretchAgentController.cs b/unity/Assets/Scripts/StretchAgentController.cs index 7e1bbf16fc..2f48b39d11 100644 --- a/unity/Assets/Scripts/StretchAgentController.cs +++ b/unity/Assets/Scripts/StretchAgentController.cs @@ -69,19 +69,19 @@ public override ActionFinished InitializeBody(ServerAction initializeAction) { var secondaryCameraName = "SecondaryCamera"; // DISABLED UNTIL ROSE ASKS FOR SECOND GOPRO CAMERA - // // activate arm-camera - // Camera fp_camera_2 = m_CharacterController - // .transform.Find(secondaryCameraName) - // .GetComponent(); - // fp_camera_2.gameObject.SetActive(true); - // agentManager.registerAsThirdPartyCamera(fp_camera_2); - // if (initializeAction.antiAliasing != null) { - // agentManager.updateAntiAliasing( - // postProcessLayer: fp_camera_2.gameObject.GetComponentInChildren(), - // antiAliasing: initializeAction.antiAliasing - // ); - // } - // + // activate arm-camera + Camera fp_camera_2 = m_CharacterController + .transform.Find(secondaryCameraName) + .GetComponent(); + fp_camera_2.gameObject.SetActive(true); + agentManager.registerAsThirdPartyCamera(fp_camera_2); + if (initializeAction.antiAliasing != null) { + agentManager.updateAntiAliasing( + postProcessLayer: fp_camera_2.gameObject.GetComponentInChildren(), + antiAliasing: initializeAction.antiAliasing + ); + } + // set up primary camera parameters for stretch specific parameters m_Camera.transform.localPosition = defaultMainCameraLocalPosition; @@ -89,16 +89,16 @@ public override ActionFinished InitializeBody(ServerAction initializeAction) { m_Camera.fieldOfView = defaultMainCameraFieldOfView; // DISABLED UNTIL ROSE ASKS FOR SECOND GOPRO CAMERA - // // set up secondary camera paremeters for stretch bot - // fp_camera_2.transform.localPosition = defaultSecondaryCameraLocalPosition; - // fp_camera_2.transform.localEulerAngles = defaultSecondaryCameraLocalRotation; - // fp_camera_2.fieldOfView = defaultSecondaryCameraFieldOfView; + // set up secondary camera paremeters for stretch bot + fp_camera_2.transform.localPosition = defaultSecondaryCameraLocalPosition; + fp_camera_2.transform.localEulerAngles = defaultSecondaryCameraLocalRotation; + fp_camera_2.fieldOfView = defaultSecondaryCameraFieldOfView; // set up lens distortion for stretch bot cameras if (distortLens == true) { enableLensDistortion(m_Camera); // DISABLED UNTIL ROSE ASKS FOR SECOND GOPRO CAMERA - // enableLensDistortion(fp_camera_2); + enableLensDistortion(fp_camera_2); } // limit camera from looking too far down/up @@ -115,11 +115,11 @@ public override ActionFinished InitializeBody(ServerAction initializeAction) { } // DISABLED UNTIL ROSE ASKS FOR SECOND GOPRO CAMERA - // var secondaryCameraParams = new CameraParameters(); - // var setSecondaryParams = initializeAction.thirdPartyCameraParameters?.TryGetValue( - // secondaryCameraName, - // out secondaryCameraParams - // ); + var secondaryCameraParams = new CameraParameters(); + var setSecondaryParams = initializeAction.thirdPartyCameraParameters?.TryGetValue( + secondaryCameraName, + out secondaryCameraParams + ); // if (setSecondaryParams.GetValueOrDefault()) { // CameraParameters.setCameraParameters(fp_camera_2, secondaryCameraParams);