|
@@ -3,7 +3,7 @@
|
|
|
* Copyright 2010-2022 Three.js Authors
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
*/
|
|
|
-const REVISION = '137';
|
|
|
+const REVISION = '138dev';
|
|
|
const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
|
const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
|
const CullFaceNone = 0;
|
|
@@ -8766,13 +8766,13 @@ class Material extends EventDispatcher {
|
|
|
data.stencilZPass = this.stencilZPass;
|
|
|
|
|
|
// rotation (SpriteMaterial)
|
|
|
- if ( this.rotation && this.rotation !== 0 ) data.rotation = this.rotation;
|
|
|
+ if ( this.rotation !== undefined && this.rotation !== 0 ) data.rotation = this.rotation;
|
|
|
|
|
|
if ( this.polygonOffset === true ) data.polygonOffset = true;
|
|
|
if ( this.polygonOffsetFactor !== 0 ) data.polygonOffsetFactor = this.polygonOffsetFactor;
|
|
|
if ( this.polygonOffsetUnits !== 0 ) data.polygonOffsetUnits = this.polygonOffsetUnits;
|
|
|
|
|
|
- if ( this.linewidth && this.linewidth !== 1 ) data.linewidth = this.linewidth;
|
|
|
+ if ( this.linewidth !== undefined && this.linewidth !== 1 ) data.linewidth = this.linewidth;
|
|
|
if ( this.dashSize !== undefined ) data.dashSize = this.dashSize;
|
|
|
if ( this.gapSize !== undefined ) data.gapSize = this.gapSize;
|
|
|
if ( this.scale !== undefined ) data.scale = this.scale;
|
|
@@ -14243,7 +14243,7 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
|
|
|
const stride = data.stride;
|
|
|
const offset = geometryAttribute.offset;
|
|
|
|
|
|
- if ( data && data.isInstancedInterleavedBuffer ) {
|
|
|
+ if ( data.isInstancedInterleavedBuffer ) {
|
|
|
|
|
|
for ( let i = 0; i < programAttribute.locationSize; i ++ ) {
|
|
|
|
|
@@ -20705,7 +20705,7 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- function getDepthMaterial( object, geometry, material, light, shadowCameraNear, shadowCameraFar, type ) {
|
|
|
+ function getDepthMaterial( object, material, light, shadowCameraNear, shadowCameraFar, type ) {
|
|
|
|
|
|
let result = null;
|
|
|
|
|
@@ -20817,7 +20817,7 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
|
|
|
|
|
|
if ( groupMaterial && groupMaterial.visible ) {
|
|
|
|
|
|
- const depthMaterial = getDepthMaterial( object, geometry, groupMaterial, light, shadowCamera.near, shadowCamera.far, type );
|
|
|
+ const depthMaterial = getDepthMaterial( object, groupMaterial, light, shadowCamera.near, shadowCamera.far, type );
|
|
|
|
|
|
_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group );
|
|
|
|
|
@@ -20827,7 +20827,7 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
|
|
|
|
|
|
} else if ( material.visible ) {
|
|
|
|
|
|
- const depthMaterial = getDepthMaterial( object, geometry, material, light, shadowCamera.near, shadowCamera.far, type );
|
|
|
+ const depthMaterial = getDepthMaterial( object, material, light, shadowCamera.near, shadowCamera.far, type );
|
|
|
|
|
|
_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null );
|
|
|
|
|
@@ -22325,8 +22325,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
const renderTargetProperties = properties.get( renderTarget );
|
|
|
const textureProperties = properties.get( texture );
|
|
|
|
|
|
- if ( ! renderTarget ) return;
|
|
|
-
|
|
|
if ( textureProperties.__webglTexture !== undefined ) {
|
|
|
|
|
|
_gl.deleteTexture( textureProperties.__webglTexture );
|
|
@@ -22939,7 +22937,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
_gl.pixelStorei( 3317, texture.unpackAlignment );
|
|
|
_gl.pixelStorei( 37443, 0 );
|
|
|
|
|
|
- const isCompressed = ( texture && ( texture.isCompressedTexture || texture.image[ 0 ].isCompressedTexture ) );
|
|
|
+ const isCompressed = ( texture.isCompressedTexture || texture.image[ 0 ].isCompressedTexture );
|
|
|
const isDataTexture = ( texture.image[ 0 ] && texture.image[ 0 ].isDataTexture );
|
|
|
|
|
|
const cubeImage = [];
|
|
@@ -27481,7 +27479,7 @@ function WebGLRenderer( parameters = {} ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- if ( !! geometry && ( geometry.morphAttributes.position !== undefined || geometry.morphAttributes.normal !== undefined ) ) {
|
|
|
+ if ( geometry.morphAttributes.position !== undefined || geometry.morphAttributes.normal !== undefined ) {
|
|
|
|
|
|
morphtargets.update( object, geometry, material, program );
|
|
|
|
|
@@ -32762,9 +32760,9 @@ class CurvePath extends Curve {
|
|
|
for ( let i = 0, curves = this.curves; i < curves.length; i ++ ) {
|
|
|
|
|
|
const curve = curves[ i ];
|
|
|
- const resolution = ( curve && curve.isEllipseCurve ) ? divisions * 2
|
|
|
- : ( curve && ( curve.isLineCurve || curve.isLineCurve3 ) ) ? 1
|
|
|
- : ( curve && curve.isSplineCurve ) ? divisions * curve.points.length
|
|
|
+ const resolution = curve.isEllipseCurve ? divisions * 2
|
|
|
+ : ( curve.isLineCurve || curve.isLineCurve3 ) ? 1
|
|
|
+ : curve.isSplineCurve ? divisions * curve.points.length
|
|
|
: divisions;
|
|
|
|
|
|
const pts = curve.getPoints( resolution );
|
|
@@ -36054,7 +36052,8 @@ function isUniqueEdge( start, end, edges ) {
|
|
|
|
|
|
} else {
|
|
|
|
|
|
- edges.add( hash1, hash2 );
|
|
|
+ edges.add( hash1 );
|
|
|
+ edges.add( hash2 );
|
|
|
return true;
|
|
|
|
|
|
}
|
|
@@ -46552,13 +46551,13 @@ class Raycaster {
|
|
|
|
|
|
setFromCamera( coords, camera ) {
|
|
|
|
|
|
- if ( camera && camera.isPerspectiveCamera ) {
|
|
|
+ if ( camera.isPerspectiveCamera ) {
|
|
|
|
|
|
this.ray.origin.setFromMatrixPosition( camera.matrixWorld );
|
|
|
this.ray.direction.set( coords.x, coords.y, 0.5 ).unproject( camera ).sub( this.ray.origin ).normalize();
|
|
|
this.camera = camera;
|
|
|
|
|
|
- } else if ( camera && camera.isOrthographicCamera ) {
|
|
|
+ } else if ( camera.isOrthographicCamera ) {
|
|
|
|
|
|
this.ray.origin.set( coords.x, coords.y, ( camera.near + camera.far ) / ( camera.near - camera.far ) ).unproject( camera ); // set origin in plane of camera
|
|
|
this.ray.direction.set( 0, 0, - 1 ).transformDirection( camera.matrixWorld );
|
|
@@ -47256,7 +47255,7 @@ function getBoneList( object ) {
|
|
|
|
|
|
const boneList = [];
|
|
|
|
|
|
- if ( object && object.isBone ) {
|
|
|
+ if ( object.isBone === true ) {
|
|
|
|
|
|
boneList.push( object );
|
|
|
|