Skip to content

Commit

Permalink
updated to r107 core components and extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitrii Tikhomirov committed Jul 12, 2020
1 parent 7569cad commit 62c3d94
Show file tree
Hide file tree
Showing 39 changed files with 1,622 additions and 1,133 deletions.
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.106, implements 0.106 version of three.js
Current Version 0.107, implements 0.107 version of three.js

```xml
<dependency>
<groupId>org.treblereel.gwt</groupId>
<artifactId>three4g</artifactId>
<version>0.106</version>
<version>0.107</version>
</dependency>
```
# Setup
Expand Down
28 changes: 24 additions & 4 deletions core/src/main/java/org/treblereel/gwt/three4g/THREE.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ public class THREE {
public static int ClampToEdgeWrapping;
public static int MirroredRepeatWrapping;
public static int NearestFilter;
public static int NearestMipMapNearestFilter;
public static int NearestMipMapLinearFilter;
public static int NearestMipmapNearestFilter;
public static int NearestMipmapLinearFilter;
public static int LinearFilter;
public static int LinearMipMapNearestFilter;
public static int LinearMipMapLinearFilter;
public static int LinearMipmapNearestFilter;
public static int LinearMipmapLinearFilter;
public static int UnsignedByteType;
public static int ByteType;
public static int ShortType;
Expand Down Expand Up @@ -159,4 +159,24 @@ public class THREE {
public static int TangentSpaceNormalMap;
public static int ObjectSpaceNormalMap;

public static int NeverStencilFunc;
public static int LessStencilFunc;
public static int EqualStencilFunc;
public static int LessEqualStencilFunc;
public static int GreaterStencilFunc;
public static int NotEqualStencilFunc;
public static int GreaterEqualStencilFunc;
public static int AlwaysStencilFunc;

public static int ZeroStencilOp;
public static int KeepStencilOp;
public static int ReplaceStencilOp;
public static int IncrementStencilOp;
public static int DecrementStencilOp;
public static int IncrementWrapStencilOp;
public static int DecrementWrapStencilOp;
public static int InvertStencilOp;



}
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,46 @@ public class Material extends EventDispatcher {
*/
public boolean depthWrite;

/**
* Whether stencil operations are performed against the stencil buffer. In order to perform writes or comparisons against the stencil buffer this value must be true. Default is false.
*/
public boolean stencilWrite;

/**
* The bit mask to use when writing to the stencil buffer. Default is 0xFF.
*/
public int stencilWriteMask;

/**
* The stencil comparison function to use. Default is AlwaysStencilFunc. See stencil function constants for all possible values.
*/
public int stencilFunc;

/**
* The bit mask to use when comparing against the stencil buffer. Default is 0xFF.
*/
public int stencilFuncMask;

/**
* The value to use when performing stencil comparisons or stencil operations. Default is 0.
*/
public int stencilRef;

/**
* Which stencil operation to perform when the comparison function returns false. Default is KeepStencilOp. See the stencil operations constants for all possible values.
*/
public int stencilFail;

/**
* Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is KeepStencilOp. See the stencil operations constants for all possible values.
*/
public int stencilZFail;

/**
* Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is KeepStencilOp. See the stencil operations constants for all possible values.
*/
public int stencilZPass;

/**
* Define whether the material is rendered with flat shading. Default is false.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public class MeshStandardMaterial extends Material {
public float emissiveIntensity;

/**
* The environment map. Default is null. Note that in order for the material roughness property to correctly blur out the environment map, the shader must have access to mipmaps of the env texture. TextureCubes created with default settings are correctly configured; if adjusting texture parameters manually, ensure minFilter is set to one of the MipMap options, and that mip maps have not been otherwise forcibly disabled.
* The environment map. Default is null. Note that in order for the material roughness property to correctly blur out the environment map, the shader must have access to mipmaps of the env texture. TextureCubes created with default settings are correctly configured; if adjusting texture parameters manually, ensure minFilter is set to one of the Mipmap options, and that mip maps have not been otherwise forcibly disabled.
*/
public CubeTexture envMap;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public class MeshStandardMaterialParameters extends MaterialParameters{
public float emissiveIntensity;

/**
* The environment map. Default is null. Note that in order for the material roughness property to correctly blur out the environment map, the shader must have access to mipmaps of the env texture. TextureCubes created with default settings are correctly configured; if adjusting texture parameters manually, ensure minFilter is set to one of the MipMap options, and that mip maps have not been otherwise forcibly disabled.
* The environment map. Default is null. Note that in order for the material roughness property to correctly blur out the environment map, the shader must have access to mipmaps of the env texture. TextureCubes created with default settings are correctly configured; if adjusting texture parameters manually, ensure minFilter is set to one of the Mipmap options, and that mip maps have not been otherwise forcibly disabled.
*/
public Texture envMap;

Expand Down
20 changes: 0 additions & 20 deletions core/src/main/java/org/treblereel/gwt/three4g/math/Euler.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,6 @@ public Euler(float x, float y, float z, String order) {
*/
public native Euler setFromRotationMatrix(Matrix4 m, String order);

/**
* Sets the angles of this euler transform from a pure rotation matrix based on the orientation specified by order.
*
* @param m - a Matrix4 of which the upper 3x3 of matrix is a pure rotation matrix (i.e. unscaled).
* @param order - a string representing the order that the rotations are applied.
* @param update - whether to call onChangeCallback() after applying the matrix.
* @return Euler
*/
public native Euler setFromRotationMatrix(Matrix4 m, String order, boolean update);

/**
* Sets the angles of this euler transform from a normalized quaternion based on the orientation specified by order.
*
Expand All @@ -180,16 +170,6 @@ public Euler(float x, float y, float z, String order) {
*/
public native Euler setFromQuaternion(Quaternion q, String order);

/**
* Sets the angles of this euler transform from a normalized quaternion based on the orientation specified by order.
*
* @param q - a normalized quaternion.
* @param order - a string representing the order that the rotations are applied.
* @param update - whether to call onChangeCallback() after applying the matrix.
* @return Euler
*/
public native Euler setFromQuaternion(Quaternion q, String order, boolean update);

/**
* Set the x, y and z, and optionally update the order. onChangeCallback() is called after these changes are made.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,6 @@ public Quaternion(float x, float y, float z, float w) {
*/
public native Quaternion setFromEuler(Euler euler);

/**
* Applies euler transform to this vector by converting the Euler object to a Quaternion and applying.
*
* @param euler source Euler
* @param update true, to call onChangeCallback
* @return instance of Quaternion
*/
public native Quaternion setFromEuler(Euler euler, boolean update);

/**
* Sets this quaternion from rotation component of m.
* Adapted from the method here.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ public class WebGLRenderer {
*/
public Plane[] clippingPlanes;

/**
* The renderer obtains a RenderingContext context from its domElement by default, using HTMLCanvasElement.getContext().
* You can create this manually, however it must correspond to the domElement in order to render to the screen.
*/
public WebGLRenderingContext context;

/**
* A canvas where the renderer draws its output.
* This is automatically created by the renderer in the constructor (if not provided already); you just need to
Expand Down Expand Up @@ -385,6 +379,18 @@ public WebGLRenderer(WebGLRendererParameters params) {
*/
public native WebGLContextAttributes getContextAttributes();

/**
* Returns the current active cube face.
* @return int value
*/
public native int getActiveCubeFace();

/**
* Returns the current active mipmap level.
* @return int value
*/
public native int getActiveMipmapLevel();

/**
* Returns the current RenderTarget, if any.
* @return RenderTarget
Expand All @@ -408,9 +414,9 @@ public WebGLRenderer(WebGLRendererParameters params) {
* This method sets the active rendertarget. If the parameter is omitted the canvas is set as the active rendertarget.
* @param renderTarget -- The renderTarget that needs to be activated (optional).
* @param activeCubeFace -- Specifies the active cube side (PX 0, NX 1, PY 2, NY 3, PZ 4, NZ 5) of [page:WebGLRenderTargetCube] (optional).
* @param activeMipMapLevel -- Specifies the active mipmap level (optional).
* @param activeMipmapLevel -- Specifies the active mipmap level (optional).
*/
public native void setRenderTarget(WebGLRenderTarget renderTarget, int activeCubeFace, int activeMipMapLevel);
public native void setRenderTarget(WebGLRenderTarget renderTarget, int activeCubeFace, int activeMipmapLevel);

/**
* Returns the current CurrentViewport.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public CanvasTexture(HTMLElement canvas) {
* @param wrapS -- The default is THREE.ClampToEdgeWrapping. See wrap mode constants for other choices.
* @param wrapT -- The default is THREE.ClampToEdgeWrapping. See wrap mode constants for other choices.
* @param magFilter -- How the texture is sampled when a texel covers more than one pixel. The default is THREE.LinearFilter. See magnification filter constants for other choices.
* @param minFilter -- How the texture is sampled when a texel covers less than one pixel. The default is THREE.LinearMipMapLinearFilter. See minification filter constants for other choices.
* @param minFilter -- How the texture is sampled when a texel covers less than one pixel. The default is THREE.LinearMipmapLinearFilter. See minification filter constants for other choices.
* @param format -- The format used in the texture. See format constants for other choices.
* @param anisotropy -- The number of samples taken along the axis through the pixel that has the highest density of texels. By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use renderer.getMaxAnisotropy() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
* @param type -- Default is THREE.UnsignedByteType. See type constants for other choices.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class CompressedTexture extends Texture {
* @param wrapS -- The default is THREE.ClampToEdgeWrapping. See wrap mode constants for other choices.
* @param wrapT -- The default is THREE.ClampToEdgeWrapping. See wrap mode constants for other choices.
* @param magFilter -- How the texture is sampled when a texel covers more than one pixel. The default is THREE.LinearFilter. See magnification filter constants for other choices.
* @param minFilter -- How the texture is sampled when a texel covers less than one pixel. The default is THREE.LinearMipMapLinearFilter. See minification filter constants for other choices.
* @param minFilter -- How the texture is sampled when a texel covers less than one pixel. The default is THREE.LinearMipmapLinearFilter. See minification filter constants for other choices.
* @param anisotropy -- The number of samples taken along the axis through the pixel that has the highest density of texels. By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use renderer.getMaxAnisotropy() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
*/
@JsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public class Texture extends EventDispatcher {
public int magFilter;

/**
* How the texture is sampled when a texel covers less than one pixel. The default is THREE.LinearMipMapLinearFilter,
* How the texture is sampled when a texel covers less than one pixel. The default is THREE.LinearMipmapLinearFilter,
* which uses mipmapping and a trilinear filter.
* <p>
* See the texture constants page for all possible choices.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class VideoTexture extends Texture {
* @param wrapS -- The default is THREE.ClampToEdgeWrapping. See wrap mode constants for other choices.
* @param wrapT -- The default is THREE.ClampToEdgeWrapping. See wrap mode constants for other choices.
* @param magFilter -- How the texture is sampled when a texel covers more than one pixel. The default is THREE.LinearFilter. See magnification filter constants for other choices.
* @param minFilter -- How the texture is sampled when a texel covers less than one pixel. The default is THREE.LinearMipMapLinearFilter. See minification filter constants for other choices.
* @param minFilter -- How the texture is sampled when a texel covers less than one pixel. The default is THREE.LinearMipmapLinearFilter. See minification filter constants for other choices.
* @param format -- The format used in the texture. See format constants for other choices.
* @param type -- Default is THREE.UnsignedByteType. See type constants for other choices.
* @param anisotropy -- The number of samples taken along the axis through the pixel that has the highest density of texels. By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use renderer.getMaxAnisotropy() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
Expand Down
Loading

0 comments on commit 62c3d94

Please sign in to comment.