// UpdateEyeHeightOffset void UpdateEyeHeightOffset() { // We will update neck position, since camera root and eye center should // be set differently. if (Input.GetKeyDown(KeyCode.Alpha5)) { Vector3 neckPosition = Vector3.zero; CameraController.GetNeckPosition(ref neckPosition); neckPosition.y -= HeightIncrement; CameraController.SetNeckPosition(neckPosition); } else if (Input.GetKeyDown(KeyCode.Alpha6)) { Vector3 neckPosition = Vector3.zero;; CameraController.GetNeckPosition(ref neckPosition); neckPosition.y += HeightIncrement; CameraController.SetNeckPosition(neckPosition); } if (ShowVRVars == true) // limit gc { float eyeHeight = 0.0f; CameraController.GetPlayerEyeHeight(ref eyeHeight); strHeight = System.String.Format("Eye Height (m): {0:F3}", eyeHeight); } }
// UpdateHeightOffset void UpdateHeightOffset() { if (Input.GetKeyDown(KeyCode.Alpha5)) { Vector3 neckPosition = Vector3.zero; CameraController.GetNeckPosition(ref neckPosition); neckPosition.y -= HeightIncrement; CameraController.SetNeckPosition(neckPosition); } else if (Input.GetKeyDown(KeyCode.Alpha6)) { Vector3 neckPosition = Vector3.zero;; CameraController.GetNeckPosition(ref neckPosition); neckPosition.y += HeightIncrement; CameraController.SetNeckPosition(neckPosition); } if (ShowVRVars == true) // limit gc { Vector3 rootPosition = new Vector3(0.0f, 1.0f, 0.0f); Vector3 neckPosition = Vector3.zero; CameraController.GetNeckPosition(ref neckPosition); Vector3 eyePosition = Vector3.zero; CameraController.GetEyeCenterPosition(ref eyePosition); // default capsule is 2.0m, but the center offset is at 1.0m float ph = rootPosition.y + neckPosition.y + eyePosition.y; strHeight = System.String.Format("Player Height (m): {0:F3}", ph); } }