-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
OrbitControls #155
Comments
@burl21 let me check .... |
@burl21 have you annotated your class with @InjectJavaScriptFor(elements = OrbitControls.class) here is example |
Thank you so much for your answer @treblereel I solved it by adding: Looks like the annotations does not work. 👍 |
@burl21 Thanks for your feedback ! |
Hello, I have studied three4g library examples... package org.treblereel.gwt.three4g.extensions.resources;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.ScriptInjector;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.TextResource;
public interface TK_3JSResourceUtils extends ClientBundle {
TK_3JSResourceUtils IMPL = GWT.create(TK_3JSResourceUtils.class);
public static void addLib(TextResource libText) {//EXAMPLE TK_3JSLibResource.IMPL.getOrbitControls()
ScriptInjector.fromString(libText.getText()).setWindow(ScriptInjector.TOP_WINDOW).inject();
}
@Source("js/loaders/DRACOLoader.js")
TextResource getDRACOLoader();
@Source("js/loaders/GLTFLoader.js")
TextResource getGLTFLoader();
@Source("js/controls/OrbitControls.js")
TextResource getOrbitControls();
@Source("js/controls/TrackballControls.js")
TextResource getTrackballControls();
} and using it as this, TK_3JSResourceUtils.addLib(TK_3JSResourceUtils.IMPL.getOrbitControls());
TK_3JSResourceUtils.addLib(TK_3JSResourceUtils.IMPL.getTrackballControls());
TK_3JSResourceUtils.addLib(TK_3JSResourceUtils.IMPL.getGLTFLoader());
TK_3JSResourceUtils.addLib(TK_3JSResourceUtils.IMPL.getDRACOLoader()); |
@tugalsan thanks for workaround, i ll take a look right after my PTO next week |
Hi,
I’m trying to use this library.
When I try to init OrbitControls
orbitControls = new OrbitControls(camera, div);
I have the following error:
com.google.gwt.core.client.JavaScriptException: (TypeError) : $wnd.THREE.OrbitControls is not a constructor
GWT 2.8.1
Any ideas?
The text was updated successfully, but these errors were encountered: