pmndrs / three-stdlib

📚 Stand-alone library of threejs examples designed to run without transpilation in node & browser
https://npmjs.com/three-stdlib
MIT License
704 stars 117 forks source link

fix(OrbitControls): update camera up direction #273

Closed kenjinp closed 1 year ago

kenjinp commented 1 year ago

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

codesandbox-ci[bot] commented 1 year ago

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 a3d6021d62593fb885701fa4f76fa4c8da55cb3d:

Sandbox Source
Vanilla Configuration
CodyJasonBennett commented 1 year ago

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

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 2.23.14 :tada:

The release is available on:

Your semantic-release bot :package::rocket: