-
Notifications
You must be signed in to change notification settings - Fork 25
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
update controls import #5
Conversation
import FlyControlsWrapper from 'three-fly-controls'; | ||
const ThreeFlyControls = (FlyControlsWrapper(three), three.FlyControls); | ||
import { TrackballControls as ThreeTrackballControls } from 'three/examples/jsm/controls/TrackballControls.js'; | ||
import { OrbitControls as ThreeOrbitControls } from 'three/examples/jsm/controls/OrbitControls.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't you just import from three
? not the example code? The actual three
dependency is up to date btw (I checked that when trying to debug)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to, but node couldn't find the object. The only part of the code where the controls are exported are on the example folder.
Also I did a fast research and found that on the threejs examples they export them from that path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow looks like it, opened an issue here: mrdoob/three.js#19250
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay it actually looks like this is the approved way to do it:
mrdoob/three.js#19250 (comment)
Thanks @RaulPROP for this. I think it would be certainly a good shift to consume the controls directly from the However this is a bit of a problematic approach, because In the UMD version this takes the form of the consumer including a script tag which exposes a global understood by the bundler (rollup). Since the controls are not exposed as part of the core three build, things gets a bit complicated. We could either:
I'm inclined to give 3) a try, unless you can think of a better way to approach it. Hopefully it's clear why this is a less straight-forward change than it immediately appears. This is the reason why I initially went the route of importing the controls from separate packages, because you can then separate the peer from the regular dependencies. |
Oh, I didn't notice this problem. I don't know which one is the best solution, I don't have much experience dealing with this situations. Maybe we could create a fork of the libraries that this package is currently using and update the code to match the three.js/examples ones? |
Ok I went with option 3). Also removed the stand-alone dependencies since they're no longer used. Thanks! |
I have updated the controls so the users can access new features as in this issue.
I also added a .gitignore file.