Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed camera preview with multi selection (case 1324126).
- Fixed a NaN generating in Area light code.
- Fix potential NaN on apply distortion pass.
- Fixed the camera controller in the template with the old input system (case 1326816).

### Changed
- Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ public void UpdateTransform(Transform t)
public float positionLerpTime = 0.2f;

[Header("Rotation Settings")]
[Tooltip("Multiplier for the sensitivity of the rotation.")]
public float mouseSensitivity = 60.0f;

[Tooltip("X = Change in mouse position.\nY = Multiplicative factor for camera rotation.")]
public AnimationCurve mouseSensitivityCurve = new AnimationCurve(new Keyframe(0f, 0.5f, 0f, 5f), new Keyframe(1f, 2.5f, 0f, 0f));

Expand Down Expand Up @@ -188,7 +191,7 @@ void Update()
// Rotation
if (IsCameraRotationAllowed())
{
var mouseMovement = GetInputLookRotation() * Time.deltaTime * 5;
var mouseMovement = GetInputLookRotation() * Time.deltaTime * mouseSensitivity;
if (invertY)
mouseMovement.y = -mouseMovement.y;

Expand Down Expand Up @@ -225,7 +228,6 @@ void Update()
float GetBoostFactor()
{
#if ENABLE_INPUT_SYSTEM
// TODO
return boostFactorAction.ReadValue<Vector2>().y * 0.01f;
#else
return Input.mouseScrollDelta.y * 0.01f;
Expand All @@ -234,8 +236,12 @@ float GetBoostFactor()

Vector2 GetInputLookRotation()
{
// try to compensate the diff between the two input systems by multiplying with empirical values
#if ENABLE_INPUT_SYSTEM
return lookAction.ReadValue<Vector2>();
var delta = lookAction.ReadValue<Vector2>();
delta *= 0.5f; // Account for scaling applied directly in Windows code by old input system.
delta *= 0.1f; // Account for sensitivity setting on old Mouse X and Y axes.
return delta;
#else
return new Vector2(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y") * (invertY ? 1 : -1));
#endif
Expand Down Expand Up @@ -268,7 +274,7 @@ bool IsCameraRotationAllowed()
canRotate |= Gamepad.current != null ? Gamepad.current.rightStick.ReadValue().magnitude > 0 : false;
return canRotate;
#else
return Input.GetMouseButtonDown(1);
return Input.GetMouseButton(1);
#endif
}

Expand Down