Open vorg opened 2 years ago
True, I see its purpose. A few points that come to mind:
set
ting a new camera on the orbiterI see 3 options:
orbiter.set({
maxDistance: vec3.add(aabb.size(scene.bounds), aabb.center(scene.bounds))
})
Add back previous behaviour and make a note on how it works
Change defaults to:
minDistance: Number.EPSILON,
maxDistance: Infinity,
Thoughts?
It's convenience to protect you from inertia scrolling on Mac but pain on bigger scenes like Expo.
It is a convenience method and I assume / 10 and * 10 work in most case but is it just an arbitrary number?
In most cases you set your camera outside of the scene if you use orbiter to rotate around it. 10x was good guesstimate to prevent it shrinking to 1x1 px if you zoom out too far.
Overrides already set defaults on the orbiter object
That's ok. Because if you know what you want you just provide maxDistance
and otherwise (most cases) you don't have to do extra steps.
I think we should probably disable it by default, remove to automagic guessing on position set and let user set it manually if really needed.
minDistance: Number.EPSILON,
maxDistance: Infinity,
Cases where you zoom out too far should be handled on the user side by e.g. having reset camera button.
It got lost here and causes large gilt scenes to be zoomed in into the mesh.
https://github.com/pex-gl/pex-cam/commit/6e2881caad1a8cf47c75df7adb493519a4ef7d10#diff-78aa8fa08464681459d97cd46fe608ab83a8944ec030fa9796ad452ddaa8d1cfL80