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

ArcRotateCamera: Modify mapPanning to account for upVector #14352

Merged
merged 2 commits into from
Oct 4, 2023

Conversation

PolygonalSun
Copy link
Contributor

@PolygonalSun PolygonalSun commented Sep 26, 2023

This PR contains a change to the logic for mapPanning so that the X/Z panning will happen with respect to whatever the current upVector is, rather than against the absolute X/Z axes.

Related forum link: https://forum.babylonjs.com/t/arcrotatecamera-mappanning-does-not-take-upvector-into-account/43820/3

Example PR to test in future: https://playground.babylonjs.com/#YSVLLN#1

@bjsplat
Copy link
Collaborator

bjsplat commented Sep 26, 2023

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.

@bjsplat
Copy link
Collaborator

bjsplat commented Sep 26, 2023

@PolygonalSun
Copy link
Contributor Author

PolygonalSun commented Oct 3, 2023

Hey @bghgary, @deltakosh, @Popov72, @RaananW, and @sebavan,

Originally, mapPanning didn't take the upVector into account and would only eliminate movement on the Y-axis in World space with panning. I talked the math over with @bghgary to verify the approach but we had determined that this change should be considered a bug fix; however, it would also technically be a breaking change. This is because the ArcRotateCamera will now treat whatever vector upVector is as the Y-axis and if anyone enables mapPanning but also happens to change the upVector to something that isn't (0,1,0), it wouldn't work the same. While I feel like this is a reasonable change, I wanted to talk this over with you guys to see what your thoughts were on the subject.

@sebavan
Copy link
Member

sebavan commented Oct 4, 2023

Looks like a bug fix to me as well.

@PolygonalSun PolygonalSun marked this pull request as ready for review October 4, 2023 16:47
@PolygonalSun PolygonalSun merged commit 7a4c4d9 into BabylonJS:master Oct 4, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants