Skip to content

Commit

Permalink
Merge pull request #149 from treblereel/r98
Browse files Browse the repository at this point in the history
R98
  • Loading branch information
treblereel authored Nov 7, 2018
2 parents 6e586fe + b9f62e4 commit 55ec954
Show file tree
Hide file tree
Showing 42 changed files with 7,195 additions and 7,557 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
*.class
.project
.settings/
.classpath
.idea/
three4g-parent.iml
three4g.iml
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.97-beta2-SNAPSHOT</version>
<version>0.98-beta1-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.97-beta2-SNAPSHOT</version>
<version>0.98-beta1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand Down
13 changes: 9 additions & 4 deletions core/src/main/java/org/treblereel/gwt/three4g/audio/Audio.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,19 @@ public class Audio extends Object3D {
public boolean hasPlaybackControl;

/**
* Speed of playback. Default is 1.
* Whether the audio is currently playing.
*/
public float playbackRate;
public boolean isPlaying;

/**
* Whether the audio is currently playing.
* A reference to the listener object of this audio.
*/
public boolean isPlaying;
public AudioListener listener;

/**
* Speed of playback. Default is 1.
*/
public float playbackRate;

/**
* The time at which the sound should begin to play. Same as the when paramter of AudioBufferSourceNode.start(). Default is 0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ public class AudioListener extends Object3D {
*/
public AudioNode filter;

/**
* Time delta value for audio entities. Use in context of AudioParam.linearRampToValueAtTimeDefault(). Default is 0.
*/
public float timeDelta;

/**
* Create a new AudioListener.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.treblereel.gwt.three4g.cameras;

import jsinterop.annotations.JsType;
import org.treblereel.gwt.three4g.cameras.params.CubeCameraOptions;
import org.treblereel.gwt.three4g.core.Object3D;
import org.treblereel.gwt.three4g.renderers.WebGLRenderTargetCube;
import org.treblereel.gwt.three4g.renderers.WebGLRenderer;
Expand Down Expand Up @@ -31,6 +32,18 @@ public CubeCamera(float near, float far, float cubeResolution) {

}

/**
* Constructs a CubeCamera that contains 6 PerspectiveCameras that render to a WebGLRenderTargetCube.
*
* @param near -- The near clipping distance.
* @param far -- The far clipping distance
* @param cubeResolution -- Sets the length of the cube's edges.
* @param options -- CubeCameraOptions
*/
public CubeCamera(float near, float far, float cubeResolution, CubeCameraOptions options) {

}

/**
* Call this to update the renderTarget.
*
Expand All @@ -50,26 +63,26 @@ public CubeCamera(float near, float far, float cubeResolution) {
* Call this to clear the renderTarget color, depth, and/or stencil buffers. The color buffer is set to the renderer's current clear color. Arguments default to true.
*
* @param renderer instance of WebGLRenderer
* @param color clear the color buffer
* @param color clear the color buffer
*/
public native void clear(WebGLRenderer renderer, boolean color);

/**
* Call this to clear the renderTarget color, depth, and/or stencil buffers. The color buffer is set to the renderer's current clear color. Arguments default to true.
*
* @param renderer instance of WebGLRenderer
* @param color clear the color buffer
* @param depth clear the depth buffer
* @param color clear the color buffer
* @param depth clear the depth buffer
*/
public native void clear(WebGLRenderer renderer, boolean color, boolean depth);

/**
* Call this to clear the renderTarget color, depth, and/or stencil buffers. The color buffer is set to the renderer's current clear color. Arguments default to true.
*
* @param renderer instance of WebGLRenderer
* @param color clear the color buffer
* @param depth clear the depth buffer
* @param stencil clear the stencil buffer
* @param color clear the color buffer
* @param depth clear the depth buffer
* @param stencil clear the stencil buffer
*/
public native void clear(WebGLRenderer renderer, boolean color, boolean depth, boolean stencil);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.treblereel.gwt.three4g.cameras.params;


import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsType;

/**
* @author Dmitrii Tikhomirov
* Created by treblereel 11/2/18
*/
@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
public class CubeCameraOptions {

public int format; //default THREE4G.RGBFormat
public int magFilter; //default THREE4G.LinearFilter
public int minFilter; //default THREE4G.LinearFilter
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ public ArrowHelper(Vector3 dir, Vector3 origin, Number length, Number hex, Numbe

}

/**
* Return a copy of this ArrowHelper.
*
* @param source instance of ArrowHelper
* @return instance of ArrowHelper
*/
public native ArrowHelper copy(ArrowHelper source);

/**
* Return a copy of this ArrowHelper.
*
* @return instance of ArrowHelper
*/
public native ArrowHelper clone();

/**
* @param hex -- The hexadecimal value of the color.
* Sets the color of the arrowHelper.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@ public Box3Helper(Box3 box, Color color) {

}

/**
* Return a copy of this ArrowHelper.
*
* @param source instance of Box3Helper
* @return instance of Box3Helper
*/
public native Box3Helper copy(Box3Helper source);

/**
* Return a copy of this Box3Helper.
*
* @return instance of Box3Helper
*/
public native Box3Helper clone();

/**
* This overrides the method in the base Object3D class so that it also updates the wireframe box to the extent of the .box property.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public class AnimationLoader {
public LoadingManager manager;

@JsConstructor
public AnimationLoader(){
public AnimationLoader() {

}

@JsConstructor
public AnimationLoader(LoadingManager manager){
public AnimationLoader(LoadingManager manager) {

}

Expand Down Expand Up @@ -66,11 +66,20 @@ public AnimationLoader(LoadingManager manager){
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 json — required
* @param onLoad — Will be called when parsing completes.
*/
public native void parse (JSONObject json, OnLoadCallback<AnimationClip> onLoad ); //TODO checkit
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 @@ -20,17 +20,17 @@ public class AudioLoader {
public LoadingManager manager;

@JsConstructor
public AudioLoader(){
public AudioLoader() {

}

@JsConstructor
public AudioLoader(String context){
public AudioLoader(String context) {

}

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

}

Expand Down Expand Up @@ -69,4 +69,12 @@ public AudioLoader(String context, LoadingManager manager){
*/
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 @@ -71,4 +71,13 @@ public BufferGeometryLoader(LoadingManager manager) {
* @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 @@ -76,7 +76,7 @@ public DataTextureLoader(LoadingManager manager) {
* 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
* @return instance of a Loader
*/
public native T setPath(String path);
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,16 @@ public MaterialLoader(LoadingManager loadingManager) {

/**
* @param textures — object containing any textures used by the material.
* @return instance of MaterialLoader
*/
public native void setTextures(Texture[] textures);
public native MaterialLoader setTextures(Texture[] textures);

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

}
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ public class ObjectLoader {
public LoadingManager manager;

/**
* The base path or URL from which textures will be loaded. See .setTexturePath. Default is the empty string.
* The base path or URL from which additional resources like textuures will be loaded. See .setResourcePath. Default is the empty string.
*/
public String texturePath;
public String resourcePath;

@JsConstructor
public ObjectLoader() {
Expand Down Expand Up @@ -188,9 +188,19 @@ public ObjectLoader(LoadingManager manager) {
public native ObjectLoader setCrossOrigin(String value);

/**
* @param value — The base path or URL from which textures will be loaded.
* Set the base path for the original file.
*
* @param path — Base path of the file to load.
* @return instance of MaterialLoader
*/
public native ObjectLoader setPath(String path);

/**
* Set the base path for dependent resources like textures.
*
* @param value — The base path or URL from which resources will be loaded.
* @return instance of ObjectLoader
*/
public native ObjectLoader setTexturePath(String value);
public native ObjectLoader setResourcePath(String value);

}
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,6 @@ public class Material extends EventDispatcher {
*/
public float opacity;

/**
* Amount of triangle expansion at draw time. This is a workaround for cases when gaps appear between triangles when using CanvasRenderer. 0.5 tends to give good results across browsers. Default is 0.
*/
public float overdraw;

/**
* Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,6 @@ public class MaterialParameters {
*/
public float opacity;

/**
* Amount of triangle expansion at draw time. This is a workaround for cases when gaps appear between triangles when using CanvasRenderer. 0.5 tends to give good results across browsers. Default is 0.
*/
public float overdraw;

/**
* Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ public Line(AbstractGeometry geometry, Material material) {
*/
public native void raycast(Raycaster raycaster, Object[] intersects);

/**
* Return a copy of this Line.
*
* @param source instance of Line
* @return instance of Line
*/
public native Line copy(Line source);

/**
* Returns a clone of this Line object and its descendants.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class WebVRManager {
//default false
public boolean enabled;

public float framebufferScaleFactor; // 1.0

public boolean isPresenting;

public String frameOfReferenceType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public class WebXRManager {

public boolean enabled;

public float framebufferScaleFactor; // 1.0

public boolean isPresenting;

public String frameOfReferenceType;
Expand Down
Loading

0 comments on commit 55ec954

Please sign in to comment.