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

fix(OrbitControls): update camera up direction #273

Merged
merged 3 commits into from
Jul 30, 2023

Conversation

kenjinp
Copy link
Contributor

@kenjinp kenjinp commented Jul 30, 2023

Why

OrbitControls only follows the object.up orientation on initialization, making it impossible to update if your controls has to follow an object walking around a geometry that's not a plane, such as a character walking around a planet.

What

I've added two lines which updates the quat up direction inside the orbitcontrols.update method
This will add two unnecessary operations for most users, though. Perhaps it can be enabled by a flag?

Checklist

  • Documentation updated
  • Storybook entry added
  • Ready to be merged

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 30, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit a3d6021:

Sandbox Source
Vanilla Configuration

@CodyJasonBennett CodyJasonBennett changed the title fix: update orbit controls up direction fix(OrbitControls): update camera up direction Jul 30, 2023
@CodyJasonBennett
Copy link
Member

A dot product is cheap, doesn't need a flag.

@CodyJasonBennett CodyJasonBennett merged commit 6616a6e into pmndrs:main Jul 30, 2023
2 checks passed
@github-actions
Copy link

🎉 This PR is included in version 2.23.14 🎉

The release is available on:

Your semantic-release bot 📦🚀

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