Closed neftaly closed 1 year ago
at the moment the camera state is provided by an internal zustand state subscription. this is fast, whereas supplying props to the react component is expensive. doing this change optimizes for camera animations, but adds a bottleneck when user imput is directly manipulating the camera. there should be an escape hatch for direct camera manipulation (maybe through animation fn?)
maybe make it possible to pass a stream in as an argument (can zustand be passed as an argument)? not sure how min/max angle function ties into this
another approach is to add a useOrbitCamera
hook
merged changes (stream as argument)
Implement same API as https://github.com/garbo-succus/r3f-simple-orbit-camera, with an additional "animation" prop for a fn that handles the animation of the current transition. Functions such as min/max angle should be pulled out of component and provided as a helper library.
This would fix #1 #2