|
@@ -2915,6 +2915,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
this.height = source.height;
|
|
|
this.depth = source.depth;
|
|
|
|
|
|
+ this.scissor.copy( source.scissor );
|
|
|
+ this.scissorTest = source.scissorTest;
|
|
|
+
|
|
|
this.viewport.copy( source.viewport );
|
|
|
|
|
|
this.texture = source.texture.clone();
|
|
@@ -3090,8 +3093,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
this.height = source.height;
|
|
|
this.depth = source.depth;
|
|
|
|
|
|
- this.viewport.set( 0, 0, this.width, this.height );
|
|
|
- this.scissor.set( 0, 0, this.width, this.height );
|
|
|
+ this.scissor.copy( source.scissor );
|
|
|
+ this.scissorTest = source.scissorTest;
|
|
|
+
|
|
|
+ this.viewport.copy( source.viewport );
|
|
|
|
|
|
this.depthBuffer = source.depthBuffer;
|
|
|
this.stencilBuffer = source.stencilBuffer;
|
|
@@ -11307,7 +11312,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
const _inverseMatrix$2 = /*@__PURE__*/ new Matrix4();
|
|
|
const _ray$2 = /*@__PURE__*/ new Ray();
|
|
|
- const _sphere$4 = /*@__PURE__*/ new Sphere();
|
|
|
+ const _sphere$5 = /*@__PURE__*/ new Sphere();
|
|
|
const _sphereHitAt = /*@__PURE__*/ new Vector3();
|
|
|
|
|
|
const _vA$1 = /*@__PURE__*/ new Vector3();
|
|
@@ -11439,12 +11444,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
- if ( this.isSkinnedMesh ) {
|
|
|
-
|
|
|
- this.applyBoneTransform( index, target );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
return target;
|
|
|
|
|
|
}
|
|
@@ -11461,14 +11460,14 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
|
|
|
|
|
|
- _sphere$4.copy( geometry.boundingSphere );
|
|
|
- _sphere$4.applyMatrix4( matrixWorld );
|
|
|
+ _sphere$5.copy( geometry.boundingSphere );
|
|
|
+ _sphere$5.applyMatrix4( matrixWorld );
|
|
|
|
|
|
_ray$2.copy( raycaster.ray ).recast( raycaster.near );
|
|
|
|
|
|
- if ( _sphere$4.containsPoint( _ray$2.origin ) === false ) {
|
|
|
+ if ( _sphere$5.containsPoint( _ray$2.origin ) === false ) {
|
|
|
|
|
|
- if ( _ray$2.intersectSphere( _sphere$4, _sphereHitAt ) === null ) return;
|
|
|
+ if ( _ray$2.intersectSphere( _sphere$5, _sphereHitAt ) === null ) return;
|
|
|
|
|
|
if ( _ray$2.origin.distanceToSquared( _sphereHitAt ) > ( raycaster.far - raycaster.near ) ** 2 ) return;
|
|
|
|
|
@@ -11487,8 +11486,17 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
+ this._computeIntersections( raycaster, intersects );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ _computeIntersections( raycaster, intersects ) {
|
|
|
+
|
|
|
let intersection;
|
|
|
|
|
|
+ const geometry = this.geometry;
|
|
|
+ const material = this.material;
|
|
|
+
|
|
|
const index = geometry.index;
|
|
|
const position = geometry.attributes.position;
|
|
|
const uv = geometry.attributes.uv;
|
|
@@ -12940,7 +12948,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
- const _sphere$3 = /*@__PURE__*/ new Sphere();
|
|
|
+ const _sphere$4 = /*@__PURE__*/ new Sphere();
|
|
|
const _vector$6 = /*@__PURE__*/ new Vector3();
|
|
|
|
|
|
class Frustum {
|
|
@@ -13006,7 +13014,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
if ( object.boundingSphere === null ) object.computeBoundingSphere();
|
|
|
|
|
|
- _sphere$3.copy( object.boundingSphere ).applyMatrix4( object.matrixWorld );
|
|
|
+ _sphere$4.copy( object.boundingSphere ).applyMatrix4( object.matrixWorld );
|
|
|
|
|
|
} else {
|
|
|
|
|
@@ -13014,21 +13022,21 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
|
|
|
|
|
|
- _sphere$3.copy( geometry.boundingSphere ).applyMatrix4( object.matrixWorld );
|
|
|
+ _sphere$4.copy( geometry.boundingSphere ).applyMatrix4( object.matrixWorld );
|
|
|
|
|
|
}
|
|
|
|
|
|
- return this.intersectsSphere( _sphere$3 );
|
|
|
+ return this.intersectsSphere( _sphere$4 );
|
|
|
|
|
|
}
|
|
|
|
|
|
intersectsSprite( sprite ) {
|
|
|
|
|
|
- _sphere$3.center.set( 0, 0, 0 );
|
|
|
- _sphere$3.radius = 0.7071067811865476;
|
|
|
- _sphere$3.applyMatrix4( sprite.matrixWorld );
|
|
|
+ _sphere$4.center.set( 0, 0, 0 );
|
|
|
+ _sphere$4.radius = 0.7071067811865476;
|
|
|
+ _sphere$4.applyMatrix4( sprite.matrixWorld );
|
|
|
|
|
|
- return this.intersectsSphere( _sphere$3 );
|
|
|
+ return this.intersectsSphere( _sphere$4 );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -14455,25 +14463,38 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
- // Ignore background in AR
|
|
|
- // TODO: Reconsider this.
|
|
|
+ if ( background === null ) {
|
|
|
+
|
|
|
+ setClear( clearColor, clearAlpha );
|
|
|
+
|
|
|
+ } else if ( background && background.isColor ) {
|
|
|
+
|
|
|
+ setClear( background, 1 );
|
|
|
+ forceClear = true;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
const xr = renderer.xr;
|
|
|
- const session = xr.getSession && xr.getSession();
|
|
|
+ const session = xr.getSession();
|
|
|
|
|
|
- if ( session && session.environmentBlendMode === 'additive' ) {
|
|
|
+ if ( session !== null ) {
|
|
|
|
|
|
- background = null;
|
|
|
+ switch ( session.environmentBlendMode ) {
|
|
|
|
|
|
- }
|
|
|
+ case 'additive':
|
|
|
|
|
|
- if ( background === null ) {
|
|
|
+ state.buffers.color.setClear( 0, 0, 0, 1, premultipliedAlpha );
|
|
|
|
|
|
- setClear( clearColor, clearAlpha );
|
|
|
+ break;
|
|
|
|
|
|
- } else if ( background && background.isColor ) {
|
|
|
+ case 'alpha-blend':
|
|
|
+
|
|
|
+ state.buffers.color.setClear( 0, 0, 0, 0, premultipliedAlpha );
|
|
|
+
|
|
|
+ break;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
- setClear( background, 1 );
|
|
|
forceClear = true;
|
|
|
|
|
|
}
|
|
@@ -25812,6 +25833,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
const scope = this;
|
|
|
|
|
|
let session = null;
|
|
|
+
|
|
|
let framebufferScaleFactor = 1.0;
|
|
|
|
|
|
let referenceSpace = null;
|
|
@@ -26061,7 +26083,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
const layerInit = {
|
|
|
antialias: ( session.renderState.layers === undefined ) ? attributes.antialias : true,
|
|
|
- alpha: attributes.alpha,
|
|
|
+ alpha: true,
|
|
|
depth: attributes.depth,
|
|
|
stencil: attributes.stencil,
|
|
|
framebufferScaleFactor: framebufferScaleFactor
|
|
@@ -30891,6 +30913,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
const _matrix4 = /*@__PURE__*/ new Matrix4();
|
|
|
const _vertex = /*@__PURE__*/ new Vector3();
|
|
|
|
|
|
+ const _sphere$3 = /*@__PURE__*/ new Sphere();
|
|
|
+
|
|
|
class SkinnedMesh extends Mesh {
|
|
|
|
|
|
constructor( geometry, material ) {
|
|
@@ -30972,6 +30996,29 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
+ raycast( raycaster, intersects ) {
|
|
|
+
|
|
|
+ if ( this.boundingSphere === null ) this.computeBoundingSphere();
|
|
|
+
|
|
|
+ _sphere$3.copy( this.boundingSphere );
|
|
|
+ _sphere$3.applyMatrix4( this.matrixWorld );
|
|
|
+
|
|
|
+ if ( raycaster.ray.intersectsSphere( _sphere$3 ) === false ) return;
|
|
|
+
|
|
|
+ this._computeIntersections( raycaster, intersects );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ getVertexPosition( index, target ) {
|
|
|
+
|
|
|
+ super.getVertexPosition( index, target );
|
|
|
+
|
|
|
+ this.applyBoneTransform( index, target );
|
|
|
+
|
|
|
+ return target;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
bind( skeleton, bindMatrix ) {
|
|
|
|
|
|
this.skeleton = skeleton;
|
|
@@ -44615,25 +44662,31 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
onLoad( audioBuffer );
|
|
|
|
|
|
- } );
|
|
|
+ }, handleError );
|
|
|
|
|
|
} catch ( e ) {
|
|
|
|
|
|
- if ( onError ) {
|
|
|
+ handleError( e );
|
|
|
|
|
|
- onError( e );
|
|
|
+ }
|
|
|
|
|
|
- } else {
|
|
|
+ }, onProgress, onError );
|
|
|
|
|
|
- console.error( e );
|
|
|
+ function handleError( e ) {
|
|
|
|
|
|
- }
|
|
|
+ if ( onError ) {
|
|
|
|
|
|
- scope.manager.itemError( url );
|
|
|
+ onError( e );
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ console.error( e );
|
|
|
|
|
|
}
|
|
|
|
|
|
- }, onProgress, onError );
|
|
|
+ scope.manager.itemError( url );
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|