@types/three 0.152.0 → 0.153.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 +1 -1
- three/examples/jsm/animation/MMDAnimationHelper.d.ts +2 -0
- three/examples/jsm/csm/CSM.d.ts +1 -1
- three/examples/jsm/exporters/DRACOExporter.d.ts +1 -1
- three/examples/jsm/exporters/PLYExporter.d.ts +20 -3
- three/examples/jsm/exporters/STLExporter.d.ts +11 -1
- three/examples/jsm/geometries/TeapotGeometry.d.ts +1 -1
- three/examples/jsm/loaders/IFCLoader.d.ts +68 -68
- three/examples/jsm/misc/GPUComputationRenderer.d.ts +1 -1
- three/examples/jsm/nodes/accessors/ModelViewProjectionNode.d.ts +1 -1
- three/examples/jsm/nodes/core/NodeBuilder.d.ts +1 -1
- three/examples/jsm/postprocessing/FilmPass.d.ts +1 -1
- three/examples/jsm/utils/UVsDebug.d.ts +1 -1
- three/index.d.ts +1 -1
- three/package.json +2 -2
- three/src/cameras/Camera.d.ts +7 -4
- three/src/cameras/CubeCamera.d.ts +5 -0
- three/src/constants.d.ts +26 -2
- three/src/core/BufferAttribute.d.ts +10 -2
- three/src/helpers/GridHelper.d.ts +3 -1
- three/src/lights/DirectionalLight.d.ts +1 -1
- three/src/lights/Light.d.ts +1 -1
- three/src/lights/PointLight.d.ts +4 -4
- three/src/lights/RectAreaLight.d.ts +2 -2
- three/src/lights/SpotLight.d.ts +5 -5
- three/src/loaders/Loader.d.ts +1 -1
- three/src/materials/MeshPhysicalMaterial.d.ts +19 -0
- three/src/math/Color.d.ts +2 -1
- three/src/math/Frustum.d.ts +2 -1
- three/src/math/MathUtils.d.ts +65 -44
- three/src/math/Matrix3.d.ts +16 -1
- three/src/math/Matrix4.d.ts +45 -8
- three/src/math/Vector2.d.ts +5 -0
- three/src/math/Vector3.d.ts +5 -0
- three/src/math/Vector4.d.ts +5 -0
- three/src/renderers/WebGLRenderer.d.ts +3 -1
- three/src/renderers/webxr/WebXRManager.d.ts +23 -6
- three/src/textures/DepthTexture.d.ts +9 -0
- three/src/textures/FramebufferTexture.d.ts +2 -3
- three/src/textures/Source.d.ts +2 -0
- three/examples/jsm/exporters/ColladaExporter.d.ts +0 -22
- three/examples/jsm/geometries/LightningStrike.d.ts +0 -108
- three/examples/jsm/loaders/PRWMLoader.d.ts +0 -16
- three/examples/jsm/objects/LightningStorm.d.ts +0 -32
- three/examples/jsm/postprocessing/AdaptiveToneMappingPass.d.ts +0 -29
- three/examples/jsm/shaders/ToneMapShader.d.ts +0 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Usage } from '../constants';
|
|
1
|
+
import { Usage, AttributeGPUType } from '../constants';
|
|
2
2
|
import { Matrix3 } from './../math/Matrix3';
|
|
3
3
|
import { Matrix4 } from './../math/Matrix4';
|
|
4
4
|
|
|
@@ -66,6 +66,14 @@ export class BufferAttribute {
|
|
|
66
66
|
*/
|
|
67
67
|
usage: Usage;
|
|
68
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Configures the bound GPU type for use in shaders. Either {@link FloatType} or {@link IntType}, default is {@link FloatType}.
|
|
71
|
+
*
|
|
72
|
+
* Note: this only has an effect for integer arrays and is not configurable for float arrays. For lower precision
|
|
73
|
+
* float types, see https://threejs.org/docs/#api/en/core/bufferAttributeTypes/BufferAttributeTypes.
|
|
74
|
+
*/
|
|
75
|
+
gpuType: AttributeGPUType;
|
|
76
|
+
|
|
69
77
|
/**
|
|
70
78
|
* This can be used to only update some components of stored vectors (for example, just the component related to color).
|
|
71
79
|
* @defaultValue `{ offset: number = 0; count: number = -1 }`
|
|
@@ -161,7 +169,7 @@ export class BufferAttribute {
|
|
|
161
169
|
|
|
162
170
|
/**
|
|
163
171
|
* Copy the array given here (which can be a normal array or `TypedArray`) into {@link BufferAttribute.array | array}.
|
|
164
|
-
* @
|
|
172
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set | TypedArray.set} for notes on requirements if copying a `TypedArray`.
|
|
165
173
|
*/
|
|
166
174
|
copyArray(array: ArrayLike<number>): this;
|
|
167
175
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ColorRepresentation } from '../math/Color';
|
|
2
2
|
import { LineSegments } from './../objects/LineSegments';
|
|
3
|
+
import { BufferGeometry } from '../core/BufferGeometry';
|
|
4
|
+
import { LineBasicMaterial } from '../materials/LineBasicMaterial';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* The {@link GridHelper} is an object to define grids
|
|
@@ -16,7 +18,7 @@ import { LineSegments } from './../objects/LineSegments';
|
|
|
16
18
|
* @see {@link https://threejs.org/docs/index.html#api/en/helpers/GridHelper | Official Documentation}
|
|
17
19
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/GridHelper.js | Source}
|
|
18
20
|
*/
|
|
19
|
-
export class GridHelper extends LineSegments {
|
|
21
|
+
export class GridHelper extends LineSegments<BufferGeometry, LineBasicMaterial> {
|
|
20
22
|
/**
|
|
21
23
|
* Creates a new {@link GridHelper} of size 'size' and divided into 'divisions' segments per side
|
|
22
24
|
* @remarks
|
|
@@ -65,7 +65,7 @@ export class DirectionalLight extends Light<DirectionalLightShadow> {
|
|
|
65
65
|
* This is set equal to {@link THREE.Object3D.DEFAULT_UP}, so that the light shines from the top down.
|
|
66
66
|
* @defaultValue {@link Object3D.DEFAULT_UP} _(0, 1, 0)_
|
|
67
67
|
*/
|
|
68
|
-
override position: Vector3;
|
|
68
|
+
override readonly position: Vector3;
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
71
|
* A {@link THREE.DirectionalLightShadow | DirectionalLightShadow} used to calculate shadows for this light.
|
three/src/lights/Light.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export abstract class Light<TShadowSupport extends LightShadow | undefined = Lig
|
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* The light's intensity, or strength.
|
|
41
|
-
*
|
|
41
|
+
* When {@link THREE.WebGLRenderer.useLegacyLights | legacy lighting mode} is disabled, the units of intensity depend on the type of light.
|
|
42
42
|
* @remarks Expects a `Float`
|
|
43
43
|
* @defaultValue `1`
|
|
44
44
|
*/
|
three/src/lights/PointLight.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export class PointLight extends Light<PointLightShadow> {
|
|
|
37
37
|
/**
|
|
38
38
|
* The light's intensity.
|
|
39
39
|
*
|
|
40
|
-
* When **{@link WebGLRenderer.
|
|
40
|
+
* When **{@link WebGLRenderer.useLegacyLights | legacy lighting mode} is disabled** — intensity is the luminous intensity of the light measured in candela (cd).
|
|
41
41
|
* @remarks Changing the intensity will also change the light's power.
|
|
42
42
|
* @remarks Expects a `Float`
|
|
43
43
|
* @defaultValue `1`
|
|
@@ -48,7 +48,7 @@ export class PointLight extends Light<PointLightShadow> {
|
|
|
48
48
|
* When **Default mode** — When distance is zero, light does not attenuate. When distance is non-zero,
|
|
49
49
|
* light will attenuate linearly from maximum intensity at the light's position down to zero at this distance from the light.
|
|
50
50
|
*
|
|
51
|
-
* When **{@link WebGLRenderer.
|
|
51
|
+
* When **{@link WebGLRenderer.useLegacyLights | legacy lighting mode} is disabled** — When distance is zero,
|
|
52
52
|
* light will attenuate according to inverse-square law to infinite distance.
|
|
53
53
|
* When distance is non-zero, light will attenuate according to inverse-square law until near the distance cutoff,
|
|
54
54
|
* where it will then attenuate quickly and smoothly to 0. Inherently, cutoffs are not physically correct.
|
|
@@ -68,7 +68,7 @@ export class PointLight extends Light<PointLightShadow> {
|
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
70
|
* The amount the light dims along the distance of the light.
|
|
71
|
-
* In
|
|
71
|
+
* In context of physically-correct rendering the default value should not be changed.
|
|
72
72
|
* @remarks Expects a `Float`
|
|
73
73
|
* @defaultValue `2`
|
|
74
74
|
*/
|
|
@@ -87,7 +87,7 @@ export class PointLight extends Light<PointLightShadow> {
|
|
|
87
87
|
|
|
88
88
|
/**
|
|
89
89
|
* The light's power.
|
|
90
|
-
* When **{@link WebGLRenderer.
|
|
90
|
+
* When **{@link WebGLRenderer.useLegacyLights | legacy lighting mode} is disabled** — power is the luminous power of the light measured in lumens (lm).
|
|
91
91
|
* @remarks Changing the power will also change the light's intensity.
|
|
92
92
|
* @remarks Expects a `Float`
|
|
93
93
|
*/
|
|
@@ -66,7 +66,7 @@ export class RectAreaLight extends Light<undefined> {
|
|
|
66
66
|
/**
|
|
67
67
|
* The light's intensity.
|
|
68
68
|
* @remarks Changing the intensity will also change the light's power.
|
|
69
|
-
*
|
|
69
|
+
* When **{@link WebGLRenderer.useLegacyLights | legacy lighting mode} is disabled** — intensity is the luminance (brightness) of the light measured in nits (cd/m^2).
|
|
70
70
|
* @remarks Expects a `Float`
|
|
71
71
|
* @defaultValue `1`
|
|
72
72
|
*/
|
|
@@ -75,7 +75,7 @@ export class RectAreaLight extends Light<undefined> {
|
|
|
75
75
|
/**
|
|
76
76
|
* The light's power.
|
|
77
77
|
* @remarks Changing the power will also change the light's intensity.
|
|
78
|
-
*
|
|
78
|
+
* When **{@link WebGLRenderer.useLegacyLights | legacy lighting mode} is disabled** — power is the luminous power of the light measured in lumens (lm).
|
|
79
79
|
* @remarks Expects a `Float`
|
|
80
80
|
*/
|
|
81
81
|
power: number;
|
three/src/lights/SpotLight.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ export class SpotLight extends Light<SpotLightShadow> {
|
|
|
63
63
|
* This is set equal to {@link THREE.Object3D.DEFAULT_UP | Object3D.DEFAULT_UP} (0, 1, 0), so that the light shines from the top down.
|
|
64
64
|
* @defaultValue `{@link Object3D.DEFAULT_UP}`
|
|
65
65
|
*/
|
|
66
|
-
position: Vector3;
|
|
66
|
+
readonly position: Vector3;
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* The {@link SpotLight} points from its {@link SpotLight.position | position} to target.position.
|
|
@@ -97,7 +97,7 @@ export class SpotLight extends Light<SpotLightShadow> {
|
|
|
97
97
|
/**
|
|
98
98
|
* The light's intensity.
|
|
99
99
|
* @remarks Changing the intensity will also change the light's power.
|
|
100
|
-
* When **{@link WebGLRenderer.
|
|
100
|
+
* When **{@link WebGLRenderer.useLegacyLights | legacy lighting mode} is disabled** — intensity is the luminous intensity of the light measured in candela (cd).
|
|
101
101
|
* @remarks Expects a `Float`
|
|
102
102
|
* @defaultValue `1`
|
|
103
103
|
*/
|
|
@@ -107,7 +107,7 @@ export class SpotLight extends Light<SpotLightShadow> {
|
|
|
107
107
|
* When **Default mode** — When distance is zero, light does not attenuate. When distance is non-zero,
|
|
108
108
|
* light will attenuate linearly from maximum intensity at the light's position down to zero at this distance from the light.
|
|
109
109
|
*
|
|
110
|
-
* When **{@link WebGLRenderer.
|
|
110
|
+
* When **{@link WebGLRenderer.useLegacyLights | legacy lighting mode} is disabled** — When distance is zero,
|
|
111
111
|
* light will attenuate according to inverse-square law to infinite distance.
|
|
112
112
|
* When distance is non-zero, light will attenuate according to inverse-square law until near the distance cutoff,
|
|
113
113
|
* where it will then attenuate quickly and smoothly to `0`. Inherently, cutoffs are not physically correct.
|
|
@@ -126,7 +126,7 @@ export class SpotLight extends Light<SpotLightShadow> {
|
|
|
126
126
|
|
|
127
127
|
/**
|
|
128
128
|
* The amount the light dims along the distance of the light.
|
|
129
|
-
* In
|
|
129
|
+
* In context of physically-correct rendering the default value should not be changed.
|
|
130
130
|
* @remarks Expects a `Float`
|
|
131
131
|
* @defaultValue `2`
|
|
132
132
|
*/
|
|
@@ -141,7 +141,7 @@ export class SpotLight extends Light<SpotLightShadow> {
|
|
|
141
141
|
/**
|
|
142
142
|
* The light's power.
|
|
143
143
|
* @remarks Changing the power will also change the light's intensity.
|
|
144
|
-
*
|
|
144
|
+
* When **{@link WebGLRenderer.useLegacyLights | legacy lighting mode} is disabled** — power is the luminous power of the light measured in lumens (lm).
|
|
145
145
|
* @remarks Expects a `Float`
|
|
146
146
|
*/
|
|
147
147
|
power: number;
|
three/src/loaders/Loader.d.ts
CHANGED
|
@@ -39,6 +39,10 @@ export interface MeshPhysicalMaterialParameters extends MeshStandardMaterialPara
|
|
|
39
39
|
iridescence?: number | undefined;
|
|
40
40
|
iridescenceThicknessRange?: [number, number] | undefined;
|
|
41
41
|
iridescenceThicknessMap?: Texture | null | undefined;
|
|
42
|
+
|
|
43
|
+
anisotropy?: number | undefined;
|
|
44
|
+
anisotropyRotation?: number | undefined;
|
|
45
|
+
anisotropyMap?: Texture | null | undefined;
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
export class MeshPhysicalMaterial extends MeshStandardMaterial {
|
|
@@ -193,4 +197,19 @@ export class MeshPhysicalMaterial extends MeshStandardMaterial {
|
|
|
193
197
|
* @default null
|
|
194
198
|
*/
|
|
195
199
|
iridescenceThicknessMap: Texture | null;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* @default 0
|
|
203
|
+
*/
|
|
204
|
+
anisotropy?: number;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @default 0
|
|
208
|
+
*/
|
|
209
|
+
anisotropyRotation?: number;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* @default null
|
|
213
|
+
*/
|
|
214
|
+
anisotropyMap?: Texture | null;
|
|
196
215
|
}
|
three/src/math/Color.d.ts
CHANGED
|
@@ -204,7 +204,8 @@ export class Color {
|
|
|
204
204
|
*/
|
|
205
205
|
b: number;
|
|
206
206
|
|
|
207
|
-
set(color: ColorRepresentation):
|
|
207
|
+
set(color: ColorRepresentation): this;
|
|
208
|
+
set(r: number, g: number, b: number): this;
|
|
208
209
|
|
|
209
210
|
/**
|
|
210
211
|
* Sets this color's {@link r}, {@link g} and {@link b} components from the x, y, and z components of the specified
|
three/src/math/Frustum.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { Sprite } from './../objects/Sprite';
|
|
|
5
5
|
import { Sphere } from './Sphere';
|
|
6
6
|
import { Box3 } from './Box3';
|
|
7
7
|
import { Vector3 } from './Vector3';
|
|
8
|
+
import { CoordinateSystem } from '../constants';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Frustums are used to determine what is inside the camera's field of view. They help speed up the rendering process.
|
|
@@ -20,7 +21,7 @@ export class Frustum {
|
|
|
20
21
|
set(p0: Plane, p1: Plane, p2: Plane, p3: Plane, p4: Plane, p5: Plane): Frustum;
|
|
21
22
|
clone(): this;
|
|
22
23
|
copy(frustum: Frustum): this;
|
|
23
|
-
setFromProjectionMatrix(m: Matrix4): this;
|
|
24
|
+
setFromProjectionMatrix(m: Matrix4, coordinateSystem?: CoordinateSystem): this;
|
|
24
25
|
intersectsObject(object: Object3D): boolean;
|
|
25
26
|
intersectsSprite(sprite: Sprite): boolean;
|
|
26
27
|
intersectsSphere(sphere: Sphere): boolean;
|
three/src/math/MathUtils.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { Quaternion } from './Quaternion';
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
export const DEG2RAD: number;
|
|
8
|
+
|
|
8
9
|
export const RAD2DEG: number;
|
|
9
10
|
|
|
10
11
|
export function generateUUID(): string;
|
|
@@ -13,10 +14,11 @@ export function generateUUID(): string;
|
|
|
13
14
|
* Clamps the x to be between a and b.
|
|
14
15
|
*
|
|
15
16
|
* @param value Value to be clamped.
|
|
16
|
-
* @param min Minimum value
|
|
17
|
+
* @param min Minimum value.
|
|
17
18
|
* @param max Maximum value.
|
|
18
19
|
*/
|
|
19
20
|
export function clamp(value: number, min: number, max: number): number;
|
|
21
|
+
|
|
20
22
|
export function euclideanModulo(n: number, m: number): number;
|
|
21
23
|
|
|
22
24
|
/**
|
|
@@ -30,44 +32,6 @@ export function euclideanModulo(n: number, m: number): number;
|
|
|
30
32
|
*/
|
|
31
33
|
export function mapLinear(x: number, a1: number, a2: number, b1: number, b2: number): number;
|
|
32
34
|
|
|
33
|
-
export function smoothstep(x: number, min: number, max: number): number;
|
|
34
|
-
|
|
35
|
-
export function smootherstep(x: number, min: number, max: number): number;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Random float from 0 to 1 with 16 bits of randomness.
|
|
39
|
-
* Standard Math.random() creates repetitive patterns when applied over larger space.
|
|
40
|
-
*
|
|
41
|
-
* @deprecated Use {@link Math#random Math.random()}
|
|
42
|
-
*/
|
|
43
|
-
export function random16(): number;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Random integer from low to high interval.
|
|
47
|
-
*/
|
|
48
|
-
export function randInt(low: number, high: number): number;
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Random float from low to high interval.
|
|
52
|
-
*/
|
|
53
|
-
export function randFloat(low: number, high: number): number;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Random float from - range / 2 to range / 2 interval.
|
|
57
|
-
*/
|
|
58
|
-
export function randFloatSpread(range: number): number;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Deterministic pseudo-random float in the interval [ 0, 1 ].
|
|
62
|
-
*/
|
|
63
|
-
export function seededRandom(seed?: number): number;
|
|
64
|
-
|
|
65
|
-
export function degToRad(degrees: number): number;
|
|
66
|
-
|
|
67
|
-
export function radToDeg(radians: number): number;
|
|
68
|
-
|
|
69
|
-
export function isPowerOfTwo(value: number): boolean;
|
|
70
|
-
|
|
71
35
|
export function inverseLerp(x: number, y: number, t: number): number;
|
|
72
36
|
|
|
73
37
|
/**
|
|
@@ -99,18 +63,75 @@ export function damp(x: number, y: number, lambda: number, dt: number): number;
|
|
|
99
63
|
*/
|
|
100
64
|
export function pingpong(x: number, length?: number): number;
|
|
101
65
|
|
|
66
|
+
export function smoothstep(x: number, min: number, max: number): number;
|
|
67
|
+
|
|
68
|
+
export function smootherstep(x: number, min: number, max: number): number;
|
|
69
|
+
|
|
102
70
|
/**
|
|
103
|
-
*
|
|
71
|
+
* Random integer from low to high interval.
|
|
104
72
|
*/
|
|
105
|
-
export function
|
|
73
|
+
export function randInt(low: number, high: number): number;
|
|
106
74
|
|
|
107
75
|
/**
|
|
108
|
-
*
|
|
76
|
+
* Random float from low to high interval.
|
|
109
77
|
*/
|
|
110
|
-
export function
|
|
78
|
+
export function randFloat(low: number, high: number): number;
|
|
111
79
|
|
|
112
|
-
|
|
80
|
+
/**
|
|
81
|
+
* Random float from - range / 2 to range / 2 interval.
|
|
82
|
+
*/
|
|
83
|
+
export function randFloatSpread(range: number): number;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Deterministic pseudo-random float in the interval [ 0, 1 ].
|
|
87
|
+
*/
|
|
88
|
+
export function seededRandom(seed?: number): number;
|
|
89
|
+
|
|
90
|
+
export function degToRad(degrees: number): number;
|
|
91
|
+
|
|
92
|
+
export function radToDeg(radians: number): number;
|
|
93
|
+
|
|
94
|
+
export function isPowerOfTwo(value: number): boolean;
|
|
113
95
|
|
|
114
96
|
export function ceilPowerOfTwo(value: number): number;
|
|
115
97
|
|
|
98
|
+
export function floorPowerOfTwo(value: number): number;
|
|
99
|
+
|
|
116
100
|
export function setQuaternionFromProperEuler(q: Quaternion, a: number, b: number, c: number, order: string): void;
|
|
101
|
+
|
|
102
|
+
export function denormalize(
|
|
103
|
+
value: number,
|
|
104
|
+
array: Float32Array | Uint32Array | Uint16Array | Uint8Array | Int32Array | Int16Array | Int8Array,
|
|
105
|
+
): number;
|
|
106
|
+
|
|
107
|
+
export function normalize(
|
|
108
|
+
value: number,
|
|
109
|
+
array: Float32Array | Uint32Array | Uint16Array | Uint8Array | Int32Array | Int16Array | Int8Array,
|
|
110
|
+
): number;
|
|
111
|
+
|
|
112
|
+
export const MathUtils: {
|
|
113
|
+
DEG2RAD: typeof DEG2RAD;
|
|
114
|
+
RAD2DEG: typeof RAD2DEG;
|
|
115
|
+
generateUUID: typeof generateUUID;
|
|
116
|
+
clamp: typeof clamp;
|
|
117
|
+
euclideanModulo: typeof euclideanModulo;
|
|
118
|
+
mapLinear: typeof mapLinear;
|
|
119
|
+
inverseLerp: typeof inverseLerp;
|
|
120
|
+
lerp: typeof lerp;
|
|
121
|
+
damp: typeof damp;
|
|
122
|
+
pingpong: typeof pingpong;
|
|
123
|
+
smoothstep: typeof smoothstep;
|
|
124
|
+
smootherstep: typeof smootherstep;
|
|
125
|
+
randInt: typeof randInt;
|
|
126
|
+
randFloat: typeof randFloat;
|
|
127
|
+
randFloatSpread: typeof randFloatSpread;
|
|
128
|
+
seededRandom: typeof seededRandom;
|
|
129
|
+
degToRad: typeof degToRad;
|
|
130
|
+
radToDeg: typeof radToDeg;
|
|
131
|
+
isPowerOfTwo: typeof isPowerOfTwo;
|
|
132
|
+
ceilPowerOfTwo: typeof ceilPowerOfTwo;
|
|
133
|
+
floorPowerOfTwo: typeof floorPowerOfTwo;
|
|
134
|
+
setQuaternionFromProperEuler: typeof setQuaternionFromProperEuler;
|
|
135
|
+
normalize: typeof normalize;
|
|
136
|
+
denormalize: typeof denormalize;
|
|
137
|
+
};
|
three/src/math/Matrix3.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// https://threejs.org/docs/#api/en/math/Matrix3
|
|
2
2
|
|
|
3
3
|
import { Matrix4 } from './Matrix4';
|
|
4
|
+
import { Vector2 } from './Vector2';
|
|
4
5
|
import { Vector3 } from './Vector3';
|
|
5
6
|
|
|
6
7
|
export type Matrix3Tuple = [number, number, number, number, number, number, number, number, number];
|
|
@@ -55,6 +56,20 @@ export class Matrix3 implements Matrix {
|
|
|
55
56
|
* Creates an identity matrix.
|
|
56
57
|
*/
|
|
57
58
|
constructor();
|
|
59
|
+
/**
|
|
60
|
+
* Creates a 3x3 matrix with the given arguments in row-major order.
|
|
61
|
+
*/
|
|
62
|
+
constructor(
|
|
63
|
+
n11: number,
|
|
64
|
+
n12: number,
|
|
65
|
+
n13: number,
|
|
66
|
+
n21: number,
|
|
67
|
+
n22: number,
|
|
68
|
+
n23: number,
|
|
69
|
+
n31: number,
|
|
70
|
+
n32: number,
|
|
71
|
+
n33: number,
|
|
72
|
+
);
|
|
58
73
|
|
|
59
74
|
/**
|
|
60
75
|
* Array with matrix values.
|
|
@@ -113,8 +128,8 @@ export class Matrix3 implements Matrix {
|
|
|
113
128
|
* @param x the amount to translate in the X axis.
|
|
114
129
|
* @param y the amount to translate in the Y axis.
|
|
115
130
|
*/
|
|
131
|
+
makeTranslation(v: Vector2): this;
|
|
116
132
|
makeTranslation(x: number, y: number): this;
|
|
117
|
-
makeTranslation(x: number, y: number): Matrix3;
|
|
118
133
|
|
|
119
134
|
/**
|
|
120
135
|
* Sets this matrix as a 2D rotational transformation by theta radians. The resulting matrix will be:
|
three/src/math/Matrix4.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Vector3 } from './Vector3';
|
|
|
2
2
|
import { Euler } from './Euler';
|
|
3
3
|
import { Quaternion } from './Quaternion';
|
|
4
4
|
import { Matrix, Matrix3 } from './Matrix3';
|
|
5
|
+
import { CoordinateSystem } from '../constants';
|
|
5
6
|
|
|
6
7
|
export type Matrix4Tuple = [
|
|
7
8
|
number,
|
|
@@ -41,7 +42,31 @@ export type Matrix4Tuple = [
|
|
|
41
42
|
* m.multiply( m3 );
|
|
42
43
|
*/
|
|
43
44
|
export class Matrix4 implements Matrix {
|
|
45
|
+
/**
|
|
46
|
+
* Creates an identity matrix.
|
|
47
|
+
*/
|
|
44
48
|
constructor();
|
|
49
|
+
/**
|
|
50
|
+
* Creates a 4x4 matrix with the given arguments in row-major order.
|
|
51
|
+
*/
|
|
52
|
+
constructor(
|
|
53
|
+
n11: number,
|
|
54
|
+
n12: number,
|
|
55
|
+
n13: number,
|
|
56
|
+
n14: number,
|
|
57
|
+
n21: number,
|
|
58
|
+
n22: number,
|
|
59
|
+
n23: number,
|
|
60
|
+
n24: number,
|
|
61
|
+
n31: number,
|
|
62
|
+
n32: number,
|
|
63
|
+
n33: number,
|
|
64
|
+
n34: number,
|
|
65
|
+
n41: number,
|
|
66
|
+
n42: number,
|
|
67
|
+
n43: number,
|
|
68
|
+
n44: number,
|
|
69
|
+
);
|
|
45
70
|
|
|
46
71
|
/**
|
|
47
72
|
* Array with matrix values.
|
|
@@ -147,7 +172,8 @@ export class Matrix4 implements Matrix {
|
|
|
147
172
|
/**
|
|
148
173
|
* Sets this matrix as translation transform.
|
|
149
174
|
*/
|
|
150
|
-
makeTranslation(
|
|
175
|
+
makeTranslation(v: Vector3): this;
|
|
176
|
+
makeTranslation(x: number, y: number, z: number): this;
|
|
151
177
|
|
|
152
178
|
/**
|
|
153
179
|
* Sets this matrix as rotation transform around x axis by theta radians.
|
|
@@ -199,20 +225,31 @@ export class Matrix4 implements Matrix {
|
|
|
199
225
|
*/
|
|
200
226
|
decompose(translation: Vector3, rotation: Quaternion, scale: Vector3): Matrix4;
|
|
201
227
|
|
|
202
|
-
/**
|
|
203
|
-
* Creates a frustum matrix.
|
|
204
|
-
*/
|
|
205
|
-
makePerspective(left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix4;
|
|
206
|
-
|
|
207
228
|
/**
|
|
208
229
|
* Creates a perspective projection matrix.
|
|
209
230
|
*/
|
|
210
|
-
makePerspective(
|
|
231
|
+
makePerspective(
|
|
232
|
+
left: number,
|
|
233
|
+
right: number,
|
|
234
|
+
top: number,
|
|
235
|
+
bottom: number,
|
|
236
|
+
near: number,
|
|
237
|
+
far: number,
|
|
238
|
+
coordinateSystem?: CoordinateSystem,
|
|
239
|
+
): Matrix4;
|
|
211
240
|
|
|
212
241
|
/**
|
|
213
242
|
* Creates an orthographic projection matrix.
|
|
214
243
|
*/
|
|
215
|
-
makeOrthographic(
|
|
244
|
+
makeOrthographic(
|
|
245
|
+
left: number,
|
|
246
|
+
right: number,
|
|
247
|
+
top: number,
|
|
248
|
+
bottom: number,
|
|
249
|
+
near: number,
|
|
250
|
+
far: number,
|
|
251
|
+
coordinateSystem?: CoordinateSystem,
|
|
252
|
+
): Matrix4;
|
|
216
253
|
equals(matrix: Matrix4): boolean;
|
|
217
254
|
|
|
218
255
|
/**
|
three/src/math/Vector2.d.ts
CHANGED
|
@@ -448,4 +448,9 @@ export class Vector2 implements Vector {
|
|
|
448
448
|
* Sets this vector's x and y from Math.random
|
|
449
449
|
*/
|
|
450
450
|
random(): this;
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Iterating through a Vector2 instance will yield its components (x, y) in the corresponding order.
|
|
454
|
+
*/
|
|
455
|
+
[Symbol.iterator](): Iterator<number>;
|
|
451
456
|
}
|
three/src/math/Vector3.d.ts
CHANGED
|
@@ -301,4 +301,9 @@ export class Vector3 implements Vector {
|
|
|
301
301
|
random(): this;
|
|
302
302
|
|
|
303
303
|
randomDirection(): this;
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Iterating through a Vector3 instance will yield its components (x, y, z) in the corresponding order.
|
|
307
|
+
*/
|
|
308
|
+
[Symbol.iterator](): Iterator<number>;
|
|
304
309
|
}
|
three/src/math/Vector4.d.ts
CHANGED
|
@@ -220,4 +220,9 @@ export class Vector4 implements Vector {
|
|
|
220
220
|
* Sets this vector's x, y, z and w from Math.random
|
|
221
221
|
*/
|
|
222
222
|
random(): this;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Iterating through a Vector4 instance will yield its components (x, y, z, w) in the corresponding order.
|
|
226
|
+
*/
|
|
227
|
+
[Symbol.iterator](): Iterator<number>;
|
|
223
228
|
}
|
|
@@ -14,7 +14,7 @@ import { WebGLRenderTarget } from './WebGLRenderTarget';
|
|
|
14
14
|
import { WebGLMultipleRenderTargets } from './WebGLMultipleRenderTargets';
|
|
15
15
|
import { Object3D } from './../core/Object3D';
|
|
16
16
|
import { Material } from './../materials/Material';
|
|
17
|
-
import { ToneMapping, ShadowMapType, CullFace, TextureEncoding, ColorSpace } from '../constants';
|
|
17
|
+
import { ToneMapping, ShadowMapType, CullFace, TextureEncoding, ColorSpace, WebGLCoordinateSystem } from '../constants';
|
|
18
18
|
import { WebXRManager } from '../renderers/webxr/WebXRManager';
|
|
19
19
|
import { BufferGeometry } from './../core/BufferGeometry';
|
|
20
20
|
import { OffscreenCanvas, Texture } from '../textures/Texture';
|
|
@@ -200,6 +200,8 @@ export class WebGLRenderer implements Renderer {
|
|
|
200
200
|
*/
|
|
201
201
|
outputColorSpace: ColorSpace;
|
|
202
202
|
|
|
203
|
+
get coordinateSystem(): typeof WebGLCoordinateSystem;
|
|
204
|
+
|
|
203
205
|
/**
|
|
204
206
|
* @default true
|
|
205
207
|
*/
|
|
@@ -26,31 +26,48 @@ export class WebXRManager extends EventDispatcher {
|
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* @default true
|
|
29
|
+
* @deprecated
|
|
29
30
|
*/
|
|
30
31
|
cameraAutoUpdate: boolean;
|
|
31
32
|
|
|
32
33
|
getController(index: number): XRTargetRaySpace;
|
|
34
|
+
|
|
33
35
|
getControllerGrip(index: number): XRGripSpace;
|
|
36
|
+
|
|
34
37
|
getHand(index: number): XRHandSpace;
|
|
38
|
+
|
|
35
39
|
setFramebufferScaleFactor(value: number): void;
|
|
40
|
+
|
|
36
41
|
setReferenceSpaceType(value: XRReferenceSpaceType): void;
|
|
42
|
+
|
|
37
43
|
getReferenceSpace(): XRReferenceSpace | null;
|
|
44
|
+
|
|
38
45
|
setReferenceSpace(value: XRReferenceSpace): void;
|
|
46
|
+
|
|
39
47
|
getBaseLayer(): XRWebGLLayer | XRProjectionLayer;
|
|
48
|
+
|
|
40
49
|
getBinding(): XRWebGLBinding;
|
|
50
|
+
|
|
41
51
|
getFrame(): XRFrame;
|
|
52
|
+
|
|
42
53
|
getSession(): XRSession | null;
|
|
54
|
+
|
|
43
55
|
setSession(value: XRSession | null): Promise<void>;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated
|
|
59
|
+
*/
|
|
44
60
|
getCamera(): WebXRArrayCamera;
|
|
45
|
-
|
|
61
|
+
|
|
62
|
+
setUserCamera(camera: PerspectiveCamera): void;
|
|
63
|
+
|
|
64
|
+
updateCameraXR(camera: PerspectiveCamera): void;
|
|
65
|
+
|
|
46
66
|
setAnimationLoop(callback: XRFrameRequestCallback | null): void;
|
|
67
|
+
|
|
47
68
|
getFoveation(): number | undefined;
|
|
48
|
-
setFoveation(value: number): void;
|
|
49
69
|
|
|
50
|
-
|
|
51
|
-
* Returns the set of planes detected by WebXR's plane detection API.
|
|
52
|
-
*/
|
|
53
|
-
getPlanes(): Set<XRPlane>;
|
|
70
|
+
setFoveation(value: number): void;
|
|
54
71
|
|
|
55
72
|
dispose(): void;
|
|
56
73
|
}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
DeepTexturePixelFormat,
|
|
7
7
|
MagnificationTextureFilter,
|
|
8
8
|
MinificationTextureFilter,
|
|
9
|
+
TextureComparisonFunction,
|
|
9
10
|
} from '../constants';
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -95,4 +96,12 @@ export class DepthTexture extends Texture {
|
|
|
95
96
|
* @defaultValue {@link THREE.UnsignedInt248Type} when {@link format | .format} === {@link THREE.DepthStencilFormat}
|
|
96
97
|
*/
|
|
97
98
|
type: TextureDataType;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* This is used to define the comparison function used when comparing texels in the depth texture to the value in
|
|
102
|
+
* the depth buffer. Default is `null` which means comparison is disabled.
|
|
103
|
+
*
|
|
104
|
+
* See {@link THREE.TextureComparisonFunction} for functions.
|
|
105
|
+
*/
|
|
106
|
+
compareFunction: TextureComparisonFunction | null;
|
|
98
107
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Texture } from './Texture';
|
|
2
|
-
import { MagnificationTextureFilter, MinificationTextureFilter
|
|
2
|
+
import { MagnificationTextureFilter, MinificationTextureFilter } from '../constants';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* This class can only be used in combination with {@link THREE.WebGLRenderer.copyFramebufferToTexture | WebGLRenderer.copyFramebufferToTexture()}.
|
|
@@ -32,9 +32,8 @@ export class FramebufferTexture extends Texture {
|
|
|
32
32
|
* Create a new instance of {@link FramebufferTexture}
|
|
33
33
|
* @param width The width of the texture.
|
|
34
34
|
* @param height The height of the texture.
|
|
35
|
-
* @param format See {@link Texture.format | .format}. Default {@link THREE.RGBAFormat}.
|
|
36
35
|
*/
|
|
37
|
-
constructor(width: number, height: number
|
|
36
|
+
constructor(width: number, height: number);
|
|
38
37
|
|
|
39
38
|
/**
|
|
40
39
|
* Read-only flag to check if a given object is of type {@link FramebufferTexture}.
|