mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-12 22:59:04 +00:00
Fix SDL gyro and acceleration sensor handling (#2532)
* Fix sensor handling if they are enabled but an error was thrown regardless * Initialise orientation to a default value + clang
This commit is contained in:
@@ -182,7 +182,7 @@ void GameController::CalculateOrientation(Libraries::Pad::OrbisFVector3& acceler
|
||||
|
||||
// Normalize accelerometer measurement
|
||||
float norm = std::sqrt(ax * ax + ay * ay + az * az);
|
||||
if (norm == 0.0f)
|
||||
if (norm == 0.0f || deltaTime == 0.0f)
|
||||
return; // Handle NaN
|
||||
norm = 1.0f / norm;
|
||||
ax *= norm;
|
||||
|
||||
Reference in New Issue
Block a user