viewangles refactor, fix view angles wraparound

This commit is contained in:
2022-06-28 19:41:49 +03:00
parent 368a48b27e
commit 49cb9e25af
4 changed files with 58 additions and 37 deletions

View File

@@ -33,8 +33,15 @@ namespace Game
{
// Collect all input here
// All axis values here should be accumulated
currentState.input.viewDeltaX += InputManager.GetAxisRaw("Mouse X");
currentState.input.viewDeltaY += InputManager.GetAxisRaw("Mouse Y");
float sensitivity = 1.0f / 8.0f;
sensitivity = 1.0f;
//var asf = InputManager.GetAxisRaw("Mouse X");
//if (asf != 0.0f)
// Console.Print(InputManager.GetAxisRaw("Mouse X").ToString("G9", System.Globalization.CultureInfo.InvariantCulture));
currentState.input.viewDeltaX += InputManager.GetAxisRaw("Mouse X") * sensitivity;
currentState.input.viewDeltaY += InputManager.GetAxisRaw("Mouse Y") * sensitivity;
currentState.input.viewDeltaX += InputManager.GetAxisRaw("LookRight") * Time.DeltaTime * 100;
currentState.input.viewDeltaY += -InputManager.GetAxisRaw("LookUp") * Time.DeltaTime * 100;