Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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 @@ -136,6 +136,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed volumetric fog being visually chopped or missing when using hardware Dynamic Resolution Scaling.
- Fixed generation of the packed depth pyramid when hardware Dynamic Resolution Scaling is enabled.
- Fixed Decal's UV edit mode with negative UV
- 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 = 10.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 * 6 * 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