Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera: Added divide by zero check FreeCameraTouchInput #12649

Merged
merged 2 commits into from
Jun 14, 2022
Merged

Camera: Added divide by zero check FreeCameraTouchInput #12649

merged 2 commits into from
Jun 14, 2022

Conversation

PolygonalSun
Copy link
Contributor

In the forums, there was an issue raised where movement wasn't working on Safari. After some investigation, it was found that the touchMoveSensibility property was being used in a denominator inside of the checkInputs function. Because of this, if touchMoveSensibility was zero, it'd create a divide by zero scenario that would effectively render the camera's cameraDirection vector to be a vector of NaNs. The fix for this was to just add a check to see if touchMoveSensibility was zero and handle things accordingly.

Forum link: https://forum.babylonjs.com/t/keyboard-control-not-working-for-latest-universalcamera-in-desktop-safari/31314

@azure-pipelines
Copy link

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@azure-pipelines
Copy link

@PolygonalSun PolygonalSun marked this pull request as ready for review June 14, 2022 00:47
@azure-pipelines
Copy link

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@azure-pipelines
Copy link

@RaananW RaananW merged commit c801984 into BabylonJS:master Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants