@plastic-software/three 0.178.0 → 0.179.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/build/three.cjs +856 -196
- package/build/three.core.js +647 -123
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +211 -76
- package/build/three.module.min.js +1 -1
- package/build/three.tsl.js +70 -21
- package/build/three.tsl.min.js +1 -1
- package/build/three.webgpu.js +1796 -557
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +1754 -557
- package/build/three.webgpu.nodes.min.js +1 -1
- package/examples/jsm/Addons.js +1 -2
- package/examples/jsm/capabilities/WebGPU.js +1 -1
- package/examples/jsm/csm/CSMShadowNode.js +4 -4
- package/examples/jsm/environments/RoomEnvironment.js +8 -3
- package/examples/jsm/exporters/USDZExporter.js +676 -299
- package/examples/jsm/geometries/RoundedBoxGeometry.js +47 -8
- package/examples/jsm/interactive/HTMLMesh.js +5 -3
- package/examples/jsm/libs/meshopt_decoder.module.js +75 -58
- package/examples/jsm/lights/LightProbeGenerator.js +14 -3
- package/examples/jsm/loaders/EXRLoader.js +210 -22
- package/examples/jsm/loaders/FBXLoader.js +1 -1
- package/examples/jsm/loaders/MaterialXLoader.js +212 -30
- package/examples/jsm/loaders/TTFLoader.js +13 -1
- package/examples/jsm/loaders/USDLoader.js +219 -0
- package/examples/jsm/loaders/USDZLoader.js +4 -892
- package/examples/jsm/loaders/usd/USDAParser.js +741 -0
- package/examples/jsm/loaders/usd/USDCParser.js +17 -0
- package/examples/jsm/objects/LensflareMesh.js +3 -3
- package/examples/jsm/objects/SkyMesh.js +2 -2
- package/examples/jsm/physics/RapierPhysics.js +14 -5
- package/examples/jsm/postprocessing/GTAOPass.js +10 -9
- package/examples/jsm/postprocessing/OutlinePass.js +17 -17
- package/examples/jsm/postprocessing/SSAOPass.js +10 -9
- package/examples/jsm/shaders/UnpackDepthRGBAShader.js +11 -2
- package/examples/jsm/transpiler/GLSLDecoder.js +2 -2
- package/examples/jsm/tsl/display/BloomNode.js +8 -7
- package/examples/jsm/tsl/display/GaussianBlurNode.js +6 -8
- package/examples/jsm/tsl/display/{TRAAPassNode.js → TRAANode.js} +181 -172
- package/examples/jsm/tsl/lighting/TiledLightsNode.js +1 -1
- package/package.json +1 -1
- package/src/Three.Core.js +1 -0
- package/src/Three.TSL.js +69 -20
- package/src/animation/KeyframeTrack.js +1 -1
- package/src/animation/tracks/BooleanKeyframeTrack.js +1 -1
- package/src/animation/tracks/StringKeyframeTrack.js +1 -1
- package/src/cameras/Camera.js +14 -0
- package/src/cameras/OrthographicCamera.js +1 -1
- package/src/cameras/PerspectiveCamera.js +1 -1
- package/src/constants.js +1 -1
- package/{examples/jsm/misc → src/core}/Timer.js +4 -42
- package/src/extras/PMREMGenerator.js +11 -0
- package/src/helpers/CameraHelper.js +41 -11
- package/src/helpers/SkeletonHelper.js +35 -6
- package/src/lights/LightShadow.js +21 -8
- package/src/lights/PointLightShadow.js +1 -1
- package/src/loaders/FileLoader.js +25 -2
- package/src/loaders/ImageBitmapLoader.js +23 -0
- package/src/loaders/Loader.js +14 -0
- package/src/loaders/LoadingManager.js +23 -0
- package/src/materials/MeshBasicMaterial.js +1 -1
- package/src/materials/nodes/Line2NodeMaterial.js +0 -8
- package/src/materials/nodes/NodeMaterial.js +1 -1
- package/src/materials/nodes/PointsNodeMaterial.js +5 -0
- package/src/materials/nodes/manager/NodeMaterialObserver.js +87 -2
- package/src/math/Frustum.js +19 -8
- package/src/math/FrustumArray.js +10 -5
- package/src/math/Line3.js +129 -2
- package/src/math/Matrix4.js +48 -27
- package/src/math/Spherical.js +2 -2
- package/src/nodes/Nodes.js +1 -0
- package/src/nodes/TSL.js +1 -0
- package/src/nodes/accessors/Camera.js +12 -12
- package/src/nodes/accessors/Normal.js +11 -11
- package/src/nodes/accessors/ReferenceNode.js +18 -3
- package/src/nodes/accessors/SceneNode.js +1 -1
- package/src/nodes/accessors/StorageTextureNode.js +1 -1
- package/src/nodes/accessors/TextureNode.js +12 -0
- package/src/nodes/core/ArrayNode.js +12 -0
- package/src/nodes/core/AssignNode.js +3 -0
- package/src/nodes/core/ContextNode.js +20 -1
- package/src/nodes/core/Node.js +14 -2
- package/src/nodes/core/NodeBuilder.js +25 -20
- package/src/nodes/core/NodeUtils.js +4 -1
- package/src/nodes/core/StackNode.js +42 -0
- package/src/nodes/core/UniformNode.js +63 -5
- package/src/nodes/core/VarNode.js +91 -2
- package/src/nodes/display/PassNode.js +148 -2
- package/src/nodes/display/ViewportTextureNode.js +67 -7
- package/src/nodes/functions/PhysicalLightingModel.js +2 -2
- package/src/nodes/gpgpu/AtomicFunctionNode.js +1 -1
- package/src/nodes/gpgpu/ComputeNode.js +67 -23
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +28 -3
- package/src/nodes/lighting/ProjectorLightNode.js +19 -6
- package/src/nodes/lighting/ShadowFilterNode.js +1 -1
- package/src/nodes/materialx/MaterialXNodes.js +131 -2
- package/src/nodes/materialx/lib/mx_noise.js +165 -1
- package/src/nodes/math/ConditionalNode.js +1 -1
- package/src/nodes/math/MathNode.js +78 -54
- package/src/nodes/math/OperatorNode.js +22 -22
- package/src/nodes/tsl/TSLCore.js +64 -9
- package/src/nodes/utils/DebugNode.js +1 -1
- package/src/nodes/utils/EventNode.js +83 -0
- package/src/nodes/utils/RTTNode.js +9 -0
- package/src/objects/BatchedMesh.js +4 -2
- package/src/renderers/WebGLRenderer.js +21 -22
- package/src/renderers/common/Bindings.js +19 -18
- package/src/renderers/common/Color4.js +2 -2
- package/src/renderers/common/PostProcessing.js +60 -5
- package/src/renderers/common/Renderer.js +18 -15
- package/src/renderers/common/SampledTexture.js +3 -71
- package/src/renderers/common/Sampler.js +79 -0
- package/src/renderers/common/Storage3DTexture.js +21 -0
- package/src/renderers/common/StorageArrayTexture.js +21 -0
- package/src/renderers/common/StorageTexture.js +19 -0
- package/src/renderers/common/Textures.js +19 -3
- package/src/renderers/common/XRManager.js +26 -8
- package/src/renderers/common/nodes/NodeSampledTexture.js +0 -12
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +20 -2
- package/src/renderers/shaders/ShaderLib/depth.glsl.js +11 -2
- package/src/renderers/webgl/WebGLCapabilities.js +2 -2
- package/src/renderers/webgl/WebGLMaterials.js +6 -6
- package/src/renderers/webgl/WebGLProgram.js +22 -16
- package/src/renderers/webgl/WebGLPrograms.js +4 -4
- package/src/renderers/webgl/WebGLShadowMap.js +11 -1
- package/src/renderers/webgl/WebGLTextures.js +19 -7
- package/src/renderers/webgl-fallback/WebGLBackend.js +22 -12
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +2 -2
- package/src/renderers/webgpu/WebGPUBackend.js +54 -15
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +53 -73
- package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +35 -31
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +1 -1
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +11 -64
- package/src/renderers/webgpu/utils/WebGPUUtils.js +2 -17
- package/src/renderers/webxr/WebXRDepthSensing.js +6 -10
- package/src/renderers/webxr/WebXRManager.js +68 -8
- package/src/textures/ExternalTexture.js +45 -0
- package/src/textures/FramebufferTexture.js +2 -2
- package/src/textures/Source.js +11 -1
- package/src/textures/VideoTexture.js +30 -2
package/build/three.core.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2010-2025 Three.js Authors
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
5
|
*/
|
|
6
|
-
const REVISION = '
|
|
6
|
+
const REVISION = '179';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Represents mouse buttons and interaction types in context of controls.
|
|
@@ -6283,38 +6283,6 @@ function probeAsync( gl, sync, interval ) {
|
|
|
6283
6283
|
|
|
6284
6284
|
}
|
|
6285
6285
|
|
|
6286
|
-
function toNormalizedProjectionMatrix( projectionMatrix ) {
|
|
6287
|
-
|
|
6288
|
-
const m = projectionMatrix.elements;
|
|
6289
|
-
|
|
6290
|
-
// Convert [-1, 1] to [0, 1] projection matrix
|
|
6291
|
-
m[ 2 ] = 0.5 * m[ 2 ] + 0.5 * m[ 3 ];
|
|
6292
|
-
m[ 6 ] = 0.5 * m[ 6 ] + 0.5 * m[ 7 ];
|
|
6293
|
-
m[ 10 ] = 0.5 * m[ 10 ] + 0.5 * m[ 11 ];
|
|
6294
|
-
m[ 14 ] = 0.5 * m[ 14 ] + 0.5 * m[ 15 ];
|
|
6295
|
-
|
|
6296
|
-
}
|
|
6297
|
-
|
|
6298
|
-
function toReversedProjectionMatrix( projectionMatrix ) {
|
|
6299
|
-
|
|
6300
|
-
const m = projectionMatrix.elements;
|
|
6301
|
-
const isPerspectiveMatrix = m[ 11 ] === -1;
|
|
6302
|
-
|
|
6303
|
-
// Reverse [0, 1] projection matrix
|
|
6304
|
-
if ( isPerspectiveMatrix ) {
|
|
6305
|
-
|
|
6306
|
-
m[ 10 ] = - m[ 10 ] - 1;
|
|
6307
|
-
m[ 14 ] = - m[ 14 ];
|
|
6308
|
-
|
|
6309
|
-
} else {
|
|
6310
|
-
|
|
6311
|
-
m[ 10 ] = - m[ 10 ];
|
|
6312
|
-
m[ 14 ] = - m[ 14 ] + 1;
|
|
6313
|
-
|
|
6314
|
-
}
|
|
6315
|
-
|
|
6316
|
-
}
|
|
6317
|
-
|
|
6318
6286
|
const LINEAR_REC709_TO_XYZ = /*@__PURE__*/ new Matrix3().set(
|
|
6319
6287
|
0.4123908, 0.3575843, 0.1804808,
|
|
6320
6288
|
0.2126390, 0.7151687, 0.0721923,
|
|
@@ -6726,13 +6694,23 @@ class Source {
|
|
|
6726
6694
|
|
|
6727
6695
|
}
|
|
6728
6696
|
|
|
6697
|
+
/**
|
|
6698
|
+
* Returns the dimensions of the source into the given target vector.
|
|
6699
|
+
*
|
|
6700
|
+
* @param {(Vector2|Vector3)} target - The target object the result is written into.
|
|
6701
|
+
* @return {(Vector2|Vector3)} The dimensions of the source.
|
|
6702
|
+
*/
|
|
6729
6703
|
getSize( target ) {
|
|
6730
6704
|
|
|
6731
6705
|
const data = this.data;
|
|
6732
6706
|
|
|
6733
6707
|
if ( data instanceof HTMLVideoElement ) {
|
|
6734
6708
|
|
|
6735
|
-
target.set( data.videoWidth, data.videoHeight );
|
|
6709
|
+
target.set( data.videoWidth, data.videoHeight, 0 );
|
|
6710
|
+
|
|
6711
|
+
} else if ( data instanceof VideoFrame ) {
|
|
6712
|
+
|
|
6713
|
+
target.set( data.displayHeight, data.displayWidth, 0 );
|
|
6736
6714
|
|
|
6737
6715
|
} else if ( data !== null ) {
|
|
6738
6716
|
|
|
@@ -12415,11 +12393,13 @@ class Matrix4 {
|
|
|
12415
12393
|
* @param {number} near - The distance from the camera to the near plane.
|
|
12416
12394
|
* @param {number} far - The distance from the camera to the far plane.
|
|
12417
12395
|
* @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} [coordinateSystem=WebGLCoordinateSystem] - The coordinate system.
|
|
12396
|
+
* @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.
|
|
12418
12397
|
* @return {Matrix4} A reference to this matrix.
|
|
12419
12398
|
*/
|
|
12420
|
-
makePerspective( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem ) {
|
|
12399
|
+
makePerspective( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem, reversedDepth = false ) {
|
|
12421
12400
|
|
|
12422
12401
|
const te = this.elements;
|
|
12402
|
+
|
|
12423
12403
|
const x = 2 * near / ( right - left );
|
|
12424
12404
|
const y = 2 * near / ( top - bottom );
|
|
12425
12405
|
|
|
@@ -12428,19 +12408,28 @@ class Matrix4 {
|
|
|
12428
12408
|
|
|
12429
12409
|
let c, d;
|
|
12430
12410
|
|
|
12431
|
-
if (
|
|
12411
|
+
if ( reversedDepth ) {
|
|
12432
12412
|
|
|
12433
|
-
c =
|
|
12434
|
-
d = (
|
|
12413
|
+
c = near / ( far - near );
|
|
12414
|
+
d = ( far * near ) / ( far - near );
|
|
12435
12415
|
|
|
12436
|
-
} else
|
|
12416
|
+
} else {
|
|
12437
12417
|
|
|
12438
|
-
|
|
12439
|
-
d = ( - far * near ) / ( far - near );
|
|
12418
|
+
if ( coordinateSystem === WebGLCoordinateSystem ) {
|
|
12440
12419
|
|
|
12441
|
-
|
|
12420
|
+
c = - ( far + near ) / ( far - near );
|
|
12421
|
+
d = ( -2 * far * near ) / ( far - near );
|
|
12422
|
+
|
|
12423
|
+
} else if ( coordinateSystem === WebGPUCoordinateSystem ) {
|
|
12424
|
+
|
|
12425
|
+
c = - far / ( far - near );
|
|
12426
|
+
d = ( - far * near ) / ( far - near );
|
|
12427
|
+
|
|
12428
|
+
} else {
|
|
12442
12429
|
|
|
12443
|
-
|
|
12430
|
+
throw new Error( 'THREE.Matrix4.makePerspective(): Invalid coordinate system: ' + coordinateSystem );
|
|
12431
|
+
|
|
12432
|
+
}
|
|
12444
12433
|
|
|
12445
12434
|
}
|
|
12446
12435
|
|
|
@@ -12464,39 +12453,49 @@ class Matrix4 {
|
|
|
12464
12453
|
* @param {number} near - The distance from the camera to the near plane.
|
|
12465
12454
|
* @param {number} far - The distance from the camera to the far plane.
|
|
12466
12455
|
* @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} [coordinateSystem=WebGLCoordinateSystem] - The coordinate system.
|
|
12456
|
+
* @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.
|
|
12467
12457
|
* @return {Matrix4} A reference to this matrix.
|
|
12468
12458
|
*/
|
|
12469
|
-
makeOrthographic( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem ) {
|
|
12459
|
+
makeOrthographic( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem, reversedDepth = false ) {
|
|
12470
12460
|
|
|
12471
12461
|
const te = this.elements;
|
|
12472
|
-
const w = 1.0 / ( right - left );
|
|
12473
|
-
const h = 1.0 / ( top - bottom );
|
|
12474
|
-
const p = 1.0 / ( far - near );
|
|
12475
|
-
|
|
12476
|
-
const x = ( right + left ) * w;
|
|
12477
|
-
const y = ( top + bottom ) * h;
|
|
12478
12462
|
|
|
12479
|
-
|
|
12463
|
+
const x = 2 / ( right - left );
|
|
12464
|
+
const y = 2 / ( top - bottom );
|
|
12480
12465
|
|
|
12481
|
-
|
|
12466
|
+
const a = - ( right + left ) / ( right - left );
|
|
12467
|
+
const b = - ( top + bottom ) / ( top - bottom );
|
|
12482
12468
|
|
|
12483
|
-
|
|
12484
|
-
zInv = -2 * p;
|
|
12469
|
+
let c, d;
|
|
12485
12470
|
|
|
12486
|
-
|
|
12471
|
+
if ( reversedDepth ) {
|
|
12487
12472
|
|
|
12488
|
-
|
|
12489
|
-
|
|
12473
|
+
c = 1 / ( far - near );
|
|
12474
|
+
d = far / ( far - near );
|
|
12490
12475
|
|
|
12491
12476
|
} else {
|
|
12492
12477
|
|
|
12493
|
-
|
|
12478
|
+
if ( coordinateSystem === WebGLCoordinateSystem ) {
|
|
12479
|
+
|
|
12480
|
+
c = -2 / ( far - near );
|
|
12481
|
+
d = - ( far + near ) / ( far - near );
|
|
12482
|
+
|
|
12483
|
+
} else if ( coordinateSystem === WebGPUCoordinateSystem ) {
|
|
12484
|
+
|
|
12485
|
+
c = -1 / ( far - near );
|
|
12486
|
+
d = - near / ( far - near );
|
|
12487
|
+
|
|
12488
|
+
} else {
|
|
12489
|
+
|
|
12490
|
+
throw new Error( 'THREE.Matrix4.makeOrthographic(): Invalid coordinate system: ' + coordinateSystem );
|
|
12491
|
+
|
|
12492
|
+
}
|
|
12494
12493
|
|
|
12495
12494
|
}
|
|
12496
12495
|
|
|
12497
|
-
te[ 0 ] =
|
|
12498
|
-
te[ 1 ] = 0; te[ 5 ] =
|
|
12499
|
-
te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] =
|
|
12496
|
+
te[ 0 ] = x; te[ 4 ] = 0; te[ 8 ] = 0; te[ 12 ] = a;
|
|
12497
|
+
te[ 1 ] = 0; te[ 5 ] = y; te[ 9 ] = 0; te[ 13 ] = b;
|
|
12498
|
+
te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = c; te[ 14 ] = d;
|
|
12500
12499
|
te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = 0; te[ 15 ] = 1;
|
|
12501
12500
|
|
|
12502
12501
|
return this;
|
|
@@ -17290,7 +17289,7 @@ class MeshBasicMaterial extends Material {
|
|
|
17290
17289
|
* @type {Color}
|
|
17291
17290
|
* @default (1,1,1)
|
|
17292
17291
|
*/
|
|
17293
|
-
this.color = new Color( 0xffffff ); //
|
|
17292
|
+
this.color = new Color( 0xffffff ); // diffuse
|
|
17294
17293
|
|
|
17295
17294
|
/**
|
|
17296
17295
|
* The color map. May optionally include an alpha channel, typically combined
|
|
@@ -21400,6 +21399,20 @@ class Camera extends Object3D {
|
|
|
21400
21399
|
*/
|
|
21401
21400
|
this.coordinateSystem = WebGLCoordinateSystem;
|
|
21402
21401
|
|
|
21402
|
+
this._reversedDepth = false;
|
|
21403
|
+
|
|
21404
|
+
}
|
|
21405
|
+
|
|
21406
|
+
/**
|
|
21407
|
+
* The flag that indicates whether the camera uses a reversed depth buffer.
|
|
21408
|
+
*
|
|
21409
|
+
* @type {boolean}
|
|
21410
|
+
* @default false
|
|
21411
|
+
*/
|
|
21412
|
+
get reversedDepth() {
|
|
21413
|
+
|
|
21414
|
+
return this._reversedDepth;
|
|
21415
|
+
|
|
21403
21416
|
}
|
|
21404
21417
|
|
|
21405
21418
|
copy( source, recursive ) {
|
|
@@ -21827,7 +21840,7 @@ class PerspectiveCamera extends Camera {
|
|
|
21827
21840
|
const skew = this.filmOffset;
|
|
21828
21841
|
if ( skew !== 0 ) left += near * skew / this.getFilmWidth();
|
|
21829
21842
|
|
|
21830
|
-
this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far, this.coordinateSystem );
|
|
21843
|
+
this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far, this.coordinateSystem, this.reversedDepth );
|
|
21831
21844
|
|
|
21832
21845
|
this.projectionMatrixInverse.copy( this.projectionMatrix ).invert();
|
|
21833
21846
|
|
|
@@ -26391,9 +26404,10 @@ class Frustum {
|
|
|
26391
26404
|
*
|
|
26392
26405
|
* @param {Matrix4} m - The projection matrix.
|
|
26393
26406
|
* @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} coordinateSystem - The coordinate system.
|
|
26407
|
+
* @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.
|
|
26394
26408
|
* @return {Frustum} A reference to this frustum.
|
|
26395
26409
|
*/
|
|
26396
|
-
setFromProjectionMatrix( m, coordinateSystem = WebGLCoordinateSystem ) {
|
|
26410
|
+
setFromProjectionMatrix( m, coordinateSystem = WebGLCoordinateSystem, reversedDepth = false ) {
|
|
26397
26411
|
|
|
26398
26412
|
const planes = this.planes;
|
|
26399
26413
|
const me = m.elements;
|
|
@@ -26406,19 +26420,29 @@ class Frustum {
|
|
|
26406
26420
|
planes[ 1 ].setComponents( me3 + me0, me7 + me4, me11 + me8, me15 + me12 ).normalize();
|
|
26407
26421
|
planes[ 2 ].setComponents( me3 + me1, me7 + me5, me11 + me9, me15 + me13 ).normalize();
|
|
26408
26422
|
planes[ 3 ].setComponents( me3 - me1, me7 - me5, me11 - me9, me15 - me13 ).normalize();
|
|
26409
|
-
planes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize();
|
|
26410
26423
|
|
|
26411
|
-
if (
|
|
26424
|
+
if ( reversedDepth ) {
|
|
26412
26425
|
|
|
26413
|
-
planes[
|
|
26426
|
+
planes[ 4 ].setComponents( me2, me6, me10, me14 ).normalize(); // far
|
|
26427
|
+
planes[ 5 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize(); // near
|
|
26414
26428
|
|
|
26415
|
-
} else
|
|
26429
|
+
} else {
|
|
26416
26430
|
|
|
26417
|
-
planes[
|
|
26431
|
+
planes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize(); // far
|
|
26418
26432
|
|
|
26419
|
-
|
|
26433
|
+
if ( coordinateSystem === WebGLCoordinateSystem ) {
|
|
26420
26434
|
|
|
26421
|
-
|
|
26435
|
+
planes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize(); // near
|
|
26436
|
+
|
|
26437
|
+
} else if ( coordinateSystem === WebGPUCoordinateSystem ) {
|
|
26438
|
+
|
|
26439
|
+
planes[ 5 ].setComponents( me2, me6, me10, me14 ).normalize(); // near
|
|
26440
|
+
|
|
26441
|
+
} else {
|
|
26442
|
+
|
|
26443
|
+
throw new Error( 'THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: ' + coordinateSystem );
|
|
26444
|
+
|
|
26445
|
+
}
|
|
26422
26446
|
|
|
26423
26447
|
}
|
|
26424
26448
|
|
|
@@ -26624,7 +26648,8 @@ class FrustumArray {
|
|
|
26624
26648
|
|
|
26625
26649
|
_frustum$1.setFromProjectionMatrix(
|
|
26626
26650
|
_projScreenMatrix$2,
|
|
26627
|
-
|
|
26651
|
+
camera.coordinateSystem,
|
|
26652
|
+
camera.reversedDepth
|
|
26628
26653
|
);
|
|
26629
26654
|
|
|
26630
26655
|
if ( _frustum$1.intersectsObject( object ) ) {
|
|
@@ -26666,7 +26691,8 @@ class FrustumArray {
|
|
|
26666
26691
|
|
|
26667
26692
|
_frustum$1.setFromProjectionMatrix(
|
|
26668
26693
|
_projScreenMatrix$2,
|
|
26669
|
-
|
|
26694
|
+
camera.coordinateSystem,
|
|
26695
|
+
camera.reversedDepth
|
|
26670
26696
|
);
|
|
26671
26697
|
|
|
26672
26698
|
if ( _frustum$1.intersectsSprite( sprite ) ) {
|
|
@@ -26708,7 +26734,8 @@ class FrustumArray {
|
|
|
26708
26734
|
|
|
26709
26735
|
_frustum$1.setFromProjectionMatrix(
|
|
26710
26736
|
_projScreenMatrix$2,
|
|
26711
|
-
|
|
26737
|
+
camera.coordinateSystem,
|
|
26738
|
+
camera.reversedDepth
|
|
26712
26739
|
);
|
|
26713
26740
|
|
|
26714
26741
|
if ( _frustum$1.intersectsSphere( sphere ) ) {
|
|
@@ -26750,7 +26777,8 @@ class FrustumArray {
|
|
|
26750
26777
|
|
|
26751
26778
|
_frustum$1.setFromProjectionMatrix(
|
|
26752
26779
|
_projScreenMatrix$2,
|
|
26753
|
-
|
|
26780
|
+
camera.coordinateSystem,
|
|
26781
|
+
camera.reversedDepth
|
|
26754
26782
|
);
|
|
26755
26783
|
|
|
26756
26784
|
if ( _frustum$1.intersectsBox( box ) ) {
|
|
@@ -26792,7 +26820,8 @@ class FrustumArray {
|
|
|
26792
26820
|
|
|
26793
26821
|
_frustum$1.setFromProjectionMatrix(
|
|
26794
26822
|
_projScreenMatrix$2,
|
|
26795
|
-
|
|
26823
|
+
camera.coordinateSystem,
|
|
26824
|
+
camera.reversedDepth
|
|
26796
26825
|
);
|
|
26797
26826
|
|
|
26798
26827
|
if ( _frustum$1.containsPoint( point ) ) {
|
|
@@ -28059,7 +28088,7 @@ class BatchedMesh extends Mesh {
|
|
|
28059
28088
|
const availableInstanceIds = this._availableInstanceIds;
|
|
28060
28089
|
const instanceInfo = this._instanceInfo;
|
|
28061
28090
|
availableInstanceIds.sort( ascIdSort );
|
|
28062
|
-
while ( availableInstanceIds[ availableInstanceIds.length - 1 ] === instanceInfo.length ) {
|
|
28091
|
+
while ( availableInstanceIds[ availableInstanceIds.length - 1 ] === instanceInfo.length - 1 ) {
|
|
28063
28092
|
|
|
28064
28093
|
instanceInfo.pop();
|
|
28065
28094
|
availableInstanceIds.pop();
|
|
@@ -28337,9 +28366,11 @@ class BatchedMesh extends Mesh {
|
|
|
28337
28366
|
_matrix$1
|
|
28338
28367
|
.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse )
|
|
28339
28368
|
.multiply( this.matrixWorld );
|
|
28369
|
+
|
|
28340
28370
|
_frustum.setFromProjectionMatrix(
|
|
28341
28371
|
_matrix$1,
|
|
28342
|
-
|
|
28372
|
+
camera.coordinateSystem,
|
|
28373
|
+
camera.reversedDepth
|
|
28343
28374
|
);
|
|
28344
28375
|
|
|
28345
28376
|
}
|
|
@@ -29358,6 +29389,9 @@ function testPoint( point, index, localThresholdSq, matrixWorld, raycaster, inte
|
|
|
29358
29389
|
* const texture = new THREE.VideoTexture( video );
|
|
29359
29390
|
* ```
|
|
29360
29391
|
*
|
|
29392
|
+
* Note: When using video textures with {@link WebGPURenderer}, {@link Texture#colorSpace} must be
|
|
29393
|
+
* set to THREE.SRGBColorSpace.
|
|
29394
|
+
*
|
|
29361
29395
|
* Note: After the initial use of a texture, its dimensions, format, and type
|
|
29362
29396
|
* cannot be changed. Instead, call {@link Texture#dispose} on the texture and instantiate a new one.
|
|
29363
29397
|
*
|
|
@@ -29401,18 +29435,28 @@ class VideoTexture extends Texture {
|
|
|
29401
29435
|
*/
|
|
29402
29436
|
this.generateMipmaps = false;
|
|
29403
29437
|
|
|
29438
|
+
/**
|
|
29439
|
+
* The video frame request callback identifier, which is a positive integer.
|
|
29440
|
+
*
|
|
29441
|
+
* Value of 0 represents no scheduled rVFC.
|
|
29442
|
+
*
|
|
29443
|
+
* @private
|
|
29444
|
+
* @type {number}
|
|
29445
|
+
*/
|
|
29446
|
+
this._requestVideoFrameCallbackId = 0;
|
|
29447
|
+
|
|
29404
29448
|
const scope = this;
|
|
29405
29449
|
|
|
29406
29450
|
function updateVideo() {
|
|
29407
29451
|
|
|
29408
29452
|
scope.needsUpdate = true;
|
|
29409
|
-
video.requestVideoFrameCallback( updateVideo );
|
|
29453
|
+
scope._requestVideoFrameCallbackId = video.requestVideoFrameCallback( updateVideo );
|
|
29410
29454
|
|
|
29411
29455
|
}
|
|
29412
29456
|
|
|
29413
29457
|
if ( 'requestVideoFrameCallback' in video ) {
|
|
29414
29458
|
|
|
29415
|
-
video.requestVideoFrameCallback( updateVideo );
|
|
29459
|
+
this._requestVideoFrameCallbackId = video.requestVideoFrameCallback( updateVideo );
|
|
29416
29460
|
|
|
29417
29461
|
}
|
|
29418
29462
|
|
|
@@ -29443,6 +29487,21 @@ class VideoTexture extends Texture {
|
|
|
29443
29487
|
|
|
29444
29488
|
}
|
|
29445
29489
|
|
|
29490
|
+
/**
|
|
29491
|
+
* @override
|
|
29492
|
+
*/
|
|
29493
|
+
dispose() {
|
|
29494
|
+
|
|
29495
|
+
if ( this._requestVideoFrameCallbackId !== 0 ) {
|
|
29496
|
+
|
|
29497
|
+
this.source.data.cancelVideoFrameCallback( this._requestVideoFrameCallbackId );
|
|
29498
|
+
|
|
29499
|
+
}
|
|
29500
|
+
|
|
29501
|
+
super.dispose();
|
|
29502
|
+
|
|
29503
|
+
}
|
|
29504
|
+
|
|
29446
29505
|
}
|
|
29447
29506
|
|
|
29448
29507
|
/**
|
|
@@ -29543,8 +29602,8 @@ class FramebufferTexture extends Texture {
|
|
|
29543
29602
|
/**
|
|
29544
29603
|
* Constructs a new framebuffer texture.
|
|
29545
29604
|
*
|
|
29546
|
-
* @param {number} width - The width of the texture.
|
|
29547
|
-
* @param {number} height - The height of the texture.
|
|
29605
|
+
* @param {number} [width] - The width of the texture.
|
|
29606
|
+
* @param {number} [height] - The height of the texture.
|
|
29548
29607
|
*/
|
|
29549
29608
|
constructor( width, height ) {
|
|
29550
29609
|
|
|
@@ -41695,7 +41754,7 @@ class KeyframeTrack {
|
|
|
41695
41754
|
*
|
|
41696
41755
|
* @param {string} name - The keyframe track's name.
|
|
41697
41756
|
* @param {Array<number>} times - A list of keyframe times.
|
|
41698
|
-
* @param {Array<number>} values - A list of keyframe values.
|
|
41757
|
+
* @param {Array<number|string|boolean>} values - A list of keyframe values.
|
|
41699
41758
|
* @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.
|
|
41700
41759
|
*/
|
|
41701
41760
|
constructor( name, times, values, interpolation ) {
|
|
@@ -42283,7 +42342,7 @@ class BooleanKeyframeTrack extends KeyframeTrack {
|
|
|
42283
42342
|
*
|
|
42284
42343
|
* @param {string} name - The keyframe track's name.
|
|
42285
42344
|
* @param {Array<number>} times - A list of keyframe times.
|
|
42286
|
-
* @param {Array<
|
|
42345
|
+
* @param {Array<boolean>} values - A list of keyframe values.
|
|
42287
42346
|
*/
|
|
42288
42347
|
constructor( name, times, values ) {
|
|
42289
42348
|
|
|
@@ -42486,7 +42545,7 @@ class StringKeyframeTrack extends KeyframeTrack {
|
|
|
42486
42545
|
*
|
|
42487
42546
|
* @param {string} name - The keyframe track's name.
|
|
42488
42547
|
* @param {Array<number>} times - A list of keyframe times.
|
|
42489
|
-
* @param {Array<
|
|
42548
|
+
* @param {Array<string>} values - A list of keyframe values.
|
|
42490
42549
|
*/
|
|
42491
42550
|
constructor( name, times, values ) {
|
|
42492
42551
|
|
|
@@ -43309,6 +43368,13 @@ class LoadingManager {
|
|
|
43309
43368
|
*/
|
|
43310
43369
|
this.onError = onError;
|
|
43311
43370
|
|
|
43371
|
+
/**
|
|
43372
|
+
* Used for aborting ongoing requests in loaders using this manager.
|
|
43373
|
+
*
|
|
43374
|
+
* @type {AbortController}
|
|
43375
|
+
*/
|
|
43376
|
+
this.abortController = new AbortController();
|
|
43377
|
+
|
|
43312
43378
|
/**
|
|
43313
43379
|
* This should be called by any loader using the manager when the loader
|
|
43314
43380
|
* starts loading an item.
|
|
@@ -43509,6 +43575,22 @@ class LoadingManager {
|
|
|
43509
43575
|
|
|
43510
43576
|
};
|
|
43511
43577
|
|
|
43578
|
+
/**
|
|
43579
|
+
* Can be used to abort ongoing loading requests in loaders using this manager.
|
|
43580
|
+
* The abort only works if the loaders implement {@link Loader#abort} and `AbortSignal.any()`
|
|
43581
|
+
* is supported in the browser.
|
|
43582
|
+
*
|
|
43583
|
+
* @return {LoadingManager} A reference to this loading manager.
|
|
43584
|
+
*/
|
|
43585
|
+
this.abort = function () {
|
|
43586
|
+
|
|
43587
|
+
this.abortController.abort();
|
|
43588
|
+
this.abortController = new AbortController();
|
|
43589
|
+
|
|
43590
|
+
return this;
|
|
43591
|
+
|
|
43592
|
+
};
|
|
43593
|
+
|
|
43512
43594
|
}
|
|
43513
43595
|
|
|
43514
43596
|
}
|
|
@@ -43588,6 +43670,7 @@ class Loader {
|
|
|
43588
43670
|
* This method needs to be implemented by all concrete loaders. It holds the
|
|
43589
43671
|
* logic for loading assets from the backend.
|
|
43590
43672
|
*
|
|
43673
|
+
* @abstract
|
|
43591
43674
|
* @param {string} url - The path/URL of the file to be loaded.
|
|
43592
43675
|
* @param {Function} onLoad - Executed when the loading process has been finished.
|
|
43593
43676
|
* @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.
|
|
@@ -43618,6 +43701,7 @@ class Loader {
|
|
|
43618
43701
|
* This method needs to be implemented by all concrete loaders. It holds the
|
|
43619
43702
|
* logic for parsing the asset into three.js entities.
|
|
43620
43703
|
*
|
|
43704
|
+
* @abstract
|
|
43621
43705
|
* @param {any} data - The data to parse.
|
|
43622
43706
|
*/
|
|
43623
43707
|
parse( /* data */ ) {}
|
|
@@ -43692,6 +43776,18 @@ class Loader {
|
|
|
43692
43776
|
|
|
43693
43777
|
}
|
|
43694
43778
|
|
|
43779
|
+
/**
|
|
43780
|
+
* This method can be implemented in loaders for aborting ongoing requests.
|
|
43781
|
+
*
|
|
43782
|
+
* @abstract
|
|
43783
|
+
* @return {Loader} A reference to this instance.
|
|
43784
|
+
*/
|
|
43785
|
+
abort() {
|
|
43786
|
+
|
|
43787
|
+
return this;
|
|
43788
|
+
|
|
43789
|
+
}
|
|
43790
|
+
|
|
43695
43791
|
}
|
|
43696
43792
|
|
|
43697
43793
|
/**
|
|
@@ -43760,7 +43856,8 @@ class FileLoader extends Loader {
|
|
|
43760
43856
|
super( manager );
|
|
43761
43857
|
|
|
43762
43858
|
/**
|
|
43763
|
-
* The expected mime type.
|
|
43859
|
+
* The expected mime type. Valid values can be found
|
|
43860
|
+
* [here]{@link hhttps://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#mimetype}
|
|
43764
43861
|
*
|
|
43765
43862
|
* @type {string}
|
|
43766
43863
|
*/
|
|
@@ -43774,6 +43871,14 @@ class FileLoader extends Loader {
|
|
|
43774
43871
|
*/
|
|
43775
43872
|
this.responseType = '';
|
|
43776
43873
|
|
|
43874
|
+
/**
|
|
43875
|
+
* Used for aborting requests.
|
|
43876
|
+
*
|
|
43877
|
+
* @private
|
|
43878
|
+
* @type {AbortController}
|
|
43879
|
+
*/
|
|
43880
|
+
this._abortController = new AbortController();
|
|
43881
|
+
|
|
43777
43882
|
}
|
|
43778
43883
|
|
|
43779
43884
|
/**
|
|
@@ -43840,7 +43945,7 @@ class FileLoader extends Loader {
|
|
|
43840
43945
|
const req = new Request( url, {
|
|
43841
43946
|
headers: new Headers( this.requestHeader ),
|
|
43842
43947
|
credentials: this.withCredentials ? 'include' : 'same-origin',
|
|
43843
|
-
|
|
43948
|
+
signal: ( typeof AbortSignal.any === 'function' ) ? AbortSignal.any( [ this._abortController.signal, this.manager.abortController.signal ] ) : this._abortController.signal
|
|
43844
43949
|
} );
|
|
43845
43950
|
|
|
43846
43951
|
// record states ( avoid data race )
|
|
@@ -44057,6 +44162,20 @@ class FileLoader extends Loader {
|
|
|
44057
44162
|
|
|
44058
44163
|
}
|
|
44059
44164
|
|
|
44165
|
+
/**
|
|
44166
|
+
* Aborts ongoing fetch requests.
|
|
44167
|
+
*
|
|
44168
|
+
* @return {FileLoader} A reference to this instance.
|
|
44169
|
+
*/
|
|
44170
|
+
abort() {
|
|
44171
|
+
|
|
44172
|
+
this._abortController.abort();
|
|
44173
|
+
this._abortController = new AbortController();
|
|
44174
|
+
|
|
44175
|
+
return this;
|
|
44176
|
+
|
|
44177
|
+
}
|
|
44178
|
+
|
|
44060
44179
|
}
|
|
44061
44180
|
|
|
44062
44181
|
/**
|
|
@@ -45120,14 +45239,27 @@ class LightShadow {
|
|
|
45120
45239
|
shadowCamera.updateMatrixWorld();
|
|
45121
45240
|
|
|
45122
45241
|
_projScreenMatrix$1.multiplyMatrices( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse );
|
|
45123
|
-
this._frustum.setFromProjectionMatrix( _projScreenMatrix$1 );
|
|
45242
|
+
this._frustum.setFromProjectionMatrix( _projScreenMatrix$1, shadowCamera.coordinateSystem, shadowCamera.reversedDepth );
|
|
45124
45243
|
|
|
45125
|
-
|
|
45126
|
-
|
|
45127
|
-
|
|
45128
|
-
|
|
45129
|
-
|
|
45130
|
-
|
|
45244
|
+
if ( shadowCamera.reversedDepth ) {
|
|
45245
|
+
|
|
45246
|
+
shadowMatrix.set(
|
|
45247
|
+
0.5, 0.0, 0.0, 0.5,
|
|
45248
|
+
0.0, 0.5, 0.0, 0.5,
|
|
45249
|
+
0.0, 0.0, 1.0, 0.0,
|
|
45250
|
+
0.0, 0.0, 0.0, 1.0
|
|
45251
|
+
);
|
|
45252
|
+
|
|
45253
|
+
} else {
|
|
45254
|
+
|
|
45255
|
+
shadowMatrix.set(
|
|
45256
|
+
0.5, 0.0, 0.0, 0.5,
|
|
45257
|
+
0.0, 0.5, 0.0, 0.5,
|
|
45258
|
+
0.0, 0.0, 0.5, 0.5,
|
|
45259
|
+
0.0, 0.0, 0.0, 1.0
|
|
45260
|
+
);
|
|
45261
|
+
|
|
45262
|
+
}
|
|
45131
45263
|
|
|
45132
45264
|
shadowMatrix.multiply( _projScreenMatrix$1 );
|
|
45133
45265
|
|
|
@@ -45584,7 +45716,7 @@ class PointLightShadow extends LightShadow {
|
|
|
45584
45716
|
shadowMatrix.makeTranslation( - _lightPositionWorld.x, - _lightPositionWorld.y, - _lightPositionWorld.z );
|
|
45585
45717
|
|
|
45586
45718
|
_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
|
|
45587
|
-
this._frustum.setFromProjectionMatrix( _projScreenMatrix );
|
|
45719
|
+
this._frustum.setFromProjectionMatrix( _projScreenMatrix, camera.coordinateSystem, camera.reversedDepth );
|
|
45588
45720
|
|
|
45589
45721
|
}
|
|
45590
45722
|
|
|
@@ -45918,7 +46050,7 @@ class OrthographicCamera extends Camera {
|
|
|
45918
46050
|
|
|
45919
46051
|
}
|
|
45920
46052
|
|
|
45921
|
-
this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far, this.coordinateSystem );
|
|
46053
|
+
this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far, this.coordinateSystem, this.reversedDepth );
|
|
45922
46054
|
|
|
45923
46055
|
this.projectionMatrixInverse.copy( this.projectionMatrix ).invert();
|
|
45924
46056
|
|
|
@@ -48658,6 +48790,14 @@ class ImageBitmapLoader extends Loader {
|
|
|
48658
48790
|
*/
|
|
48659
48791
|
this.options = { premultiplyAlpha: 'none' };
|
|
48660
48792
|
|
|
48793
|
+
/**
|
|
48794
|
+
* Used for aborting requests.
|
|
48795
|
+
*
|
|
48796
|
+
* @private
|
|
48797
|
+
* @type {AbortController}
|
|
48798
|
+
*/
|
|
48799
|
+
this._abortController = new AbortController();
|
|
48800
|
+
|
|
48661
48801
|
}
|
|
48662
48802
|
|
|
48663
48803
|
/**
|
|
@@ -48746,6 +48886,7 @@ class ImageBitmapLoader extends Loader {
|
|
|
48746
48886
|
const fetchOptions = {};
|
|
48747
48887
|
fetchOptions.credentials = ( this.crossOrigin === 'anonymous' ) ? 'same-origin' : 'include';
|
|
48748
48888
|
fetchOptions.headers = this.requestHeader;
|
|
48889
|
+
fetchOptions.signal = ( typeof AbortSignal.any === 'function' ) ? AbortSignal.any( [ this._abortController.signal, this.manager.abortController.signal ] ) : this._abortController.signal;
|
|
48749
48890
|
|
|
48750
48891
|
const promise = fetch( url, fetchOptions ).then( function ( res ) {
|
|
48751
48892
|
|
|
@@ -48783,6 +48924,20 @@ class ImageBitmapLoader extends Loader {
|
|
|
48783
48924
|
|
|
48784
48925
|
}
|
|
48785
48926
|
|
|
48927
|
+
/**
|
|
48928
|
+
* Aborts ongoing fetch requests.
|
|
48929
|
+
*
|
|
48930
|
+
* @return {ImageBitmapLoader} A reference to this instance.
|
|
48931
|
+
*/
|
|
48932
|
+
abort() {
|
|
48933
|
+
|
|
48934
|
+
this._abortController.abort();
|
|
48935
|
+
this._abortController = new AbortController();
|
|
48936
|
+
|
|
48937
|
+
return this;
|
|
48938
|
+
|
|
48939
|
+
}
|
|
48940
|
+
|
|
48786
48941
|
}
|
|
48787
48942
|
|
|
48788
48943
|
let _context;
|
|
@@ -54674,6 +54829,189 @@ function intersect( object, raycaster, intersects, recursive ) {
|
|
|
54674
54829
|
|
|
54675
54830
|
}
|
|
54676
54831
|
|
|
54832
|
+
/**
|
|
54833
|
+
* This class is an alternative to {@link Clock} with a different API design and behavior.
|
|
54834
|
+
* The goal is to avoid the conceptual flaws that became apparent in `Clock` over time.
|
|
54835
|
+
*
|
|
54836
|
+
* - `Timer` has an `update()` method that updates its internal state. That makes it possible to
|
|
54837
|
+
* call `getDelta()` and `getElapsed()` multiple times per simulation step without getting different values.
|
|
54838
|
+
* - The class can make use of the Page Visibility API to avoid large time delta values when the app
|
|
54839
|
+
* is inactive (e.g. tab switched or browser hidden).
|
|
54840
|
+
*
|
|
54841
|
+
* ```js
|
|
54842
|
+
* const timer = new Timer();
|
|
54843
|
+
* timer.connect( document ); // use Page Visibility API
|
|
54844
|
+
* ```
|
|
54845
|
+
*/
|
|
54846
|
+
class Timer {
|
|
54847
|
+
|
|
54848
|
+
/**
|
|
54849
|
+
* Constructs a new timer.
|
|
54850
|
+
*/
|
|
54851
|
+
constructor() {
|
|
54852
|
+
|
|
54853
|
+
this._previousTime = 0;
|
|
54854
|
+
this._currentTime = 0;
|
|
54855
|
+
this._startTime = performance.now();
|
|
54856
|
+
|
|
54857
|
+
this._delta = 0;
|
|
54858
|
+
this._elapsed = 0;
|
|
54859
|
+
|
|
54860
|
+
this._timescale = 1;
|
|
54861
|
+
|
|
54862
|
+
this._document = null;
|
|
54863
|
+
this._pageVisibilityHandler = null;
|
|
54864
|
+
|
|
54865
|
+
}
|
|
54866
|
+
|
|
54867
|
+
/**
|
|
54868
|
+
* Connect the timer to the given document.Calling this method is not mandatory to
|
|
54869
|
+
* use the timer but enables the usage of the Page Visibility API to avoid large time
|
|
54870
|
+
* delta values.
|
|
54871
|
+
*
|
|
54872
|
+
* @param {Document} document - The document.
|
|
54873
|
+
*/
|
|
54874
|
+
connect( document ) {
|
|
54875
|
+
|
|
54876
|
+
this._document = document;
|
|
54877
|
+
|
|
54878
|
+
// use Page Visibility API to avoid large time delta values
|
|
54879
|
+
|
|
54880
|
+
if ( document.hidden !== undefined ) {
|
|
54881
|
+
|
|
54882
|
+
this._pageVisibilityHandler = handleVisibilityChange.bind( this );
|
|
54883
|
+
|
|
54884
|
+
document.addEventListener( 'visibilitychange', this._pageVisibilityHandler, false );
|
|
54885
|
+
|
|
54886
|
+
}
|
|
54887
|
+
|
|
54888
|
+
}
|
|
54889
|
+
|
|
54890
|
+
/**
|
|
54891
|
+
* Disconnects the timer from the DOM and also disables the usage of the Page Visibility API.
|
|
54892
|
+
*/
|
|
54893
|
+
disconnect() {
|
|
54894
|
+
|
|
54895
|
+
if ( this._pageVisibilityHandler !== null ) {
|
|
54896
|
+
|
|
54897
|
+
this._document.removeEventListener( 'visibilitychange', this._pageVisibilityHandler );
|
|
54898
|
+
this._pageVisibilityHandler = null;
|
|
54899
|
+
|
|
54900
|
+
}
|
|
54901
|
+
|
|
54902
|
+
this._document = null;
|
|
54903
|
+
|
|
54904
|
+
}
|
|
54905
|
+
|
|
54906
|
+
/**
|
|
54907
|
+
* Returns the time delta in seconds.
|
|
54908
|
+
*
|
|
54909
|
+
* @return {number} The time delta in second.
|
|
54910
|
+
*/
|
|
54911
|
+
getDelta() {
|
|
54912
|
+
|
|
54913
|
+
return this._delta / 1000;
|
|
54914
|
+
|
|
54915
|
+
}
|
|
54916
|
+
|
|
54917
|
+
/**
|
|
54918
|
+
* Returns the elapsed time in seconds.
|
|
54919
|
+
*
|
|
54920
|
+
* @return {number} The elapsed time in second.
|
|
54921
|
+
*/
|
|
54922
|
+
getElapsed() {
|
|
54923
|
+
|
|
54924
|
+
return this._elapsed / 1000;
|
|
54925
|
+
|
|
54926
|
+
}
|
|
54927
|
+
|
|
54928
|
+
/**
|
|
54929
|
+
* Returns the timescale.
|
|
54930
|
+
*
|
|
54931
|
+
* @return {number} The timescale.
|
|
54932
|
+
*/
|
|
54933
|
+
getTimescale() {
|
|
54934
|
+
|
|
54935
|
+
return this._timescale;
|
|
54936
|
+
|
|
54937
|
+
}
|
|
54938
|
+
|
|
54939
|
+
/**
|
|
54940
|
+
* Sets the given timescale which scale the time delta computation
|
|
54941
|
+
* in `update()`.
|
|
54942
|
+
*
|
|
54943
|
+
* @param {number} timescale - The timescale to set.
|
|
54944
|
+
* @return {Timer} A reference to this timer.
|
|
54945
|
+
*/
|
|
54946
|
+
setTimescale( timescale ) {
|
|
54947
|
+
|
|
54948
|
+
this._timescale = timescale;
|
|
54949
|
+
|
|
54950
|
+
return this;
|
|
54951
|
+
|
|
54952
|
+
}
|
|
54953
|
+
|
|
54954
|
+
/**
|
|
54955
|
+
* Resets the time computation for the current simulation step.
|
|
54956
|
+
*
|
|
54957
|
+
* @return {Timer} A reference to this timer.
|
|
54958
|
+
*/
|
|
54959
|
+
reset() {
|
|
54960
|
+
|
|
54961
|
+
this._currentTime = performance.now() - this._startTime;
|
|
54962
|
+
|
|
54963
|
+
return this;
|
|
54964
|
+
|
|
54965
|
+
}
|
|
54966
|
+
|
|
54967
|
+
/**
|
|
54968
|
+
* Can be used to free all internal resources. Usually called when
|
|
54969
|
+
* the timer instance isn't required anymore.
|
|
54970
|
+
*/
|
|
54971
|
+
dispose() {
|
|
54972
|
+
|
|
54973
|
+
this.disconnect();
|
|
54974
|
+
|
|
54975
|
+
}
|
|
54976
|
+
|
|
54977
|
+
/**
|
|
54978
|
+
* Updates the internal state of the timer. This method should be called
|
|
54979
|
+
* once per simulation step and before you perform queries against the timer
|
|
54980
|
+
* (e.g. via `getDelta()`).
|
|
54981
|
+
*
|
|
54982
|
+
* @param {number} timestamp - The current time in milliseconds. Can be obtained
|
|
54983
|
+
* from the `requestAnimationFrame` callback argument. If not provided, the current
|
|
54984
|
+
* time will be determined with `performance.now`.
|
|
54985
|
+
* @return {Timer} A reference to this timer.
|
|
54986
|
+
*/
|
|
54987
|
+
update( timestamp ) {
|
|
54988
|
+
|
|
54989
|
+
if ( this._pageVisibilityHandler !== null && this._document.hidden === true ) {
|
|
54990
|
+
|
|
54991
|
+
this._delta = 0;
|
|
54992
|
+
|
|
54993
|
+
} else {
|
|
54994
|
+
|
|
54995
|
+
this._previousTime = this._currentTime;
|
|
54996
|
+
this._currentTime = ( timestamp !== undefined ? timestamp : performance.now() ) - this._startTime;
|
|
54997
|
+
|
|
54998
|
+
this._delta = ( this._currentTime - this._previousTime ) * this._timescale;
|
|
54999
|
+
this._elapsed += this._delta; // _elapsed is the accumulation of all previous deltas
|
|
55000
|
+
|
|
55001
|
+
}
|
|
55002
|
+
|
|
55003
|
+
return this;
|
|
55004
|
+
|
|
55005
|
+
}
|
|
55006
|
+
|
|
55007
|
+
}
|
|
55008
|
+
|
|
55009
|
+
function handleVisibilityChange() {
|
|
55010
|
+
|
|
55011
|
+
if ( this._document.hidden === false ) this.reset();
|
|
55012
|
+
|
|
55013
|
+
}
|
|
55014
|
+
|
|
54677
55015
|
/**
|
|
54678
55016
|
* This class can be used to represent points in 3D space as
|
|
54679
55017
|
* [Spherical coordinates]{@link https://en.wikipedia.org/wiki/Spherical_coordinate_system}.
|
|
@@ -54781,8 +55119,8 @@ class Spherical {
|
|
|
54781
55119
|
* Sets the spherical components from the given Cartesian coordinates.
|
|
54782
55120
|
*
|
|
54783
55121
|
* @param {number} x - The x value.
|
|
54784
|
-
* @param {number} y - The
|
|
54785
|
-
* @param {number} z - The
|
|
55122
|
+
* @param {number} y - The y value.
|
|
55123
|
+
* @param {number} z - The z value.
|
|
54786
55124
|
* @return {Spherical} A reference to this spherical.
|
|
54787
55125
|
*/
|
|
54788
55126
|
setFromCartesianCoords( x, y, z ) {
|
|
@@ -55443,6 +55781,12 @@ class Box2 {
|
|
|
55443
55781
|
const _startP = /*@__PURE__*/ new Vector3();
|
|
55444
55782
|
const _startEnd = /*@__PURE__*/ new Vector3();
|
|
55445
55783
|
|
|
55784
|
+
const _d1 = /*@__PURE__*/ new Vector3();
|
|
55785
|
+
const _d2 = /*@__PURE__*/ new Vector3();
|
|
55786
|
+
const _r = /*@__PURE__*/ new Vector3();
|
|
55787
|
+
const _c1 = /*@__PURE__*/ new Vector3();
|
|
55788
|
+
const _c2 = /*@__PURE__*/ new Vector3();
|
|
55789
|
+
|
|
55446
55790
|
/**
|
|
55447
55791
|
* An analytical line segment in 3D space represented by a start and end point.
|
|
55448
55792
|
*/
|
|
@@ -55590,11 +55934,11 @@ class Line3 {
|
|
|
55590
55934
|
}
|
|
55591
55935
|
|
|
55592
55936
|
/**
|
|
55593
|
-
* Returns the
|
|
55937
|
+
* Returns the closest point on the line for a given point.
|
|
55594
55938
|
*
|
|
55595
55939
|
* @param {Vector3} point - The point to compute the closest point on the line for.
|
|
55596
55940
|
* @param {boolean} clampToLine - Whether to clamp the result to the range `[0,1]` or not.
|
|
55597
|
-
* @param {Vector3} target -
|
|
55941
|
+
* @param {Vector3} target - The target vector that is used to store the method's result.
|
|
55598
55942
|
* @return {Vector3} The closest point on the line.
|
|
55599
55943
|
*/
|
|
55600
55944
|
closestPointToPoint( point, clampToLine, target ) {
|
|
@@ -55605,6 +55949,127 @@ class Line3 {
|
|
|
55605
55949
|
|
|
55606
55950
|
}
|
|
55607
55951
|
|
|
55952
|
+
/**
|
|
55953
|
+
* Returns the closest squared distance between this line segment and the given one.
|
|
55954
|
+
*
|
|
55955
|
+
* @param {Line3} line - The line segment to compute the closest squared distance to.
|
|
55956
|
+
* @param {Vector3} [c1] - The closest point on this line segment.
|
|
55957
|
+
* @param {Vector3} [c2] - The closest point on the given line segment.
|
|
55958
|
+
* @return {number} The squared distance between this line segment and the given one.
|
|
55959
|
+
*/
|
|
55960
|
+
distanceSqToLine3( line, c1 = _c1, c2 = _c2 ) {
|
|
55961
|
+
|
|
55962
|
+
// from Real-Time Collision Detection by Christer Ericson, chapter 5.1.9
|
|
55963
|
+
|
|
55964
|
+
// Computes closest points C1 and C2 of S1(s)=P1+s*(Q1-P1) and
|
|
55965
|
+
// S2(t)=P2+t*(Q2-P2), returning s and t. Function result is squared
|
|
55966
|
+
// distance between between S1(s) and S2(t)
|
|
55967
|
+
|
|
55968
|
+
const EPSILON = 1e-8 * 1e-8; // must be squared since we compare squared length
|
|
55969
|
+
let s, t;
|
|
55970
|
+
|
|
55971
|
+
const p1 = this.start;
|
|
55972
|
+
const p2 = line.start;
|
|
55973
|
+
const q1 = this.end;
|
|
55974
|
+
const q2 = line.end;
|
|
55975
|
+
|
|
55976
|
+
_d1.subVectors( q1, p1 ); // Direction vector of segment S1
|
|
55977
|
+
_d2.subVectors( q2, p2 ); // Direction vector of segment S2
|
|
55978
|
+
_r.subVectors( p1, p2 );
|
|
55979
|
+
|
|
55980
|
+
const a = _d1.dot( _d1 ); // Squared length of segment S1, always nonnegative
|
|
55981
|
+
const e = _d2.dot( _d2 ); // Squared length of segment S2, always nonnegative
|
|
55982
|
+
const f = _d2.dot( _r );
|
|
55983
|
+
|
|
55984
|
+
// Check if either or both segments degenerate into points
|
|
55985
|
+
|
|
55986
|
+
if ( a <= EPSILON && e <= EPSILON ) {
|
|
55987
|
+
|
|
55988
|
+
// Both segments degenerate into points
|
|
55989
|
+
|
|
55990
|
+
c1.copy( p1 );
|
|
55991
|
+
c2.copy( p2 );
|
|
55992
|
+
|
|
55993
|
+
c1.sub( c2 );
|
|
55994
|
+
|
|
55995
|
+
return c1.dot( c1 );
|
|
55996
|
+
|
|
55997
|
+
}
|
|
55998
|
+
|
|
55999
|
+
if ( a <= EPSILON ) {
|
|
56000
|
+
|
|
56001
|
+
// First segment degenerates into a point
|
|
56002
|
+
|
|
56003
|
+
s = 0;
|
|
56004
|
+
t = f / e; // s = 0 => t = (b*s + f) / e = f / e
|
|
56005
|
+
t = clamp( t, 0, 1 );
|
|
56006
|
+
|
|
56007
|
+
|
|
56008
|
+
} else {
|
|
56009
|
+
|
|
56010
|
+
const c = _d1.dot( _r );
|
|
56011
|
+
|
|
56012
|
+
if ( e <= EPSILON ) {
|
|
56013
|
+
|
|
56014
|
+
// Second segment degenerates into a point
|
|
56015
|
+
|
|
56016
|
+
t = 0;
|
|
56017
|
+
s = clamp( - c / a, 0, 1 ); // t = 0 => s = (b*t - c) / a = -c / a
|
|
56018
|
+
|
|
56019
|
+
} else {
|
|
56020
|
+
|
|
56021
|
+
// The general nondegenerate case starts here
|
|
56022
|
+
|
|
56023
|
+
const b = _d1.dot( _d2 );
|
|
56024
|
+
const denom = a * e - b * b; // Always nonnegative
|
|
56025
|
+
|
|
56026
|
+
// If segments not parallel, compute closest point on L1 to L2 and
|
|
56027
|
+
// clamp to segment S1. Else pick arbitrary s (here 0)
|
|
56028
|
+
|
|
56029
|
+
if ( denom !== 0 ) {
|
|
56030
|
+
|
|
56031
|
+
s = clamp( ( b * f - c * e ) / denom, 0, 1 );
|
|
56032
|
+
|
|
56033
|
+
} else {
|
|
56034
|
+
|
|
56035
|
+
s = 0;
|
|
56036
|
+
|
|
56037
|
+
}
|
|
56038
|
+
|
|
56039
|
+
// Compute point on L2 closest to S1(s) using
|
|
56040
|
+
// t = Dot((P1 + D1*s) - P2,D2) / Dot(D2,D2) = (b*s + f) / e
|
|
56041
|
+
|
|
56042
|
+
t = ( b * s + f ) / e;
|
|
56043
|
+
|
|
56044
|
+
// If t in [0,1] done. Else clamp t, recompute s for the new value
|
|
56045
|
+
// of t using s = Dot((P2 + D2*t) - P1,D1) / Dot(D1,D1)= (t*b - c) / a
|
|
56046
|
+
// and clamp s to [0, 1]
|
|
56047
|
+
|
|
56048
|
+
if ( t < 0 ) {
|
|
56049
|
+
|
|
56050
|
+
t = 0.;
|
|
56051
|
+
s = clamp( - c / a, 0, 1 );
|
|
56052
|
+
|
|
56053
|
+
} else if ( t > 1 ) {
|
|
56054
|
+
|
|
56055
|
+
t = 1;
|
|
56056
|
+
s = clamp( ( b - c ) / a, 0, 1 );
|
|
56057
|
+
|
|
56058
|
+
}
|
|
56059
|
+
|
|
56060
|
+
}
|
|
56061
|
+
|
|
56062
|
+
}
|
|
56063
|
+
|
|
56064
|
+
c1.copy( p1 ).add( _d1.multiplyScalar( s ) );
|
|
56065
|
+
c2.copy( p2 ).add( _d2.multiplyScalar( t ) );
|
|
56066
|
+
|
|
56067
|
+
c1.sub( c2 );
|
|
56068
|
+
|
|
56069
|
+
return c1.dot( c1 );
|
|
56070
|
+
|
|
56071
|
+
}
|
|
56072
|
+
|
|
55608
56073
|
/**
|
|
55609
56074
|
* Applies a 4x4 transformation matrix to this line segment.
|
|
55610
56075
|
*
|
|
@@ -55804,7 +56269,7 @@ const _matrixWorldInv = /*@__PURE__*/ new Matrix4();
|
|
|
55804
56269
|
class SkeletonHelper extends LineSegments {
|
|
55805
56270
|
|
|
55806
56271
|
/**
|
|
55807
|
-
* Constructs a new
|
|
56272
|
+
* Constructs a new skeleton helper.
|
|
55808
56273
|
*
|
|
55809
56274
|
* @param {Object3D} object - Usually an instance of {@link SkinnedMesh}. However, any 3D object
|
|
55810
56275
|
* can be used if it represents a hierarchy of bones (see {@link Bone}).
|
|
@@ -55818,9 +56283,6 @@ class SkeletonHelper extends LineSegments {
|
|
|
55818
56283
|
const vertices = [];
|
|
55819
56284
|
const colors = [];
|
|
55820
56285
|
|
|
55821
|
-
const color1 = new Color( 0, 0, 1 );
|
|
55822
|
-
const color2 = new Color( 0, 1, 0 );
|
|
55823
|
-
|
|
55824
56286
|
for ( let i = 0; i < bones.length; i ++ ) {
|
|
55825
56287
|
|
|
55826
56288
|
const bone = bones[ i ];
|
|
@@ -55829,8 +56291,8 @@ class SkeletonHelper extends LineSegments {
|
|
|
55829
56291
|
|
|
55830
56292
|
vertices.push( 0, 0, 0 );
|
|
55831
56293
|
vertices.push( 0, 0, 0 );
|
|
55832
|
-
colors.push(
|
|
55833
|
-
colors.push(
|
|
56294
|
+
colors.push( 0, 0, 0 );
|
|
56295
|
+
colors.push( 0, 0, 0 );
|
|
55834
56296
|
|
|
55835
56297
|
}
|
|
55836
56298
|
|
|
@@ -55871,6 +56333,13 @@ class SkeletonHelper extends LineSegments {
|
|
|
55871
56333
|
this.matrix = object.matrixWorld;
|
|
55872
56334
|
this.matrixAutoUpdate = false;
|
|
55873
56335
|
|
|
56336
|
+
// colors
|
|
56337
|
+
|
|
56338
|
+
const color1 = new Color( 0x0000ff );
|
|
56339
|
+
const color2 = new Color( 0x00ff00 );
|
|
56340
|
+
|
|
56341
|
+
this.setColors( color1, color2 );
|
|
56342
|
+
|
|
55874
56343
|
}
|
|
55875
56344
|
|
|
55876
56345
|
updateMatrixWorld( force ) {
|
|
@@ -55908,6 +56377,31 @@ class SkeletonHelper extends LineSegments {
|
|
|
55908
56377
|
|
|
55909
56378
|
}
|
|
55910
56379
|
|
|
56380
|
+
/**
|
|
56381
|
+
* Defines the colors of the helper.
|
|
56382
|
+
*
|
|
56383
|
+
* @param {Color} color1 - The first line color for each bone.
|
|
56384
|
+
* @param {Color} color2 - The second line color for each bone.
|
|
56385
|
+
* @return {SkeletonHelper} A reference to this helper.
|
|
56386
|
+
*/
|
|
56387
|
+
setColors( color1, color2 ) {
|
|
56388
|
+
|
|
56389
|
+
const geometry = this.geometry;
|
|
56390
|
+
const colorAttribute = geometry.getAttribute( 'color' );
|
|
56391
|
+
|
|
56392
|
+
for ( let i = 0; i < colorAttribute.count; i += 2 ) {
|
|
56393
|
+
|
|
56394
|
+
colorAttribute.setXYZ( i, color1.r, color1.g, color1.b );
|
|
56395
|
+
colorAttribute.setXYZ( i + 1, color2.r, color2.g, color2.b );
|
|
56396
|
+
|
|
56397
|
+
}
|
|
56398
|
+
|
|
56399
|
+
colorAttribute.needsUpdate = true;
|
|
56400
|
+
|
|
56401
|
+
return this;
|
|
56402
|
+
|
|
56403
|
+
}
|
|
56404
|
+
|
|
55911
56405
|
/**
|
|
55912
56406
|
* Frees the GPU-related resources allocated by this instance. Call this
|
|
55913
56407
|
* method whenever this instance is no longer used in your app.
|
|
@@ -56668,6 +57162,7 @@ class CameraHelper extends LineSegments {
|
|
|
56668
57162
|
* @param {Color} up - The up line color.
|
|
56669
57163
|
* @param {Color} target - The target line color.
|
|
56670
57164
|
* @param {Color} cross - The cross line color.
|
|
57165
|
+
* @return {CameraHelper} A reference to this helper.
|
|
56671
57166
|
*/
|
|
56672
57167
|
setColors( frustum, cone, up, target, cross ) {
|
|
56673
57168
|
|
|
@@ -56724,6 +57219,8 @@ class CameraHelper extends LineSegments {
|
|
|
56724
57219
|
|
|
56725
57220
|
colorAttribute.needsUpdate = true;
|
|
56726
57221
|
|
|
57222
|
+
return this;
|
|
57223
|
+
|
|
56727
57224
|
}
|
|
56728
57225
|
|
|
56729
57226
|
/**
|
|
@@ -56736,48 +57233,75 @@ class CameraHelper extends LineSegments {
|
|
|
56736
57233
|
|
|
56737
57234
|
const w = 1, h = 1;
|
|
56738
57235
|
|
|
57236
|
+
let nearZ, farZ;
|
|
57237
|
+
|
|
56739
57238
|
// we need just camera projection matrix inverse
|
|
56740
57239
|
// world matrix must be identity
|
|
56741
57240
|
|
|
56742
57241
|
_camera.projectionMatrixInverse.copy( this.camera.projectionMatrixInverse );
|
|
56743
57242
|
|
|
56744
57243
|
// Adjust z values based on coordinate system
|
|
56745
|
-
|
|
57244
|
+
|
|
57245
|
+
if ( this.camera.reversedDepth === true ) {
|
|
57246
|
+
|
|
57247
|
+
nearZ = 1;
|
|
57248
|
+
farZ = 0;
|
|
57249
|
+
|
|
57250
|
+
} else {
|
|
57251
|
+
|
|
57252
|
+
if ( this.camera.coordinateSystem === WebGLCoordinateSystem ) {
|
|
57253
|
+
|
|
57254
|
+
nearZ = -1;
|
|
57255
|
+
farZ = 1;
|
|
57256
|
+
|
|
57257
|
+
} else if ( this.camera.coordinateSystem === WebGPUCoordinateSystem ) {
|
|
57258
|
+
|
|
57259
|
+
nearZ = 0;
|
|
57260
|
+
farZ = 1;
|
|
57261
|
+
|
|
57262
|
+
} else {
|
|
57263
|
+
|
|
57264
|
+
throw new Error( 'THREE.CameraHelper.update(): Invalid coordinate system: ' + this.camera.coordinateSystem );
|
|
57265
|
+
|
|
57266
|
+
}
|
|
57267
|
+
|
|
57268
|
+
}
|
|
57269
|
+
|
|
56746
57270
|
|
|
56747
57271
|
// center / target
|
|
56748
57272
|
setPoint( 'c', pointMap, geometry, _camera, 0, 0, nearZ );
|
|
56749
|
-
setPoint( 't', pointMap, geometry, _camera, 0, 0,
|
|
57273
|
+
setPoint( 't', pointMap, geometry, _camera, 0, 0, farZ );
|
|
56750
57274
|
|
|
56751
57275
|
// near
|
|
56752
57276
|
|
|
56753
|
-
setPoint( 'n1', pointMap, geometry, _camera, -
|
|
56754
|
-
setPoint( 'n2', pointMap, geometry, _camera, w, -
|
|
56755
|
-
setPoint( 'n3', pointMap, geometry, _camera, -
|
|
57277
|
+
setPoint( 'n1', pointMap, geometry, _camera, - w, - h, nearZ );
|
|
57278
|
+
setPoint( 'n2', pointMap, geometry, _camera, w, - h, nearZ );
|
|
57279
|
+
setPoint( 'n3', pointMap, geometry, _camera, - w, h, nearZ );
|
|
56756
57280
|
setPoint( 'n4', pointMap, geometry, _camera, w, h, nearZ );
|
|
56757
57281
|
|
|
56758
57282
|
// far
|
|
56759
57283
|
|
|
56760
|
-
setPoint( 'f1', pointMap, geometry, _camera, -
|
|
56761
|
-
setPoint( 'f2', pointMap, geometry, _camera, w, -
|
|
56762
|
-
setPoint( 'f3', pointMap, geometry, _camera, -
|
|
56763
|
-
setPoint( 'f4', pointMap, geometry, _camera, w, h,
|
|
57284
|
+
setPoint( 'f1', pointMap, geometry, _camera, - w, - h, farZ );
|
|
57285
|
+
setPoint( 'f2', pointMap, geometry, _camera, w, - h, farZ );
|
|
57286
|
+
setPoint( 'f3', pointMap, geometry, _camera, - w, h, farZ );
|
|
57287
|
+
setPoint( 'f4', pointMap, geometry, _camera, w, h, farZ );
|
|
56764
57288
|
|
|
56765
57289
|
// up
|
|
56766
57290
|
|
|
56767
57291
|
setPoint( 'u1', pointMap, geometry, _camera, w * 0.7, h * 1.1, nearZ );
|
|
56768
|
-
setPoint( 'u2', pointMap, geometry, _camera, -
|
|
57292
|
+
setPoint( 'u2', pointMap, geometry, _camera, - w * 0.7, h * 1.1, nearZ );
|
|
56769
57293
|
setPoint( 'u3', pointMap, geometry, _camera, 0, h * 2, nearZ );
|
|
56770
57294
|
|
|
56771
57295
|
// cross
|
|
56772
57296
|
|
|
56773
|
-
setPoint( 'cf1', pointMap, geometry, _camera, -
|
|
56774
|
-
setPoint( 'cf2', pointMap, geometry, _camera, w, 0,
|
|
56775
|
-
setPoint( 'cf3', pointMap, geometry, _camera, 0, -
|
|
56776
|
-
setPoint( 'cf4', pointMap, geometry, _camera, 0, h,
|
|
57297
|
+
setPoint( 'cf1', pointMap, geometry, _camera, - w, 0, farZ );
|
|
57298
|
+
setPoint( 'cf2', pointMap, geometry, _camera, w, 0, farZ );
|
|
57299
|
+
setPoint( 'cf3', pointMap, geometry, _camera, 0, - h, farZ );
|
|
57300
|
+
setPoint( 'cf4', pointMap, geometry, _camera, 0, h, farZ );
|
|
56777
57301
|
|
|
56778
|
-
setPoint( 'cn1', pointMap, geometry, _camera, -
|
|
57302
|
+
setPoint( 'cn1', pointMap, geometry, _camera, - w, 0, nearZ );
|
|
56779
57303
|
setPoint( 'cn2', pointMap, geometry, _camera, w, 0, nearZ );
|
|
56780
|
-
setPoint( 'cn3', pointMap, geometry, _camera, 0, -
|
|
57304
|
+
setPoint( 'cn3', pointMap, geometry, _camera, 0, - h, nearZ );
|
|
56781
57305
|
setPoint( 'cn4', pointMap, geometry, _camera, 0, h, nearZ );
|
|
56782
57306
|
|
|
56783
57307
|
geometry.getAttribute( 'position' ).needsUpdate = true;
|
|
@@ -58159,4 +58683,4 @@ if ( typeof window !== 'undefined' ) {
|
|
|
58159
58683
|
|
|
58160
58684
|
}
|
|
58161
58685
|
|
|
58162
|
-
export { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AgXToneMapping, AlphaFormat, AlwaysCompare, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, AttachedBindMode, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BackSide, BasicDepthPacking, BasicShadowMap, BatchedMesh, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasTexture, CapsuleGeometry, CatmullRomCurve3, CineonToneMapping, CircleGeometry, ClampToEdgeWrapping, Clock, Color, ColorKeyframeTrack, ColorManagement, CompressedArrayTexture, CompressedCubeTexture, CompressedTexture, CompressedTextureLoader, ConeGeometry, ConstantAlphaFactor, ConstantColorFactor, Controls, CubeCamera, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeUVReflectionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderGeometry, Cylindrical, CylindricalMapping, Data3DTexture, DataArrayTexture, DataTexture, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DetachedBindMode, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EllipseCurve, EqualCompare, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExtrudeGeometry, FileLoader, Float16BufferAttribute, Float32BufferAttribute, FloatType, Fog, FogExp2, FramebufferTexture, FrontSide, Frustum, FrustumArray, GLBufferAttribute, GLSL1, GLSL3, GreaterCompare, GreaterDepth, GreaterEqualCompare, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HalfFloatType, HemisphereLight, HemisphereLightHelper, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InterpolationSamplingMode, InterpolationSamplingType, InvertStencilOp, KeepStencilOp, KeyframeTrack, LOD, LatheGeometry, Layers, LessCompare, LessDepth, LessEqualCompare, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LineSegments, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearSRGBColorSpace, LinearToneMapping, LinearTransfer, Loader, LoaderUtils, LoadingManager, LoopOnce, LoopPingPong, LoopRepeat, MOUSE, Material, MaterialLoader, MathUtils, Matrix2, Matrix3, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeutralToneMapping, NeverCompare, NeverDepth, NeverStencilFunc, NoBlending, NoColorSpace, NoToneMapping, NormalAnimationBlendMode, NormalBlending, NotEqualCompare, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronGeometry, OneFactor, OneMinusConstantAlphaFactor, OneMinusConstantColorFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, PCFShadowMap, PCFSoftShadowMap, Path, PerspectiveCamera, Plane, PlaneGeometry, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, RAD2DEG, RED_GREEN_RGTC2_Format, RED_RGTC1_Format, REVISION, RGBADepthPacking, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGBDepthPacking, RGBFormat, RGBIntegerFormat, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGDepthPacking, RGFormat, RGIntegerFormat, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RedFormat, RedIntegerFormat, ReinhardToneMapping, RenderTarget, RenderTarget3D, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, RingGeometry, SIGNED_RED_GREEN_RGTC2_Format, SIGNED_RED_RGTC1_Format, SRGBColorSpace, SRGBTransfer, Scene, ShaderMaterial, ShadowMaterial, Shape, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, Source, Sphere, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronGeometry, Texture, TextureLoader, TextureUtils, TimestampQuery, TorusGeometry, TorusKnotGeometry, TriPlanarMapping, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeGeometry, UVMapping, Uint16BufferAttribute, Uint32BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsGroup, UniformsUtils, UnsignedByteType, UnsignedInt248Type, UnsignedInt5999Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VSMShadowMap, Vector2, Vector3, Vector4, VectorKeyframeTrack, VideoFrameTexture, VideoTexture, WebGL3DRenderTarget, WebGLArrayRenderTarget, WebGLCoordinateSystem, WebGLCubeRenderTarget, WebGLRenderTarget, WebGPUCoordinateSystem, WebXRController, WireframeGeometry, WrapAroundEnding, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, arrayNeedsUint32, cloneUniforms, createCanvasElement, createElementNS, getByteLength, getUnlitUniformColorSpace, mergeUniforms, probeAsync,
|
|
58686
|
+
export { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AgXToneMapping, AlphaFormat, AlwaysCompare, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, AttachedBindMode, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BackSide, BasicDepthPacking, BasicShadowMap, BatchedMesh, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasTexture, CapsuleGeometry, CatmullRomCurve3, CineonToneMapping, CircleGeometry, ClampToEdgeWrapping, Clock, Color, ColorKeyframeTrack, ColorManagement, CompressedArrayTexture, CompressedCubeTexture, CompressedTexture, CompressedTextureLoader, ConeGeometry, ConstantAlphaFactor, ConstantColorFactor, Controls, CubeCamera, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeUVReflectionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderGeometry, Cylindrical, CylindricalMapping, Data3DTexture, DataArrayTexture, DataTexture, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DetachedBindMode, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EllipseCurve, EqualCompare, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExtrudeGeometry, FileLoader, Float16BufferAttribute, Float32BufferAttribute, FloatType, Fog, FogExp2, FramebufferTexture, FrontSide, Frustum, FrustumArray, GLBufferAttribute, GLSL1, GLSL3, GreaterCompare, GreaterDepth, GreaterEqualCompare, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HalfFloatType, HemisphereLight, HemisphereLightHelper, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InterpolationSamplingMode, InterpolationSamplingType, InvertStencilOp, KeepStencilOp, KeyframeTrack, LOD, LatheGeometry, Layers, LessCompare, LessDepth, LessEqualCompare, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LineSegments, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearSRGBColorSpace, LinearToneMapping, LinearTransfer, Loader, LoaderUtils, LoadingManager, LoopOnce, LoopPingPong, LoopRepeat, MOUSE, Material, MaterialLoader, MathUtils, Matrix2, Matrix3, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeutralToneMapping, NeverCompare, NeverDepth, NeverStencilFunc, NoBlending, NoColorSpace, NoToneMapping, NormalAnimationBlendMode, NormalBlending, NotEqualCompare, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronGeometry, OneFactor, OneMinusConstantAlphaFactor, OneMinusConstantColorFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, PCFShadowMap, PCFSoftShadowMap, Path, PerspectiveCamera, Plane, PlaneGeometry, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, RAD2DEG, RED_GREEN_RGTC2_Format, RED_RGTC1_Format, REVISION, RGBADepthPacking, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGBDepthPacking, RGBFormat, RGBIntegerFormat, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGDepthPacking, RGFormat, RGIntegerFormat, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RedFormat, RedIntegerFormat, ReinhardToneMapping, RenderTarget, RenderTarget3D, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, RingGeometry, SIGNED_RED_GREEN_RGTC2_Format, SIGNED_RED_RGTC1_Format, SRGBColorSpace, SRGBTransfer, Scene, ShaderMaterial, ShadowMaterial, Shape, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, Source, Sphere, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronGeometry, Texture, TextureLoader, TextureUtils, Timer, TimestampQuery, TorusGeometry, TorusKnotGeometry, TriPlanarMapping, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeGeometry, UVMapping, Uint16BufferAttribute, Uint32BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsGroup, UniformsUtils, UnsignedByteType, UnsignedInt248Type, UnsignedInt5999Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VSMShadowMap, Vector2, Vector3, Vector4, VectorKeyframeTrack, VideoFrameTexture, VideoTexture, WebGL3DRenderTarget, WebGLArrayRenderTarget, WebGLCoordinateSystem, WebGLCubeRenderTarget, WebGLRenderTarget, WebGPUCoordinateSystem, WebXRController, WireframeGeometry, WrapAroundEnding, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, arrayNeedsUint32, cloneUniforms, createCanvasElement, createElementNS, getByteLength, getUnlitUniformColorSpace, mergeUniforms, probeAsync, warnOnce };
|