@types/three 0.174.0 → 0.176.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.
- three/README.md +2 -2
- three/examples/jsm/Addons.d.ts +1 -1
- three/examples/jsm/controls/PointerLockControls.d.ts +4 -1
- three/examples/jsm/geometries/ParametricFunctions.d.ts +8 -0
- three/examples/jsm/helpers/RapierHelper.d.ts +13 -0
- three/examples/jsm/interactive/HTMLMesh.d.ts +9 -2
- three/examples/jsm/loaders/LUTImageLoader.d.ts +2 -2
- three/examples/jsm/loaders/LottieLoader.d.ts +4 -0
- three/examples/jsm/misc/MD2CharacterComplex.d.ts +1 -1
- three/examples/jsm/physics/RapierPhysics.d.ts +12 -0
- three/examples/jsm/postprocessing/BokehPass.d.ts +2 -2
- three/examples/jsm/postprocessing/HalftonePass.d.ts +1 -1
- three/examples/jsm/postprocessing/LUTPass.d.ts +1 -1
- three/examples/jsm/postprocessing/SMAAPass.d.ts +1 -1
- three/examples/jsm/transpiler/AST.d.ts +218 -1
- three/examples/jsm/transpiler/TSLEncoder.d.ts +35 -1
- three/examples/jsm/tsl/shadows/TileShadowNode.d.ts +14 -0
- three/examples/jsm/tsl/shadows/TileShadowNodeHelper.d.ts +14 -0
- three/examples/jsm/webxr/VRButton.d.ts +4 -2
- three/package.json +4 -3
- three/src/Three.Core.d.ts +2 -0
- three/src/Three.TSL.d.ts +11 -1
- three/src/animation/AnimationAction.d.ts +219 -19
- three/src/animation/AnimationClip.d.ts +140 -28
- three/src/animation/AnimationMixer.d.ts +100 -8
- three/src/animation/AnimationObjectGroup.d.ts +55 -14
- three/src/animation/AnimationUtils.d.ts +154 -43
- three/src/animation/KeyframeTrack.d.ts +134 -25
- three/src/animation/PropertyBinding.d.ts +89 -31
- three/src/animation/PropertyMixer.d.ts +62 -5
- three/src/animation/tracks/BooleanKeyframeTrack.d.ts +12 -4
- three/src/animation/tracks/ColorKeyframeTrack.d.ts +10 -4
- three/src/animation/tracks/NumberKeyframeTrack.d.ts +10 -4
- three/src/animation/tracks/QuaternionKeyframeTrack.d.ts +10 -4
- three/src/animation/tracks/StringKeyframeTrack.d.ts +12 -4
- three/src/animation/tracks/VectorKeyframeTrack.d.ts +10 -4
- three/src/audio/AudioListener.d.ts +1 -1
- three/src/cameras/ArrayCamera.d.ts +5 -0
- three/src/constants.d.ts +18 -17
- three/src/core/BufferAttribute.d.ts +11 -0
- three/src/core/BufferGeometry.d.ts +1 -3
- three/src/core/RenderTarget.d.ts +9 -0
- three/src/extras/Controls.d.ts +1 -1
- three/src/extras/Earcut.d.ts +5 -3
- three/src/extras/ImageUtils.d.ts +1 -0
- three/src/geometries/CapsuleGeometry.d.ts +10 -3
- three/src/lights/LightShadow.d.ts +8 -0
- three/src/lights/PointLight.d.ts +1 -1
- three/src/loaders/FileLoader.d.ts +2 -2
- three/src/loaders/LoaderUtils.d.ts +0 -5
- three/src/materials/Material.d.ts +6 -8
- three/src/materials/ShaderMaterial.d.ts +1 -1
- three/src/materials/nodes/NodeMaterial.d.ts +10 -2
- three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +8 -0
- three/src/math/FrustumArray.d.ts +27 -0
- three/src/nodes/Nodes.d.ts +1 -0
- three/src/nodes/TSL.d.ts +1 -0
- three/src/nodes/accessors/BufferAttributeNode.d.ts +11 -4
- three/src/nodes/accessors/InstanceNode.d.ts +2 -3
- three/src/nodes/accessors/Object3DNode.d.ts +6 -6
- three/src/nodes/accessors/SkinningNode.d.ts +4 -3
- three/src/nodes/accessors/StorageTextureNode.d.ts +2 -2
- three/src/nodes/accessors/TextureNode.d.ts +3 -1
- three/src/nodes/accessors/VertexColorNode.d.ts +1 -1
- three/src/nodes/code/ExpressionNode.d.ts +3 -2
- three/src/nodes/code/ScriptableNode.d.ts +1 -1
- three/src/nodes/code/ScriptableValueNode.d.ts +1 -1
- three/src/nodes/core/Node.d.ts +8 -5
- three/src/nodes/core/NodeVarying.d.ts +11 -1
- three/src/nodes/core/StackNode.d.ts +7 -1
- three/src/nodes/core/StructTypeNode.d.ts +1 -1
- three/src/nodes/core/VaryingNode.d.ts +6 -0
- three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +3 -14
- three/src/nodes/lighting/ShadowFilterNode.d.ts +28 -0
- three/src/nodes/lighting/ShadowNode.d.ts +26 -24
- three/src/nodes/math/ConditionalNode.d.ts +4 -4
- three/src/nodes/math/MathNode.d.ts +20 -12
- three/src/nodes/math/OperatorNode.d.ts +65 -25
- three/src/nodes/tsl/TSLBase.d.ts +1 -0
- three/src/nodes/tsl/TSLCore.d.ts +34 -26
- three/src/nodes/utils/DebugNode.d.ts +21 -0
- three/src/nodes/utils/ReflectorNode.d.ts +1 -1
- three/src/nodes/utils/SpriteSheetUVNode.d.ts +2 -2
- three/src/renderers/common/Animation.d.ts +4 -4
- three/src/renderers/common/Attributes.d.ts +1 -1
- three/src/renderers/common/Color4.d.ts +1 -1
- three/src/renderers/common/CubeRenderTarget.d.ts +6 -0
- three/src/renderers/common/RenderList.d.ts +2 -2
- three/src/renderers/common/RenderObject.d.ts +1 -1
- three/src/renderers/common/RenderObjects.d.ts +2 -2
- three/src/renderers/common/Renderer.d.ts +55 -27
- three/src/renderers/common/Textures.d.ts +0 -7
- three/src/renderers/common/TimestampQueryPool.d.ts +1 -0
- three/src/renderers/common/XRManager.d.ts +79 -4
- three/src/renderers/common/nodes/NodeBuilderState.d.ts +3 -3
- three/src/renderers/webgpu/WebGPUBackend.d.ts +1 -0
- three/src/renderers/webgpu/utils/WebGPUConstants.d.ts +1 -1
- three/src/textures/CanvasTexture.d.ts +1 -1
- three/src/textures/DepthArrayTexture.d.ts +14 -0
- three/src/textures/Texture.d.ts +8 -1
- three/src/textures/VideoFrameTexture.d.ts +1 -1
- three/examples/jsm/geometries/ParametricGeometries.d.ts +0 -32
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { KeyframeTrack } from "../KeyframeTrack.js";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* A track for boolean keyframe values.
|
|
5
|
+
*/
|
|
3
6
|
export class BooleanKeyframeTrack extends KeyframeTrack {
|
|
4
|
-
constructor(name: string, times: ArrayLike<number>, values: ArrayLike<any>);
|
|
5
|
-
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* Constructs a new boolean keyframe track.
|
|
9
|
+
*
|
|
10
|
+
* This keyframe track type has no `interpolation` parameter because the
|
|
11
|
+
* interpolation is always discrete.
|
|
12
|
+
*
|
|
13
|
+
* @param {string} name - The keyframe track's name.
|
|
14
|
+
* @param {Array<number>} times - A list of keyframe times.
|
|
15
|
+
* @param {Array<number>} values - A list of keyframe values.
|
|
8
16
|
*/
|
|
9
|
-
|
|
17
|
+
constructor(name: string, times: ArrayLike<number>, values: ArrayLike<number>);
|
|
10
18
|
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { InterpolationModes } from "../../constants.js";
|
|
2
2
|
import { KeyframeTrack } from "../KeyframeTrack.js";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* A track for color keyframe values.
|
|
6
|
+
*/
|
|
4
7
|
export class ColorKeyframeTrack extends KeyframeTrack {
|
|
5
|
-
constructor(name: string, times: ArrayLike<number>, values: ArrayLike<number>, interpolation?: InterpolationModes);
|
|
6
|
-
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
+
* Constructs a new color keyframe track.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} name - The keyframe track's name.
|
|
12
|
+
* @param {Array<number>} times - A list of keyframe times.
|
|
13
|
+
* @param {Array<number>} values - A list of keyframe values.
|
|
14
|
+
* @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.
|
|
9
15
|
*/
|
|
10
|
-
|
|
16
|
+
constructor(name: string, times: ArrayLike<number>, values: ArrayLike<number>, interpolation?: InterpolationModes);
|
|
11
17
|
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { InterpolationModes } from "../../constants.js";
|
|
2
2
|
import { KeyframeTrack } from "../KeyframeTrack.js";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* A track for numeric keyframe values.
|
|
6
|
+
*/
|
|
4
7
|
export class NumberKeyframeTrack extends KeyframeTrack {
|
|
5
|
-
constructor(name: string, times: ArrayLike<number>, values: ArrayLike<number>, interpolation?: InterpolationModes);
|
|
6
|
-
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
+
* Constructs a new number keyframe track.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} name - The keyframe track's name.
|
|
12
|
+
* @param {Array<number>} times - A list of keyframe times.
|
|
13
|
+
* @param {Array<number>} values - A list of keyframe values.
|
|
14
|
+
* @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.
|
|
9
15
|
*/
|
|
10
|
-
|
|
16
|
+
constructor(name: string, times: Array<number>, values: Array<number>, interpolation?: InterpolationModes);
|
|
11
17
|
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { InterpolationModes } from "../../constants.js";
|
|
2
2
|
import { KeyframeTrack } from "../KeyframeTrack.js";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* A track for Quaternion keyframe values.
|
|
6
|
+
*/
|
|
4
7
|
export class QuaternionKeyframeTrack extends KeyframeTrack {
|
|
5
|
-
constructor(name: string, times: ArrayLike<number>, values: ArrayLike<number>, interpolation?: InterpolationModes);
|
|
6
|
-
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
+
* Constructs a new Quaternion keyframe track.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} name - The keyframe track's name.
|
|
12
|
+
* @param {Array<number>} times - A list of keyframe times.
|
|
13
|
+
* @param {Array<number>} values - A list of keyframe values.
|
|
14
|
+
* @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.
|
|
9
15
|
*/
|
|
10
|
-
|
|
16
|
+
constructor(name: string, times: Array<number>, values: Array<number>, interpolation?: InterpolationModes);
|
|
11
17
|
}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { KeyframeTrack } from "../KeyframeTrack.js";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* A track for string keyframe values.
|
|
5
|
+
*/
|
|
3
6
|
export class StringKeyframeTrack extends KeyframeTrack {
|
|
4
|
-
constructor(name: string, times: ArrayLike<number>, values: ArrayLike<any>);
|
|
5
|
-
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* Constructs a new string keyframe track.
|
|
9
|
+
*
|
|
10
|
+
* This keyframe track type has no `interpolation` parameter because the
|
|
11
|
+
* interpolation is always discrete.
|
|
12
|
+
*
|
|
13
|
+
* @param {string} name - The keyframe track's name.
|
|
14
|
+
* @param {Array<number>} times - A list of keyframe times.
|
|
15
|
+
* @param {Array<number>} values - A list of keyframe values.
|
|
8
16
|
*/
|
|
9
|
-
|
|
17
|
+
constructor(name: string, times: Array<number>, values: Array<number>);
|
|
10
18
|
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { InterpolationModes } from "../../constants.js";
|
|
2
2
|
import { KeyframeTrack } from "../KeyframeTrack.js";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* A track for vector keyframe values.
|
|
6
|
+
*/
|
|
4
7
|
export class VectorKeyframeTrack extends KeyframeTrack {
|
|
5
|
-
constructor(name: string, times: ArrayLike<number>, values: ArrayLike<number>, interpolation?: InterpolationModes);
|
|
6
|
-
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
+
* Constructs a new vector keyframe track.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} name - The keyframe track's name.
|
|
12
|
+
* @param {Array<number>} times - A list of keyframe times.
|
|
13
|
+
* @param {Array<number>} values - A list of keyframe values.
|
|
14
|
+
* @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.
|
|
9
15
|
*/
|
|
10
|
-
|
|
16
|
+
constructor(name: string, times: Array<number>, values: Array<number>, interpolation?: InterpolationModes);
|
|
11
17
|
}
|
|
@@ -4,7 +4,7 @@ import { AudioContext } from "./AudioContext.js";
|
|
|
4
4
|
/**
|
|
5
5
|
* The {@link AudioListener} represents a virtual {@link https://developer.mozilla.org/en-US/docs/Web/API/AudioListener | listener} of the all positional and non-positional audio effects in the scene.
|
|
6
6
|
* A three.js application usually creates a single instance of {@link AudioListener} * @remarks
|
|
7
|
-
* It is a mandatory
|
|
7
|
+
* It is a mandatory constructor parameter for audios entities like {@link Audio | Audio} and {@link PositionalAudio | PositionalAudio}.
|
|
8
8
|
* In most cases, the listener object is a child of the camera
|
|
9
9
|
* So the 3D transformation of the camera represents the 3D transformation of the listener.
|
|
10
10
|
* @example
|
|
@@ -18,6 +18,11 @@ export class ArrayCamera extends PerspectiveCamera {
|
|
|
18
18
|
*/
|
|
19
19
|
readonly isArrayCamera: true;
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Whether this camera is used with multiview rendering or not.
|
|
23
|
+
*/
|
|
24
|
+
isMultiViewCamera: boolean;
|
|
25
|
+
|
|
21
26
|
/**
|
|
22
27
|
* An array of cameras.
|
|
23
28
|
* @defaultValue `[]`
|
three/src/constants.d.ts
CHANGED
|
@@ -371,19 +371,6 @@ export const RGBFormat: 1022;
|
|
|
371
371
|
/** {@link RGBAFormat} is the default and reads the red, green, blue and alpha components. */
|
|
372
372
|
export const RGBAFormat: 1023;
|
|
373
373
|
|
|
374
|
-
/**
|
|
375
|
-
* {@link LuminanceFormat} reads each element as a single luminance component.
|
|
376
|
-
* This is then converted to a floating point, clamped to the range `[0,1]`, and then assembled into an RGBA element by
|
|
377
|
-
* placing the luminance value in the red, green and blue channels, and attaching `1.0` to the alpha channel.
|
|
378
|
-
*/
|
|
379
|
-
export const LuminanceFormat: 1024;
|
|
380
|
-
|
|
381
|
-
/**
|
|
382
|
-
* {@link LuminanceAlphaFormat} reads each element as a luminance/alpha double.
|
|
383
|
-
* The same process occurs as for the {@link LuminanceFormat}, except that the alpha channel may have values other than `1.0`.
|
|
384
|
-
*/
|
|
385
|
-
export const LuminanceAlphaFormat: 1025;
|
|
386
|
-
|
|
387
374
|
/**
|
|
388
375
|
* {@link DepthFormat} reads each element as a single depth value, converts it to floating point, and clamps to the range `[0,1]`.
|
|
389
376
|
* @remarks This is the default for {@link THREE.DepthTexture}.
|
|
@@ -420,7 +407,7 @@ export const RGFormat: 1030;
|
|
|
420
407
|
export const RGIntegerFormat: 1031;
|
|
421
408
|
|
|
422
409
|
/**
|
|
423
|
-
* {@link RGBIntegerFormat}
|
|
410
|
+
* {@link RGBIntegerFormat} discards the alpha components and reads the red, green, and blue components.
|
|
424
411
|
*/
|
|
425
412
|
export const RGBIntegerFormat: 1032;
|
|
426
413
|
|
|
@@ -440,8 +427,6 @@ export type PixelFormat =
|
|
|
440
427
|
| typeof AlphaFormat
|
|
441
428
|
| typeof RGBFormat
|
|
442
429
|
| typeof RGBAFormat
|
|
443
|
-
| typeof LuminanceFormat
|
|
444
|
-
| typeof LuminanceAlphaFormat
|
|
445
430
|
| typeof DepthFormat
|
|
446
431
|
| typeof DepthStencilFormat
|
|
447
432
|
| typeof RedFormat
|
|
@@ -478,7 +463,7 @@ export const RGBA_S3TC_DXT1_Format: 33777;
|
|
|
478
463
|
*/
|
|
479
464
|
export const RGBA_S3TC_DXT3_Format: 33778;
|
|
480
465
|
/**
|
|
481
|
-
* A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs
|
|
466
|
+
* A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs from the DXT3 compression in how the alpha compression is done.
|
|
482
467
|
* @remarks Require support for the _WEBGL_compressed_texture_s3tc_ WebGL extension.
|
|
483
468
|
*/
|
|
484
469
|
export const RGBA_S3TC_DXT5_Format: 33779;
|
|
@@ -797,6 +782,22 @@ export const TimestampQuery: {
|
|
|
797
782
|
};
|
|
798
783
|
export type TimestampQuery = "compute" | "render";
|
|
799
784
|
|
|
785
|
+
export const InterpolationSamplingType: {
|
|
786
|
+
PERSPECTIVE: "perspective";
|
|
787
|
+
LINEAR: "linear";
|
|
788
|
+
FLAT: "flat";
|
|
789
|
+
};
|
|
790
|
+
export type InterpolationSamplingType = "perspective" | "linear" | "flat";
|
|
791
|
+
|
|
792
|
+
export const InterpolationSamplingMode: {
|
|
793
|
+
NORMAL: "normal";
|
|
794
|
+
CENTROID: "centroid";
|
|
795
|
+
SAMPLE: "sample";
|
|
796
|
+
FLAT_FIRST: "flat first";
|
|
797
|
+
FLAT_EITHER: "flat either";
|
|
798
|
+
};
|
|
799
|
+
export type InterpolationSamplingMode = "normal" | "centroid" | "sample" | "flat first" | "flat either";
|
|
800
|
+
|
|
800
801
|
///////////////////////////////////////////////////////////////////////////////
|
|
801
802
|
// Texture - Internal Pixel Formats
|
|
802
803
|
|
|
@@ -13,6 +13,17 @@ export type TypedArray =
|
|
|
13
13
|
| Float32Array
|
|
14
14
|
| Float64Array;
|
|
15
15
|
|
|
16
|
+
export type TypedArrayConstructor =
|
|
17
|
+
| Int8ArrayConstructor
|
|
18
|
+
| Uint8ArrayConstructor
|
|
19
|
+
| Uint8ClampedArrayConstructor
|
|
20
|
+
| Int16ArrayConstructor
|
|
21
|
+
| Uint16ArrayConstructor
|
|
22
|
+
| Int32ArrayConstructor
|
|
23
|
+
| Uint32ArrayConstructor
|
|
24
|
+
| Float32ArrayConstructor
|
|
25
|
+
| Float64ArrayConstructor;
|
|
26
|
+
|
|
16
27
|
export interface BufferAttributeJSON {
|
|
17
28
|
itemSize: number;
|
|
18
29
|
type: string;
|
|
@@ -172,9 +172,7 @@ export class BufferGeometry<
|
|
|
172
172
|
* You will have to call {@link dispose | .dispose}(), and create a new instance of {@link THREE.BufferGeometry | BufferGeometry}.
|
|
173
173
|
* @defaultValue `{}`
|
|
174
174
|
*/
|
|
175
|
-
morphAttributes:
|
|
176
|
-
[name: string]: Array<BufferAttribute | InterleavedBufferAttribute>; // TODO Replace for 'Record<>'
|
|
177
|
-
};
|
|
175
|
+
morphAttributes: Record<"position" | "normal" | "color", Array<BufferAttribute | InterleavedBufferAttribute>>;
|
|
178
176
|
|
|
179
177
|
/**
|
|
180
178
|
* Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
|
three/src/core/RenderTarget.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { Texture } from "../textures/Texture.js";
|
|
|
11
11
|
import { EventDispatcher } from "./EventDispatcher.js";
|
|
12
12
|
|
|
13
13
|
export interface RenderTargetOptions {
|
|
14
|
+
depth?: number | undefined;
|
|
14
15
|
wrapS?: Wrapping | undefined;
|
|
15
16
|
wrapT?: Wrapping | undefined;
|
|
16
17
|
magFilter?: MagnificationTextureFilter | undefined;
|
|
@@ -32,6 +33,7 @@ export interface RenderTargetOptions {
|
|
|
32
33
|
*/
|
|
33
34
|
samples?: number | undefined;
|
|
34
35
|
count?: number | undefined;
|
|
36
|
+
multiview?: boolean | undefined;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
export class RenderTarget<TTexture extends Texture | Texture[] = Texture> extends EventDispatcher<{ dispose: {} }> {
|
|
@@ -78,6 +80,13 @@ export class RenderTarget<TTexture extends Texture | Texture[] = Texture> extend
|
|
|
78
80
|
*/
|
|
79
81
|
samples: number;
|
|
80
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Whether to this target is used in multiview rendering.
|
|
85
|
+
*
|
|
86
|
+
* @default false
|
|
87
|
+
*/
|
|
88
|
+
multiview: boolean;
|
|
89
|
+
|
|
81
90
|
constructor(width?: number, height?: number, options?: RenderTargetOptions);
|
|
82
91
|
|
|
83
92
|
get texture(): TTexture;
|
three/src/extras/Controls.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ declare abstract class Controls<TEventMap extends {}> extends EventDispatcher<TE
|
|
|
32
32
|
* Connects the controls to the DOM. This method has so called "side effects" since it adds the module's event
|
|
33
33
|
* listeners to the DOM.
|
|
34
34
|
*/
|
|
35
|
-
connect(): void;
|
|
35
|
+
connect(element: HTMLElement): void;
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* Disconnects the controls from the DOM.
|
three/src/extras/Earcut.d.ts
CHANGED
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
* @see {@link https://threejs.org/docs/index.html#api/en/extras/Earcut | Official Documentation}
|
|
6
6
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/Earcut.js | Source}
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
declare class Earcut {
|
|
9
9
|
/**
|
|
10
10
|
* Triangulates the given shape definition by returning an array of triangles
|
|
11
11
|
* @remarks
|
|
12
12
|
* A triangle is defined by three consecutive integers representing vertex indices.
|
|
13
13
|
*/
|
|
14
|
-
triangulate(data: number[], holeIndices?: number[], dim?: number): number[];
|
|
15
|
-
}
|
|
14
|
+
static triangulate(data: number[], holeIndices?: number[], dim?: number): number[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { Earcut };
|
three/src/extras/ImageUtils.d.ts
CHANGED
|
@@ -19,11 +19,18 @@ export class CapsuleGeometry extends BufferGeometry {
|
|
|
19
19
|
/**
|
|
20
20
|
* Create a new instance of {@link CapsuleGeometry}
|
|
21
21
|
* @param radius Radius of the capsule. Expects a `Float`. Default `1`
|
|
22
|
-
* @param
|
|
22
|
+
* @param height Height of the middle section. Expects a `Float`. Default `1`
|
|
23
23
|
* @param capSegments Number of curve segments used to build the caps. Expects a `Integer`. Default `4`
|
|
24
24
|
* @param radialSegments Number of segmented faces around the circumference of the capsule. Expects a `Integer`. Default `8`
|
|
25
|
+
* @param heightSegments Number of rows of faces along the height of the capsule. Optional; defaults to `1`.
|
|
25
26
|
*/
|
|
26
|
-
constructor(
|
|
27
|
+
constructor(
|
|
28
|
+
radius?: number,
|
|
29
|
+
height?: number,
|
|
30
|
+
capSegments?: number,
|
|
31
|
+
radialSegments?: number,
|
|
32
|
+
heightSegments?: number,
|
|
33
|
+
);
|
|
27
34
|
|
|
28
35
|
/**
|
|
29
36
|
* A Read-only _string_ to check if `this` object type.
|
|
@@ -38,7 +45,7 @@ export class CapsuleGeometry extends BufferGeometry {
|
|
|
38
45
|
*/
|
|
39
46
|
readonly parameters: {
|
|
40
47
|
readonly radius: number;
|
|
41
|
-
readonly
|
|
48
|
+
readonly height: number;
|
|
42
49
|
readonly capSegments: number;
|
|
43
50
|
readonly radialSegments: number;
|
|
44
51
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Camera } from "../cameras/Camera.js";
|
|
2
|
+
import { TextureDataType } from "../constants.js";
|
|
2
3
|
import { Object3DJSONObject } from "../core/Object3D.js";
|
|
3
4
|
import { Frustum } from "../math/Frustum.js";
|
|
4
5
|
import { Matrix4 } from "../math/Matrix4.js";
|
|
@@ -86,6 +87,13 @@ export class LightShadow<TCamera extends Camera = Camera> {
|
|
|
86
87
|
*/
|
|
87
88
|
mapSize: Vector2;
|
|
88
89
|
|
|
90
|
+
/**
|
|
91
|
+
* The type of shadow texture. The default is `UnsignedByteType`.
|
|
92
|
+
*
|
|
93
|
+
* @default UnsignedByteType
|
|
94
|
+
*/
|
|
95
|
+
mapType: TextureDataType;
|
|
96
|
+
|
|
89
97
|
/**
|
|
90
98
|
* The depth map generated using the internal camera; a location beyond a pixel's depth is in shadow. Computed internally during rendering.
|
|
91
99
|
* @defaultValue null
|
three/src/lights/PointLight.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ import { PointLightShadow } from "./PointLightShadow.js";
|
|
|
22
22
|
export class PointLight extends Light<PointLightShadow> {
|
|
23
23
|
/**
|
|
24
24
|
* Creates a new PointLight.
|
|
25
|
-
* @param color Hexadecimal color of the light. Default is 0xffffff (white). Expects
|
|
25
|
+
* @param color Hexadecimal color of the light. Default is 0xffffff (white). Expects an `Integer`
|
|
26
26
|
* @param intensity Numeric value of the light's strength/intensity. Expects a `Float`. Default `1`
|
|
27
27
|
* @param distance Maximum range of the light. Default is 0 (no limit).
|
|
28
28
|
* @param decay The amount the light dims along the distance of the light. Expects a `Float`. Default `2`
|
|
@@ -11,8 +11,8 @@ export class FileLoader extends Loader<string | ArrayBuffer> {
|
|
|
11
11
|
onError?: (err: unknown) => void,
|
|
12
12
|
): void;
|
|
13
13
|
|
|
14
|
-
mimeType: string
|
|
15
|
-
responseType: string
|
|
14
|
+
mimeType: string;
|
|
15
|
+
responseType: string;
|
|
16
16
|
|
|
17
17
|
setMimeType(mimeType: string): FileLoader;
|
|
18
18
|
setResponseType(responseType: string): FileLoader;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
export class LoaderUtils {
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead.
|
|
4
|
-
*/
|
|
5
|
-
static decodeText(array: BufferSource): string;
|
|
6
|
-
|
|
7
2
|
static extractUrlBase(url: string): string;
|
|
8
3
|
|
|
9
4
|
static resolveURL(url: string, path: string): string;
|
|
@@ -52,6 +52,7 @@ export interface MaterialParameters {
|
|
|
52
52
|
precision?: "highp" | "mediump" | "lowp" | null | undefined;
|
|
53
53
|
premultipliedAlpha?: boolean | undefined;
|
|
54
54
|
forceSinglePass?: boolean | undefined;
|
|
55
|
+
allowOverride?: boolean | undefined;
|
|
55
56
|
dithering?: boolean | undefined;
|
|
56
57
|
side?: Side | undefined;
|
|
57
58
|
shadowSide?: Side | undefined;
|
|
@@ -286,7 +287,7 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
|
|
|
286
287
|
blendDst: BlendingDstFactor;
|
|
287
288
|
|
|
288
289
|
/**
|
|
289
|
-
* The
|
|
290
|
+
* The transparency of the .blendDst. Default is null.
|
|
290
291
|
* @default null
|
|
291
292
|
*/
|
|
292
293
|
blendDstAlpha: number | null;
|
|
@@ -298,7 +299,7 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
|
|
|
298
299
|
blendEquation: BlendingEquation;
|
|
299
300
|
|
|
300
301
|
/**
|
|
301
|
-
* The
|
|
302
|
+
* The transparency of the .blendEquation. Default is null.
|
|
302
303
|
* @default null
|
|
303
304
|
*/
|
|
304
305
|
blendEquationAlpha: number | null;
|
|
@@ -316,7 +317,7 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
|
|
|
316
317
|
blendSrc: BlendingSrcFactor | BlendingDstFactor;
|
|
317
318
|
|
|
318
319
|
/**
|
|
319
|
-
* The
|
|
320
|
+
* The transparency of the .blendSrc. Default is null.
|
|
320
321
|
* @default null
|
|
321
322
|
*/
|
|
322
323
|
blendSrcAlpha: number | null;
|
|
@@ -479,6 +480,8 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
|
|
|
479
480
|
*/
|
|
480
481
|
forceSinglePass: boolean;
|
|
481
482
|
|
|
483
|
+
allowOverride: boolean;
|
|
484
|
+
|
|
482
485
|
/**
|
|
483
486
|
* Whether to apply dithering to the color to remove the appearance of banding. Default is false.
|
|
484
487
|
* @default false
|
|
@@ -625,9 +628,4 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
|
|
|
625
628
|
* @default false
|
|
626
629
|
*/
|
|
627
630
|
set needsUpdate(value: boolean);
|
|
628
|
-
|
|
629
|
-
/**
|
|
630
|
-
* @deprecated onBuild() has been removed.
|
|
631
|
-
*/
|
|
632
|
-
onBuild(object: Object3D, parameters: WebGLProgramParametersWithUniforms, renderer: WebGLRenderer): void;
|
|
633
631
|
}
|
|
@@ -27,7 +27,8 @@ export interface NodeMaterialParameters extends MaterialParameters {
|
|
|
27
27
|
geometryNode?: Node | null | undefined;
|
|
28
28
|
|
|
29
29
|
depthNode?: Node | null | undefined;
|
|
30
|
-
|
|
30
|
+
receivedShadowPositionNode?: Node | null | undefined;
|
|
31
|
+
castShadowPositionNode?: Node | null | undefined;
|
|
31
32
|
|
|
32
33
|
outputNode?: Node | null | undefined;
|
|
33
34
|
|
|
@@ -59,7 +60,8 @@ declare class NodeMaterial extends Material {
|
|
|
59
60
|
geometryNode: Node | null;
|
|
60
61
|
|
|
61
62
|
depthNode: Node | null;
|
|
62
|
-
|
|
63
|
+
receivedShadowPositionNode: Node | null;
|
|
64
|
+
castShadowPositionNode: Node | null;
|
|
63
65
|
receivedShadowNode: (() => Node) | null;
|
|
64
66
|
castShadowNode: Node | null;
|
|
65
67
|
|
|
@@ -69,6 +71,12 @@ declare class NodeMaterial extends Material {
|
|
|
69
71
|
fragmentNode: Node | null;
|
|
70
72
|
vertexNode: Node | null;
|
|
71
73
|
|
|
74
|
+
/**
|
|
75
|
+
* @deprecated ".shadowPositionNode" was renamed to ".receivedShadowPositionNode".'
|
|
76
|
+
*/
|
|
77
|
+
get shadowPositionNode(): Node | null;
|
|
78
|
+
set shadowPositionNode(value: Node | null);
|
|
79
|
+
|
|
72
80
|
constructor();
|
|
73
81
|
|
|
74
82
|
build(builder: NodeBuilder): void;
|
|
@@ -2,6 +2,7 @@ import { BufferAttribute } from "../../../core/BufferAttribute.js";
|
|
|
2
2
|
import { Matrix4 } from "../../../math/Matrix4.js";
|
|
3
3
|
import NodeBuilder from "../../../nodes/core/NodeBuilder.js";
|
|
4
4
|
import NodeFrame from "../../../nodes/core/NodeFrame.js";
|
|
5
|
+
import Renderer from "../../../renderers/common/Renderer.js";
|
|
5
6
|
import RenderObject from "../../../renderers/common/RenderObject.js";
|
|
6
7
|
import { Material } from "../../Material.js";
|
|
7
8
|
declare const refreshUniforms: readonly [
|
|
@@ -103,6 +104,13 @@ declare class NodeMaterialObserver {
|
|
|
103
104
|
* @return {boolean} Whether the given render object is verified for the first time of this observer.
|
|
104
105
|
*/
|
|
105
106
|
firstInitialization(renderObject: RenderObject): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Returns `true` if the current rendering produces motion vectors.
|
|
109
|
+
*
|
|
110
|
+
* @param {Renderer} renderer - The renderer.
|
|
111
|
+
* @return {boolean} Whether the current rendering produces motion vectors or not.
|
|
112
|
+
*/
|
|
113
|
+
needsVelocity(renderer: Renderer): boolean;
|
|
106
114
|
/**
|
|
107
115
|
* Returns monitoring data for the given render object.
|
|
108
116
|
*
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ArrayCamera } from "../cameras/ArrayCamera.js";
|
|
2
|
+
import { CoordinateSystem } from "../constants.js";
|
|
3
|
+
import { Object3D } from "../core/Object3D.js";
|
|
4
|
+
import { Sprite } from "../objects/Sprite.js";
|
|
5
|
+
import { Box3 } from "./Box3.js";
|
|
6
|
+
import { Sphere } from "./Sphere.js";
|
|
7
|
+
import { Vector3 } from "./Vector3.js";
|
|
8
|
+
|
|
9
|
+
declare class FrustumArray {
|
|
10
|
+
coordinateSystem: CoordinateSystem;
|
|
11
|
+
|
|
12
|
+
constructor();
|
|
13
|
+
|
|
14
|
+
intersectsObject(object: Object3D, cameraArray: ArrayCamera): boolean;
|
|
15
|
+
|
|
16
|
+
intersectsSprite(sprite: Sprite, cameraArray: ArrayCamera): boolean;
|
|
17
|
+
|
|
18
|
+
intersectsSprite(sphere: Sphere, cameraArray: ArrayCamera): boolean;
|
|
19
|
+
|
|
20
|
+
intersectsBox(box: Box3, cameraArray: ArrayCamera): boolean;
|
|
21
|
+
|
|
22
|
+
containsPoint(point: Vector3, cameraArray: ArrayCamera): boolean;
|
|
23
|
+
|
|
24
|
+
clone(): FrustumArray;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { FrustumArray };
|
three/src/nodes/Nodes.d.ts
CHANGED
|
@@ -51,6 +51,7 @@ export { NodeUtils };
|
|
|
51
51
|
// utils
|
|
52
52
|
export { default as ArrayElementNode } from "./utils/ArrayElementNode.js";
|
|
53
53
|
export { default as ConvertNode } from "./utils/ConvertNode.js";
|
|
54
|
+
export { default as DebugNode } from "./utils/DebugNode.js";
|
|
54
55
|
export { default as EquirectUVNode } from "./utils/EquirectUVNode.js";
|
|
55
56
|
export { default as FunctionOverloadingNode } from "./utils/FunctionOverloadingNode.js";
|
|
56
57
|
export { default as JoinNode } from "./utils/JoinNode.js";
|
three/src/nodes/TSL.d.ts
CHANGED
|
@@ -135,6 +135,7 @@ export * from "./lighting/LightsNode.js";
|
|
|
135
135
|
export * from "./lighting/PointLightNode.js";
|
|
136
136
|
export * from "./lighting/PointShadowNode.js";
|
|
137
137
|
export * from "./lighting/ShadowBaseNode.js";
|
|
138
|
+
export * from "./lighting/ShadowFilterNode.js";
|
|
138
139
|
export * from "./lighting/ShadowNode.js";
|
|
139
140
|
|
|
140
141
|
// pmrem
|
|
@@ -4,6 +4,8 @@ import { InterleavedBuffer } from "../../core/InterleavedBuffer.js";
|
|
|
4
4
|
import { InterleavedBufferAttribute } from "../../core/InterleavedBufferAttribute.js";
|
|
5
5
|
import InputNode from "../core/InputNode.js";
|
|
6
6
|
import NodeBuilder from "../core/NodeBuilder.js";
|
|
7
|
+
import { ShaderNodeObject } from "../tsl/TSLCore.js";
|
|
8
|
+
import BufferNode from "./BufferNode.js";
|
|
7
9
|
/**
|
|
8
10
|
* In earlier `three.js` versions it was only possible to define attribute data
|
|
9
11
|
* on geometry level. With `BufferAttributeNode`, it is also possible to do this
|
|
@@ -119,7 +121,7 @@ export declare const bufferAttribute: (
|
|
|
119
121
|
type?: string | null,
|
|
120
122
|
stride?: number,
|
|
121
123
|
offset?: number,
|
|
122
|
-
) =>
|
|
124
|
+
) => ShaderNodeObject<BufferAttributeNode>;
|
|
123
125
|
/**
|
|
124
126
|
* TSL function for creating a buffer attribute node but with dynamic draw usage.
|
|
125
127
|
* Use this function if attribute data are updated per frame.
|
|
@@ -137,7 +139,7 @@ export declare const dynamicBufferAttribute: (
|
|
|
137
139
|
type?: string | null,
|
|
138
140
|
stride?: number,
|
|
139
141
|
offset?: number,
|
|
140
|
-
) =>
|
|
142
|
+
) => ShaderNodeObject<BufferAttributeNode>;
|
|
141
143
|
/**
|
|
142
144
|
* TSL function for creating a buffer attribute node but with enabled instancing
|
|
143
145
|
*
|
|
@@ -154,7 +156,7 @@ export declare const instancedBufferAttribute: (
|
|
|
154
156
|
type?: string | null,
|
|
155
157
|
stride?: number,
|
|
156
158
|
offset?: number,
|
|
157
|
-
) =>
|
|
159
|
+
) => ShaderNodeObject<BufferAttributeNode>;
|
|
158
160
|
/**
|
|
159
161
|
* TSL function for creating a buffer attribute node but with dynamic draw usage and enabled instancing
|
|
160
162
|
*
|
|
@@ -171,4 +173,9 @@ export declare const instancedDynamicBufferAttribute: (
|
|
|
171
173
|
type?: string | null,
|
|
172
174
|
stride?: number,
|
|
173
175
|
offset?: number,
|
|
174
|
-
) =>
|
|
176
|
+
) => ShaderNodeObject<BufferAttributeNode>;
|
|
177
|
+
declare module "../tsl/TSLCore.js" {
|
|
178
|
+
interface NodeElements {
|
|
179
|
+
toAttribute: <TValue>(bufferNode: BufferNode<TValue>) => ShaderNodeObject<BufferAttributeNode>;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { InstancedBufferAttribute } from "../../core/InstancedBufferAttribute.js";
|
|
2
|
-
import { InstancedMesh } from "../../objects/InstancedMesh.js";
|
|
3
2
|
import Node from "../core/Node.js";
|
|
4
3
|
import { ShaderNodeObject } from "../tsl/TSLCore.js";
|
|
5
4
|
|
|
@@ -14,12 +13,12 @@ export default class InstanceNode extends Node {
|
|
|
14
13
|
constructor(
|
|
15
14
|
count: number,
|
|
16
15
|
instanceMatrix: InstancedBufferAttribute,
|
|
17
|
-
instanceColor
|
|
16
|
+
instanceColor?: InstancedBufferAttribute | null,
|
|
18
17
|
);
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
export const instance: (
|
|
22
21
|
count: number,
|
|
23
22
|
instanceMatrix: InstancedBufferAttribute,
|
|
24
|
-
instanceColor
|
|
23
|
+
instanceColor?: InstancedBufferAttribute | null,
|
|
25
24
|
) => ShaderNodeObject<InstanceNode>;
|