-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added damping to OrbitControls #7016
Conversation
Thing is, these property names are dreadful, IMO, as are the following property names requiring double-negatives: this.noZoom = false;
this.noRotate = false;
this.noPan = false;
this.noKeys = false; Perhaps we can change them, and eliminate the double-negatives, to something like the following -- even it if results in breakage: noZoom -> allowZoom (default true)
noRotate -> allowRotate (default true)
noPan -> allowPan (default true)
noKeys -> allowKeys (default true)
staticMoving -> inertia (default true)
dynamicDampingFactor -> inertiaFactor (default 0.2) or dampingFactor Regarding the Suggestions welcome. |
@dubejf The Plus, properties a user would care about are scattered within the file. Were you planning on re-working this? As I mentioned elsewhere, a finite-state-machine seems the way to go, but it is not clear to me that it would be "better" than the linear structure we had before. |
How about |
That sounds good -- in a separate PR, though. The only thing I don't like about How do you want to handle warnings -- just a console warning that the property is deprecated, or re-map the old to the new, somehow? |
@WestLangley I know this relates to the concept of inertia in physics, but I have trouble remembering all my high school physics terms. :-) On the other hand, I would guess that most people intuitively know what dampening means (squashing down, restricting, or limiting). Edit: .friction could just as easily be used to mean the same thing as .dampingFactor, but I don't know if that's the correct physical term for what's going on under the hood. |
Yes, I proposed Maybe |
enableDamping and dampingFactor are clear and easy to spell, more so than coefficient. |
@mrdoob Would you find this acceptable? noZoom -> enableZoom (default true)
noRotate -> enableRotate (default true)
noPan -> enablePan (default true)
noKeys -> enableKeys (default true)
staticMoving -> enableDamping (default true)
dynamicDampingFactor -> dampingFactor (default 0.2) And as I asked above,
|
These names looks good to me. As per renaming approach. I think I would use getter/setter and show a warning. Something like this: https://github.com/mrdoob/three.js/blob/dev/src/renderers/WebGLRenderer.js#L3679-L3732 |
Added damping to OrbitControls
Got it. Next PR. |
@WestLangley I had no plan to continue this refactoring until the next release. Should I prepare a patch to revert the commit that created The I'm not sure about FSM. Could you make an example by overhauling a simpler controls? |
Oh, no. That is not necessary, unless you decide you want to. FSM is very high on my interest list, but low on my critical list. So I probably will not pursue it -- unless a miracle happens. I was kind of hoping you would. : - ) |
This has been a long-requested feature.
Some time ago, the property names of
OrbitControls
andTrackballControls
were made to match. I have (reluctantly) continued that convention, and added the following properties toOrbitControls
: