Skip to content

Commit

Permalink
Revert "Added second camera to Stretch Robot"
Browse files Browse the repository at this point in the history
This reverts commit 26d2fc2.
  • Loading branch information
elimvb committed Dec 2, 2021
1 parent 26d2fc2 commit 128a072
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 320 deletions.
2 changes: 1 addition & 1 deletion unity/Assets/Scripts/BaseFPSAgentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public BaseFPSAgentController(BaseAgentComponent baseAgentComponent, AgentManage
this.m_WalkSpeed = 2;
this.m_RunSpeed = 10;
this.m_GravityMultiplier = 2;
this.m_Camera = this.transform.Find("FirstPersonCharacter").GetComponent<Camera>();
this.m_Camera = this.gameObject.GetComponentInChildren<Camera>();
this.m_CharacterController = GetComponent<CharacterController>();
collidedObjects = new string[0];
collisionsInAction = new List<string>();
Expand Down
9 changes: 0 additions & 9 deletions unity/Assets/Scripts/StretchAgentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ public override void InitializeBody() {
standingLocalCameraPosition = m_Camera.transform.localPosition;
crouchingLocalCameraPosition = m_Camera.transform.localPosition;

// set secondary arm-camera
Camera fp_camera_2 = m_CharacterController.transform.Find("FirstPersonCharacter").Find("SecondCamera").GetComponent<Camera>();
fp_camera_2.gameObject.SetActive(true);
Debug.Log(fp_camera_2 + " should be enabled, so is it? Answer: " + fp_camera_2.enabled);
fp_camera_2.transform.localPosition = new Vector3(-0.01760002f, 0.1291f, -0.1512001f);
fp_camera_2.transform.localEulerAngles = new Vector3(45f, 90f, 0f);
fp_camera_2.fieldOfView = 60f;
this.agentManager.thirdPartyCameras.Add(fp_camera_2);

// limit camera from looking too far down
this.maxDownwardLookAngle = 90f;
this.maxUpwardLookAngle = 25f;
Expand Down
Loading

0 comments on commit 128a072

Please sign in to comment.