Skip to content
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

R108 #164

Merged
merged 3 commits into from
Jul 13, 2020
Merged

R108 #164

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
## A Three.js wrapper for GWT

# Maven
Current Version 0.107, implements 0.107 version of three.js
Current Version 0.108, implements 0.108 version of three.js

```xml
<dependency>
<groupId>org.treblereel.gwt</groupId>
<artifactId>three4g</artifactId>
<version>0.107</version>
<version>0.108-SNAPSHOT</version>
</dependency>
```
# Setup
Expand Down
2 changes: 1 addition & 1 deletion annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.treblereel.gwt</groupId>
<artifactId>three4g-parent</artifactId>
<version>0.108-SNAPSHOT</version>
<version>0.109-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.treblereel.gwt</groupId>
<artifactId>three4g-parent</artifactId>
<version>0.108-SNAPSHOT</version>
<version>0.109-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
package org.treblereel.gwt.three4g.loaders;

import com.google.gwt.json.client.JSONObject;
import jsinterop.annotations.JsConstructor;
import jsinterop.annotations.JsType;
import org.treblereel.gwt.three4g.animation.AnimationClip;
import org.treblereel.gwt.three4g.loaders.managers.LoadingManager;

/**
* Class for loading AnimationClips in JSON format. This uses the FileLoader internally for loading files.
*
* @author Dmitrii Tikhomirov
* Created by treblereel on 4/26/18.
*/
@JsType(isNative = true, namespace = "THREE")
public class AnimationLoader {

/**
* The loadingManager the loader is using. Default is DefaultLoadingManager.
*/
public LoadingManager manager;
public class AnimationLoader extends Loader<AnimationLoader, AnimationClip[]> {

@JsConstructor
public AnimationLoader() {
Expand All @@ -29,57 +22,4 @@ public AnimationLoader() {
public AnimationLoader(LoadingManager manager) {

}

/**
* Load the URL and pass the response to the onLoad function.
*
* @param url — the path or URL to the file. This can also be a Data URI.
*/
public native void load(String url);

/**
* Load the URL and pass the response to the onLoad function.
*
* @param url — the path or URL to the file. This can also be a Data URI.
* @param onLoad — Will be called when loading completes. The argument will be the loaded response.
*/
public native void load(String url, OnLoadCallback<AnimationClip> onLoad);

/**
* Load the URL and pass the response to the onLoad function.
*
* @param url — the path or URL to the file. This can also be a Data URI.
* @param onLoad — Will be called when loading completes. The argument will be the loaded response.
* @param onProgress — Will be called while load progresses. The argument will be the XMLHttpRequest
*/
public native void load(String url, OnLoadCallback<AnimationClip> onLoad, OnProgressCallback onProgress);


/**
* Load the URL and pass the response to the onLoad function.
*
* @param url — the path or URL to the file. This can also be a Data URI.
* @param onLoad — Will be called when loading completes. The argument will be the loaded response.
* @param onProgress — Will be called while load progresses. The argument will be the XMLHttpRequest
* @param onError — Will be called if an error occurs.
*/
public native void load(String url, OnLoadCallback<AnimationClip> onLoad, OnProgressCallback onProgress, OnErrorCallback onError);


/**
* Parse the JSON object and pass the result to onLoad. Individual clips in the object will be parsed with AnimationClip.parse.
*
* @param json — required
* @param onLoad — Will be called when parsing completes.
*/
public native void parse(JSONObject json, OnLoadCallback<AnimationClip> onLoad); //TODO checkit

/**
* Sets the base path or URL from which to load files. This can be useful if
* you are loading many animations from the same directory.
*
* @param path — Base path of the file to load.
* @return instance of AnimationLoader
*/
public native AnimationLoader setPath(String path);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,69 +12,16 @@
* Created by treblereel on 4/26/18.
*/
@JsType(isNative = true, namespace = "THREE")
public class AudioLoader {

/**
* The loadingManager the loader is using. Default is DefaultLoadingManager.
*/
public LoadingManager manager;
public class AudioLoader extends Loader<AudioLoader, AudioBuffer> {

@JsConstructor
public AudioLoader() {

}

@JsConstructor
public AudioLoader(String context) {

}

@JsConstructor
public AudioLoader(String context, LoadingManager manager) {
public AudioLoader(LoadingManager manager) {

}

/**
* Load the URL and pass the response to the onLoad function.
*
* @param url — the path or URL to the file. This can also be a Data URI.
*/
public native void load(String url);

/**
* Load the URL and pass the response to the onLoad function.
*
* @param url — the path or URL to the file. This can also be a Data URI.
* @param onLoad — Will be called when loading completes. The argument will be the loaded response.
*/
public native void load(String url, OnLoadCallback<AudioBuffer> onLoad);

/**
* Load the URL and pass the response to the onLoad function.
*
* @param url — the path or URL to the file. This can also be a Data URI.
* @param onLoad — Will be called when loading completes. The argument will be the loaded response.
* @param onProgress — Will be called while load progresses. The argument will be the XMLHttpRequest
*/
public native void load(String url, OnLoadCallback<AudioBuffer> onLoad, OnProgressCallback onProgress);


/**
* Load the URL and pass the response to the onLoad function.
*
* @param url — the path or URL to the file. This can also be a Data URI.
* @param onLoad — Will be called when loading completes. The argument will be the loaded response.
* @param onProgress — Will be called while load progresses. The argument will be the XMLHttpRequest
* @param onError — Will be called if an error occurs.
*/
public native void load(String url, OnLoadCallback<AudioBuffer> onLoad, OnProgressCallback onProgress, OnErrorCallback onError);

/**
* Sets the base path or URL from which to load files. This can be useful if you are loading many audios from the same directory.
*
* @param path — Base path of the file to load.
* @return instance of AudioLoader
*/
public native AudioLoader setPath(String path);

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,11 @@

/**
* A loader for loading a BufferGeometry. This uses the FileLoader internally for loading files.
*
* @author Dmitrii Tikhomirov
* Created by treblereel on 4/26/18.
*/
@JsType(isNative = true, namespace = "THREE")
public class BufferGeometryLoader {

/**
* The loadingManager the loader is using. Default is DefaultLoadingManager.
*/
public LoadingManager manager;
public class BufferGeometryLoader<T extends BufferGeometry> extends Loader<BufferGeometryLoader, T> {

@JsConstructor
public BufferGeometryLoader() {
Expand All @@ -28,56 +22,4 @@ public BufferGeometryLoader() {
public BufferGeometryLoader(LoadingManager manager) {

}

/**
* Load the URL and pass the response to the onLoad function.
*
* @param url — the path or URL to the file. This can also be a Data URI.
*/
public native void load(String url);

/**
* Load the URL and pass the response to the onLoad function.
*
* @param url — the path or URL to the file. This can also be a Data URI.
* @param onLoad — Will be called when loading completes. The argument will be the loaded response.
*/
public native void load(String url, OnLoadCallback<? extends BufferGeometry> onLoad);

/**
* Load the URL and pass the response to the onLoad function.
*
* @param url — the path or URL to the file. This can also be a Data URI.
* @param onLoad — Will be called when loading completes. The argument will be the loaded response.
* @param onProgress — Will be called while load progresses. The argument will be the XMLHttpRequest
*/
public native void load(String url, OnLoadCallback<? extends BufferGeometry> onLoad, OnProgressCallback onProgress);


/**
* Load the URL and pass the response to the onLoad function.
*
* @param url — the path or URL to the file. This can also be a Data URI.
* @param onLoad — Will be called when loading completes. The argument will be the loaded response.
* @param onProgress — Will be called while load progresses. The argument will be the XMLHttpRequest
* @param onError — Will be called if an error occurs.
*/
public native void load(String url, OnLoadCallback<? extends BufferGeometry> onLoad, OnProgressCallback onProgress, OnErrorCallback onError);

/**
* Parse a JSON structure and return a BufferGeometry.
*
* @param json — The JSON structure to parse.
* @return instance of BufferGeometry
*/
public native BufferGeometry parse(String json);

/**
* Sets the base path or URL from which to load files. This can be useful if
* you are loading many geometries from the same directory.
*
* @param path — Base path of the file to load.
* @return instance of BufferGeometryLoader
*/
public native BufferGeometryLoader setPath(String path);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,10 @@

/**
* Abstract base class for block based textures loader (dds, pvr, ...). This uses the FileLoader internally for loading files.
*
* @author Dmitrii Tikhomirov
* Created by treblereel on 10/9/18.
*/
public abstract class CompressedTextureLoader<T, V> {

/**
* The loadingManager the loader is using. Default is DefaultLoadingManager.
*/
public LoadingManager manager;

/**
* The base path from which files will be loaded. See .setPath. Default is undefined.
*/
public String path;
public abstract class CompressedTextureLoader<L, V> extends Loader<L, V> {

/**
* Creates a new CompressedTextureLoader.
Expand All @@ -29,53 +18,9 @@ public CompressedTextureLoader() {

/**
* Creates a new CompressedTextureLoader.
*
* @param manager — The loadingManager for the loader to use. Default is THREE.DefaultLoadingManager.
*/
public CompressedTextureLoader(LoadingManager manager) {

}

/**
* Begin loading from url and pass the loaded texture to onLoad.
*
* @param url — the path or URL to the file. This can also be a Data URI.
*/
public native void load(String url);

/**
* Begin loading from url and pass the loaded texture to onLoad.
*
* @param url — the path or URL to the file. This can also be a Data URI.
* @param onLoad — Will be called when loading completes. The argument will be the loaded response.
*/
public native void load(String url, OnLoadCallback<V> onLoad);

/**
* Begin loading from url and pass the loaded texture to onLoad.
*
* @param url — the path or URL to the file. This can also be a Data URI.
* @param onLoad — Will be called when loading completes. The argument will be the loaded response.
* @param onProgress — Will be called while load progresses. The argument will be the XMLHttpRequest
*/
public native void load(String url, OnLoadCallback<V> onLoad, OnProgressCallback onProgress);


/**
* Begin loading from url and pass the loaded texture to onLoad.
*
* @param url — the path or URL to the file. This can also be a Data URI.
* @param onLoad — Will be called when loading completes. The argument will be the loaded response.
* @param onProgress — Will be called while load progresses. The argument will be the XMLHttpRequest
* @param onError — Will be called if an error occurs.
*/
public native void load(String url, OnLoadCallback<V> onLoad, OnProgressCallback onProgress, OnErrorCallback onError);

/**
* Set the base path or URL from which to load files. This can be useful if you are loading many models from the same directory.
*
* @param path base path or URL
* @return instance of FileLoader
*/
public native T setPath(String path);
}
Loading