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
Consistent API for the loader classes #1084
Comments
Agreed. Loaders need some love on progress/error reporting. |
would you suggest an api like
or pass them all into a constructor like in jquery .ajax(), eg. |
That's in place already ;) |
But I think I'll change it so it uses EventTarget.js instead (already added it to TrackballControls.js recently). |
I see, didn't notice the recent changes :) |
I have been working on integrating THREE.js with Crafty (https://github.com/louisstow/Crafty) to take advantage of the entity/component system. Crafty has a single function for loading in different assets which gives the option for passing progress and error callbacks. Although the loaders use a progress callback internally, each of them throws an error on failure and doesn't allow the caller to set a progress callback. Is it possible to make a consistent API for the loaders which allows tracking of success, progress and failure by the caller, and makes it easier to use them interchangeably?
It seems like separating the XHR functions and the code which actually parses the loaded data might be a good idea, since the XHR code is similar across most of the classes. If the API separated the functionality of creating geometry, animations etc from already loaded data it would be easier to integrate the loaders into other projects which already handle the XHR side of things.
The text was updated successfully, but these errors were encountered: