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

feat: support reversing horizontal and vertical orbit separately #278

Closed boweihan closed 1 year ago

boweihan commented 1 year ago

Closing in favor of https://github.com/pmndrs/three-stdlib/pull/280

Why

I'm trying to support drag controls that are different from what OrbitControls ships out of the box. The horizontal drag behaviour is what I want, but the vertical is inverted. Currently, we only have reverseOrbit, which enables the vertical drag behaviour that I want but inverts the horizontal as well.

reverseHorizontalOrbit is an API that enables inverting just the horizontal orbit direction. reverseVerticalOrbit is an API that enables inverting just the vertical orbit direction.

What

update rotateLeft and rotateRight functions in OrbitControls to reflect new API.

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 88e7d0be43c0b4cf756515b847e9855930706a80:

Sandbox Source
Vanilla Configuration