Skip to content

Commit

Permalink
Merge pull request #151 from treblereel/r99
Browse files Browse the repository at this point in the history
updated to r99 release
  • Loading branch information
treblereel authored Dec 18, 2018
2 parents e419634 + 76ebc2f commit 3e85188
Show file tree
Hide file tree
Showing 36 changed files with 5,854 additions and 3,076 deletions.
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.98-beta2-SNAPSHOT</version>
<version>0.99-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.98-beta2-SNAPSHOT</version>
<version>0.99-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/org/treblereel/gwt/three4g/THREE.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public class THREE {
public static int ReinhardToneMapping;
public static int Uncharted2ToneMapping;
public static int CineonToneMapping;
public static int ACESFilmicToneMapping;
public static int UVMapping;
public static int CubeReflectionMapping;
public static int CubeRefractionMapping;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public AnimationClip(String name, int duration, KeyframeTrack[] tracks) {
/**
* Returns an array of new AnimationClips created from the morph target sequences of a geometry, trying to sort
* morph target names into animation-group-based patterns like "Walk_001, Walk_002, Run_001, Run_002 ..."
* This method is called by the JSONLoader internally, and it uses CreateFromMorphTargetSequence.
*
* @param name as String value
* @param morphTargetSequence array of morphTargetSequences
Expand Down
91 changes: 55 additions & 36 deletions core/src/main/java/org/treblereel/gwt/three4g/audio/Audio.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ public class Audio extends Object3D {
*/
public AudioContext context;

/**
* Modify pitch, measured in cents. +/- 100 is a semitone. +/- 1200 is an octave. Default is 0.
*/
public float detune;

/**
* Represents an array of BiquadFilterNodes. Can be used to apply a variety of low-order filters to create more complex sound effects. Filters are set via Audio.setFilter or Audio.setFilters.
*/
Expand Down Expand Up @@ -90,7 +95,7 @@ protected Audio() {
}

/**
* @param listener — (required) AudioListener instance.
* @param listener — AudioListener instance.
*/
public Audio(AudioListener listener) {

Expand All @@ -117,25 +122,48 @@ public Audio(AudioListener listener) {
*/
public native BiquadFilterNode getFilter();

/**
* Applies a single BiquadFilterNode to the audio.
*
* @param filter BiquadFilterNode
* @return instance of Audio
*/
public native Audio setFilter(BiquadFilterNode filter);

/**
* Returns the filters array.
*
* @return array of BiquadFilterNode
*/
public native BiquadFilterNode[] getFilters();

/**
* Applies an array of BiquadFilterNodes to the audio.
*
* @param value - arrays of filters.
* @return this Audio instance
*/
public native Audio setFilters(BiquadFilterNode[] value);

/**
* Return the value of source.loop (whether playback should loop).
*
* @return isLoop
*/
public native boolean getLoop();

/**
* Set source.loop to value (whether playback should loop).
*
* @param value boolean
* @return this Audio instance
*/
public native Audio setLoop(boolean value);

/**
* Return the gainNode.
* Cast to GainNode
*
* @return AudioNode
* @return GainNode
*/
public native AudioNode getOutput();

Expand All @@ -146,13 +174,29 @@ public Audio(AudioListener listener) {
*/
public native float getPlaybackRate();

/**
* If hasPlaybackControl is enabled, set the playbackRate to value.
*
* @param value playback rate
* @return instance of Audio
*/
public native Audio setPlaybackRate(float value);

/**
* Return the current volume.
*
* @return current volume
*/
public native float getVolume();

/**
* Set the volume.
*
* @param value volume rate
* @return instance of Audio
*/
public native Audio setVolume(float value);

/**
* If hasPlaybackControl is true, starts playback.
*
Expand All @@ -174,30 +218,6 @@ public Audio(AudioListener listener) {
*/
public native Audio setBuffer(AudioBuffer audioBuffer);

/**
* Applies a single BiquadFilterNode to the audio.
*
* @param filter BiquadFilterNode
* @return instance of Audio
*/
public native Audio setFilter(BiquadFilterNode filter);

/**
* Applies an array of BiquadFilterNodes to the audio.
*
* @param value - arrays of filters.
* @return this Audio instance
*/
public native Audio setFilters(BiquadFilterNode[] value);

/**
* Set source.loop to value (whether playback should loop).
*
* @param value boolean
* @return this Audio instance
*/
public native Audio setLoop(boolean value);

/**
* Applies the given object of type HTMLMediaElement as the source of this audio.
* Also sets hasPlaybackControl to false.
Expand All @@ -217,26 +237,25 @@ public Audio(AudioListener listener) {
public native Audio setNodeSource(AudioNode audioNode);

/**
* If hasPlaybackControl is enabled, set the playbackRate to value.
* If hasPlaybackControl is enabled, stops playback, resets startTime to 0 and sets isPlaying to false.
*
* @param value playback rate
* @return instance of Audio
*/
public native Audio setPlaybackRate(float value);
public native Audio stop();

/**
* Set the volume.
* Return the detune.
*
* @param value volume rate
* @return instance of Audio
* @return as float value
*/
public native Audio setVolume(float value);
public native float getDetune();

/**
* If hasPlaybackControl is enabled, stops playback, resets startTime to 0 and sets isPlaying to false.
* Set the detune.
*
* @param value detune rate
* @return instance of Audio
*/
public native Audio stop();
public native Audio setDetune(float value);

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,73 @@

import jsinterop.annotations.JsType;

/**
* @author Dmitrii Tikhomirov
* Created by treblereel on 10/9/18.
*/
/** @author Dmitrii Tikhomirov Created by treblereel on 10/9/18. */
@JsType(isNative = true)
public abstract class AbstractLoader<T, V> {

/**
* Begin loading from url and call onLoad with the response content.
*
* @param url — A string containing the path/URL of the file.
*/
public native void load(String url);
/**
* Begin loading from url and call onLoad with the response content.
*
* @param url — A string containing the path/URL of the file.
*/
public native void load(String url);

/**
* Begin loading from url and call onLoad with the response content.
*
* @param url — A string containing the path/URL of the file.
* @param onLoad — A function to be called after loading is successfully completed. The function receives the loaded SVGDocument as an argument.
*/
public native void load(String url, OnLoadCallback<V> onLoad);
/**
* Begin loading from url and call onLoad with the response content.
*
* @param url — A string containing the path/URL of the file.
* @param onLoad — A function to be called after loading is successfully completed. The function
* receives the loaded SVGDocument as an argument.
*/
public native void load(String url, OnLoadCallback<V> onLoad);

/**
* Begin loading from url and call onLoad with the response content.
*
* @param url — A string containing the path/URL of the file.
* @param onLoad — A function to be called after loading is successfully completed. The function receives the loaded SVGDocument as an argument.
* @param onProgress — A function to be called while the loading is in progress. The argument will be the XMLHttpRequest instance, which contains total and loaded bytes.
*/
public native void load(String url, OnLoadCallback<V> onLoad, OnProgressCallback onProgress);
/**
* Begin loading from url and call onLoad with the response content.
*
* @param url — A string containing the path/URL of the file.
* @param onLoad — A function to be called after loading is successfully completed. The function
* receives the loaded SVGDocument as an argument.
* @param onProgress — A function to be called while the loading is in progress. The argument will
* be the XMLHttpRequest instance, which contains total and loaded bytes.
*/
public native void load(String url, OnLoadCallback<V> onLoad, OnProgressCallback onProgress);

/**
* Begin loading from url and call onLoad with the response content.
*
* @param url — A string containing the path/URL of the file.
* @param onLoad — A function to be called after loading is successfully completed. The function receives the loaded SVGDocument as an argument.
* @param onProgress — A function to be called while the loading is in progress. The argument will be the XMLHttpRequest instance, which contains total and loaded bytes.
* @param onError — A function to be called if an error occurs during loading. The function receives the error as an argument.
*/
public native void load(String url, OnLoadCallback<V> onLoad, OnProgressCallback onProgress, OnErrorCallback onError);
/**
* Begin loading from url and call onLoad with the response content.
*
* @param url — A string containing the path/URL of the file.
* @param onLoad — A function to be called after loading is successfully completed. The function
* receives the loaded SVGDocument as an argument.
* @param onProgress — A function to be called while the loading is in progress. The argument will
* be the XMLHttpRequest instance, which contains total and loaded bytes.
* @param onError — A function to be called if an error occurs during loading. The function
* receives the error as an argument.
*/
public native void load(
String url, OnLoadCallback<V> onLoad, OnProgressCallback onProgress, OnErrorCallback onError);

/**
* Set the crossOrigin attribute.
*
* @param origin crossOrigin attribute
* @return instance of T
*/
public native T setCrossOrigin(String origin);
/**
* Set the crossOrigin attribute.
*
* @param origin crossOrigin attribute
* @return instance of T
*/
public native T setCrossOrigin(String origin);

/**
* Set the base path for additional resources.
*
* @param path — Base path for loading additional resources e.g. textures and .bin data.
* @return instance of T
*/
public native T setPath(String path);
/**
* Set the base path for additional resources.
*
* @param path — Base path for loading additional resources e.g. textures and .bin data.
* @return instance of T
*/
public native T setPath(String path);

/**
* Set base path for additional resources like textures. If set, this path will be used as the base path.
*
* @param path — required
* @return instance of T
*/
public native T setResourcePath(String path);
/**
* Set base path for additional resources like textures. If set, this path will be used as the
* base path.
*
* @param path — required
* @return instance of T
*/
public native T setResourcePath(String path);
}
Loading

0 comments on commit 3e85188

Please sign in to comment.