tizzle / aframe-orbit-controls-component

An Orbit Controls Component for A-Frame VR
https://tizzle.github.io/aframe-orbit-controls-component/
MIT License
74 stars 25 forks source link

Add rotateTo() method #8

Closed Jinksi closed 7 years ago

Jinksi commented 7 years ago

See Example: codepen.io/Jinksi/pen/dWmYyP

rotateTo() allows the camera to orbit to a specified position.

Three new arguments are added to README.md

Property Description Default Value
rotateTo Vector3 – position to rotate to '0 0 0'
rotateToSpeed Number – rotateTo speed 0.05
logPosition Boolean – prints out camera position to console.log() when rotating true

A new example is added to examples/rotate-to/

tizzle commented 7 years ago

Hey @Jinksi,

in the wake of receiving a few issues and PRs i found the component was ehm.. not as well crafted as it could have been. Thus i went through some of the code and began to implement some stuff better. As my base deviated from my last commit, i added your PR manually. I hope that's good for you. But: The entity now reflects the cameras position and rotation. Which makes it possible to switch back and forth between cameras without losing the last position.

Please check the new version v0.1.3 and see if this fits your needs (it's basically all of your code). I then will reject the PR.

Sorry for the confusion.

Thanks a lot for your work and cheers,

Till

Jinksi commented 7 years ago

Yeah no worries @tizzle. Thanks for integrating the update. The code is easier to look at now, so future updates will be smoother! 👍