@types/three 0.160.0 → 0.161.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.
Files changed (135) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +5 -1
  3. three/examples/jsm/capabilities/WebGPU.d.ts +2 -0
  4. three/examples/jsm/curves/NURBSUtils.d.ts +136 -10
  5. three/examples/jsm/curves/NURBSVolume.d.ts +23 -0
  6. three/examples/jsm/exporters/USDZExporter.d.ts +1 -0
  7. three/examples/jsm/loaders/GLTFLoader.d.ts +1 -0
  8. three/examples/jsm/loaders/KTX2Loader.d.ts +44 -4
  9. three/examples/jsm/loaders/LUT3dlLoader.d.ts +29 -2
  10. three/examples/jsm/loaders/LUTCubeLoader.d.ts +37 -2
  11. three/examples/jsm/materials/MeshPostProcessingMaterial.d.ts +13 -0
  12. three/examples/jsm/nodes/Nodes.d.ts +75 -10
  13. three/examples/jsm/nodes/accessors/CameraNode.d.ts +17 -6
  14. three/examples/jsm/nodes/accessors/CubeTextureNode.d.ts +8 -2
  15. three/examples/jsm/nodes/accessors/MaterialReferenceNode.d.ts +1 -1
  16. three/examples/jsm/nodes/accessors/ModelNode.d.ts +2 -0
  17. three/examples/jsm/nodes/accessors/Object3DNode.d.ts +10 -6
  18. three/examples/jsm/nodes/accessors/TextureBicubicNode.d.ts +18 -0
  19. three/examples/jsm/nodes/accessors/TextureNode.d.ts +11 -3
  20. three/examples/jsm/nodes/accessors/VertexColorNode.d.ts +12 -0
  21. three/examples/jsm/nodes/code/FunctionCallNode.d.ts +6 -0
  22. three/examples/jsm/nodes/core/AssignNode.d.ts +17 -0
  23. three/examples/jsm/nodes/core/BypassNode.d.ts +6 -0
  24. three/examples/jsm/nodes/core/CacheNode.d.ts +8 -0
  25. three/examples/jsm/nodes/core/ContextNode.d.ts +8 -0
  26. three/examples/jsm/nodes/core/IndexNode.d.ts +18 -0
  27. three/examples/jsm/nodes/core/LightingModel.d.ts +36 -0
  28. three/examples/jsm/nodes/core/Node.d.ts +32 -8
  29. three/examples/jsm/nodes/core/NodeBuilder.d.ts +22 -21
  30. three/examples/jsm/nodes/core/NodeFrame.d.ts +18 -6
  31. three/examples/jsm/nodes/core/PropertyNode.d.ts +19 -2
  32. three/examples/jsm/nodes/core/VarNode.d.ts +8 -2
  33. three/examples/jsm/nodes/core/VaryingNode.d.ts +6 -0
  34. three/examples/jsm/nodes/core/constants.d.ts +23 -24
  35. three/examples/jsm/nodes/display/AfterImageNode.d.ts +25 -0
  36. three/examples/jsm/nodes/display/AnamorphicNode.d.ts +32 -0
  37. three/examples/jsm/nodes/display/BlendModeNode.d.ts +14 -4
  38. three/examples/jsm/nodes/display/ColorAdjustmentNode.d.ts +11 -0
  39. three/examples/jsm/nodes/display/ColorSpaceNode.d.ts +15 -2
  40. three/examples/jsm/nodes/display/GaussianBlurNode.d.ts +28 -0
  41. three/examples/jsm/nodes/display/NormalMapNode.d.ts +6 -0
  42. three/examples/jsm/nodes/display/PassNode.d.ts +44 -0
  43. three/examples/jsm/nodes/display/PosterizeNode.d.ts +6 -0
  44. three/examples/jsm/nodes/display/ViewportDepthNode.d.ts +32 -0
  45. three/examples/jsm/nodes/display/ViewportSharedTextureNode.d.ts +18 -0
  46. three/examples/jsm/nodes/display/ViewportTextureNode.d.ts +33 -0
  47. three/examples/jsm/nodes/fog/FogExp2Node.d.ts +6 -0
  48. three/examples/jsm/nodes/fog/FogNode.d.ts +6 -0
  49. three/examples/jsm/nodes/fog/FogRangeNode.d.ts +6 -0
  50. three/examples/jsm/nodes/functions/BSDF/BRDF_GGX.d.ts +9 -2
  51. three/examples/jsm/nodes/functions/BSDF/BRDF_Lambert.d.ts +3 -2
  52. three/examples/jsm/nodes/functions/BSDF/BRDF_Sheen.d.ts +7 -0
  53. three/examples/jsm/nodes/functions/BSDF/DFGApprox.d.ts +3 -2
  54. three/examples/jsm/nodes/functions/BSDF/D_GGX.d.ts +3 -2
  55. three/examples/jsm/nodes/functions/BSDF/F_Schlick.d.ts +3 -2
  56. three/examples/jsm/nodes/functions/PhongLightingModel.d.ts +7 -0
  57. three/examples/jsm/nodes/functions/PhysicalLightingModel.d.ts +17 -8
  58. three/examples/jsm/nodes/gpgpu/ComputeNode.d.ts +6 -0
  59. three/examples/jsm/nodes/lighting/LightingContextNode.d.ts +20 -13
  60. three/examples/jsm/nodes/materials/LineBasicNodeMaterial.d.ts +1 -2
  61. three/examples/jsm/nodes/materials/Materials.d.ts +9 -17
  62. three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.d.ts +2 -4
  63. three/examples/jsm/nodes/materials/MeshPhongNodeMaterial.d.ts +12 -0
  64. three/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.d.ts +3 -7
  65. three/examples/jsm/nodes/materials/MeshSSSNodeMaterial.d.ts +17 -0
  66. three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +1 -2
  67. three/examples/jsm/nodes/materials/NodeMaterial.d.ts +30 -14
  68. three/examples/jsm/nodes/materials/PointsNodeMaterial.d.ts +2 -8
  69. three/examples/jsm/nodes/materials/SpriteNodeMaterial.d.ts +0 -10
  70. three/examples/jsm/nodes/math/CondNode.d.ts +6 -0
  71. three/examples/jsm/nodes/math/HashNode.d.ts +16 -0
  72. three/examples/jsm/nodes/math/MathNode.d.ts +15 -9
  73. three/examples/jsm/nodes/math/MathUtils.d.ts +16 -0
  74. three/examples/jsm/nodes/math/OperatorNode.d.ts +5 -4
  75. three/examples/jsm/nodes/math/TriNoise3D.d.ts +12 -0
  76. three/examples/jsm/nodes/procedural/CheckerNode.d.ts +6 -0
  77. three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +55 -4
  78. three/examples/jsm/nodes/utils/DiscardNode.d.ts +16 -0
  79. three/examples/jsm/nodes/utils/ReflectorNode.d.ts +30 -0
  80. three/examples/jsm/nodes/utils/RemapNode.d.ts +23 -4
  81. three/examples/jsm/nodes/utils/RotateNode.d.ts +21 -0
  82. three/examples/jsm/nodes/utils/RotateUVNode.d.ts +6 -0
  83. three/examples/jsm/nodes/utils/TriplanarTexturesNode.d.ts +6 -0
  84. three/examples/jsm/objects/GroundedSkybox.d.ts +5 -0
  85. three/examples/jsm/objects/QuadMesh.d.ts +3 -1
  86. three/examples/jsm/postprocessing/GTAOPass.d.ts +3 -0
  87. three/examples/jsm/postprocessing/SSAOPass.d.ts +1 -1
  88. three/examples/jsm/renderers/common/Backend.d.ts +6 -2
  89. three/examples/jsm/renderers/common/Color4.d.ts +9 -0
  90. three/examples/jsm/renderers/common/Info.d.ts +7 -1
  91. three/examples/jsm/renderers/common/PostProcessing.d.ts +11 -0
  92. three/examples/jsm/renderers/common/Renderer.d.ts +243 -4
  93. three/examples/jsm/renderers/common/StorageTexture.d.ts +5 -0
  94. three/examples/jsm/renderers/webgl/WebGLBackend.d.ts +4 -2
  95. three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +2 -2
  96. three/examples/jsm/renderers/webgpu/WebGPUBackend.d.ts +15 -6
  97. three/examples/jsm/renderers/webgpu/WebGPURenderer.d.ts +7 -7
  98. three/examples/jsm/utils/BufferGeometryUtils.d.ts +0 -10
  99. three/examples/jsm/webxr/XRControllerModelFactory.d.ts +6 -5
  100. three/examples/jsm/webxr/XRHandMeshModel.d.ts +10 -2
  101. three/package.json +2 -2
  102. three/src/cameras/PerspectiveCamera.d.ts +13 -0
  103. three/src/constants.d.ts +1 -2
  104. three/src/core/InterleavedBufferAttribute.d.ts +12 -2
  105. three/src/core/Object3D.d.ts +13 -13
  106. three/src/extras/core/Curve.d.ts +9 -9
  107. three/src/extras/core/CurvePath.d.ts +8 -7
  108. three/src/geometries/RingGeometry.d.ts +1 -1
  109. three/src/materials/Material.d.ts +3 -1
  110. three/src/materials/ShaderMaterial.d.ts +9 -1
  111. three/src/math/Color.d.ts +1 -1
  112. three/src/math/Quaternion.d.ts +27 -30
  113. three/src/math/Triangle.d.ts +0 -17
  114. three/src/math/Vector2.d.ts +24 -159
  115. three/src/math/Vector3.d.ts +46 -54
  116. three/src/math/Vector4.d.ts +25 -20
  117. three/src/objects/BatchedMesh.d.ts +2 -2
  118. three/src/objects/Bone.d.ts +2 -2
  119. three/src/objects/InstancedMesh.d.ts +2 -1
  120. three/src/objects/LOD.d.ts +2 -2
  121. three/src/objects/Line.d.ts +3 -2
  122. three/src/objects/LineLoop.d.ts +3 -1
  123. three/src/objects/LineSegments.d.ts +3 -1
  124. three/src/objects/Points.d.ts +3 -2
  125. three/src/objects/SkinnedMesh.d.ts +3 -6
  126. three/src/objects/Sprite.d.ts +2 -2
  127. three/src/renderers/webgl/WebGLProgram.d.ts +0 -1
  128. three/src/renderers/webgl/WebGLPrograms.d.ts +3 -1
  129. three/src/renderers/webxr/WebXRDepthSensing.d.ts +27 -0
  130. three/src/renderers/webxr/WebXRManager.d.ts +2 -1
  131. three/src/textures/DataArrayTexture.d.ts +1 -1
  132. three/src/textures/Source.d.ts +11 -1
  133. three/build/three.d.ts +0 -2
  134. three/build/three.min.d.ts +0 -2
  135. three/examples/jsm/objects/GroundProjectedSkybox.d.ts +0 -13
@@ -1,19 +1,24 @@
1
1
  import { Euler } from './Euler.js';
2
2
  import { Matrix3 } from './Matrix3.js';
3
3
  import { Matrix4 } from './Matrix4.js';
4
- import { Quaternion } from './Quaternion.js';
4
+ import { QuaternionLike } from './Quaternion.js';
5
5
  import { Camera } from '../cameras/Camera.js';
6
6
  import { Spherical } from './Spherical.js';
7
7
  import { Cylindrical } from './Cylindrical.js';
8
8
  import { BufferAttribute } from '../core/BufferAttribute.js';
9
9
  import { InterleavedBufferAttribute } from '../core/InterleavedBufferAttribute.js';
10
- import { Vector } from './Vector2.js';
11
- import { Color } from './Color.js';
10
+ import { RGB } from './Color.js';
12
11
 
13
12
  export type Vector3Tuple = [number, number, number];
14
13
 
14
+ export interface Vector3Like {
15
+ readonly x: number;
16
+ readonly y: number;
17
+ readonly z: number;
18
+ }
19
+
15
20
  /**
16
- * 3D vector. ( class Vector3 implements Vector<Vector3> )
21
+ * 3D vector.
17
22
  *
18
23
  * see {@link https://github.com/mrdoob/three.js/blob/master/src/math/Vector3.js}
19
24
  *
@@ -23,7 +28,7 @@ export type Vector3Tuple = [number, number, number];
23
28
  * const c = new THREE.Vector3();
24
29
  * c.crossVectors( a, b );
25
30
  */
26
- export class Vector3 implements Vector {
31
+ export class Vector3 {
27
32
  constructor(x?: number, y?: number, z?: number);
28
33
 
29
34
  /**
@@ -55,26 +60,20 @@ export class Vector3 implements Vector {
55
60
  /**
56
61
  * Sets x value of this vector.
57
62
  */
58
- setX(x: number): Vector3;
63
+ setX(x: number): this;
59
64
 
60
65
  /**
61
66
  * Sets y value of this vector.
62
67
  */
63
- setY(y: number): Vector3;
68
+ setY(y: number): this;
64
69
 
65
70
  /**
66
71
  * Sets z value of this vector.
67
72
  */
68
- setZ(z: number): Vector3;
73
+ setZ(z: number): this;
69
74
 
70
75
  setComponent(index: number, value: number): this;
71
76
 
72
- /**
73
- * Sets this vector's {@link x}, {@link y} and {@link z} components from the r, g, and b components of the specified
74
- * {@link Color | color}.
75
- */
76
- setFromColor(color: Color): this;
77
-
78
77
  getComponent(index: number): number;
79
78
 
80
79
  /**
@@ -85,42 +84,42 @@ export class Vector3 implements Vector {
85
84
  /**
86
85
  * Copies value of v to this vector.
87
86
  */
88
- copy(v: Vector3): this;
87
+ copy(v: Vector3Like): this;
89
88
 
90
89
  /**
91
90
  * Adds v to this vector.
92
91
  */
93
- add(v: Vector3): this;
92
+ add(v: Vector3Like): this;
94
93
 
95
94
  addScalar(s: number): this;
96
95
 
97
- addScaledVector(v: Vector3, s: number): this;
98
-
99
96
  /**
100
97
  * Sets this vector to a + b.
101
98
  */
102
- addVectors(a: Vector3, b: Vector3): this;
99
+ addVectors(a: Vector3Like, b: Vector3Like): this;
100
+
101
+ addScaledVector(v: Vector3, s: number): this;
103
102
 
104
103
  /**
105
104
  * Subtracts v from this vector.
106
105
  */
107
- sub(a: Vector3): this;
106
+ sub(a: Vector3Like): this;
108
107
 
109
108
  subScalar(s: number): this;
110
109
 
111
110
  /**
112
111
  * Sets this vector to a - b.
113
112
  */
114
- subVectors(a: Vector3, b: Vector3): this;
113
+ subVectors(a: Vector3Like, b: Vector3Like): this;
115
114
 
116
- multiply(v: Vector3): this;
115
+ multiply(v: Vector3Like): this;
117
116
 
118
117
  /**
119
118
  * Multiplies this vector by scalar s.
120
119
  */
121
120
  multiplyScalar(s: number): this;
122
121
 
123
- multiplyVectors(a: Vector3, b: Vector3): this;
122
+ multiplyVectors(a: Vector3Like, b: Vector3Like): this;
124
123
 
125
124
  applyEuler(euler: Euler): this;
126
125
 
@@ -132,7 +131,7 @@ export class Vector3 implements Vector {
132
131
 
133
132
  applyMatrix4(m: Matrix4): this;
134
133
 
135
- applyQuaternion(q: Quaternion): this;
134
+ applyQuaternion(q: QuaternionLike): this;
136
135
 
137
136
  project(camera: Camera): this;
138
137
 
@@ -140,7 +139,7 @@ export class Vector3 implements Vector {
140
139
 
141
140
  transformDirection(m: Matrix4): this;
142
141
 
143
- divide(v: Vector3): this;
142
+ divide(v: Vector3Like): this;
144
143
 
145
144
  /**
146
145
  * Divides this vector by scalar s.
@@ -148,11 +147,11 @@ export class Vector3 implements Vector {
148
147
  */
149
148
  divideScalar(s: number): this;
150
149
 
151
- min(v: Vector3): this;
150
+ min(v: Vector3Like): this;
152
151
 
153
- max(v: Vector3): this;
152
+ max(v: Vector3Like): this;
154
153
 
155
- clamp(min: Vector3, max: Vector3): this;
154
+ clamp(min: Vector3Like, max: Vector3Like): this;
156
155
 
157
156
  clampScalar(min: number, max: number): this;
158
157
 
@@ -174,7 +173,7 @@ export class Vector3 implements Vector {
174
173
  /**
175
174
  * Computes dot product of this vector and v.
176
175
  */
177
- dot(v: Vector3): number;
176
+ dot(v: Vector3Like): number;
178
177
 
179
178
  /**
180
179
  * Computes squared length of this vector.
@@ -186,14 +185,6 @@ export class Vector3 implements Vector {
186
185
  */
187
186
  length(): number;
188
187
 
189
- /**
190
- * Computes Manhattan length of this vector.
191
- * http://en.wikipedia.org/wiki/Taxicab_geometry
192
- *
193
- * @deprecated Use {@link Vector3#manhattanLength .manhattanLength()} instead.
194
- */
195
- lengthManhattan(): number;
196
-
197
188
  /**
198
189
  * Computes the Manhattan length of this vector.
199
190
  *
@@ -201,13 +192,6 @@ export class Vector3 implements Vector {
201
192
  */
202
193
  manhattanLength(): number;
203
194
 
204
- /**
205
- * Computes the Manhattan length (distance) from this vector to the given vector v
206
- *
207
- * see {@link http://en.wikipedia.org/wiki/Taxicab_geometry|Wikipedia: Taxicab Geometry}
208
- */
209
- manhattanDistanceTo(v: Vector3): number;
210
-
211
195
  /**
212
196
  * Normalizes this vector.
213
197
  */
@@ -217,38 +201,40 @@ export class Vector3 implements Vector {
217
201
  * Normalizes this vector and multiplies it by l.
218
202
  */
219
203
  setLength(l: number): this;
220
- lerp(v: Vector3, alpha: number): this;
204
+ lerp(v: Vector3Like, alpha: number): this;
221
205
 
222
- lerpVectors(v1: Vector3, v2: Vector3, alpha: number): this;
206
+ lerpVectors(v1: Vector3Like, v2: Vector3Like, alpha: number): this;
223
207
 
224
208
  /**
225
209
  * Sets this vector to cross product of itself and v.
226
210
  */
227
- cross(a: Vector3): this;
211
+ cross(a: Vector3Like): this;
228
212
 
229
213
  /**
230
214
  * Sets this vector to cross product of a and b.
231
215
  */
232
- crossVectors(a: Vector3, b: Vector3): this;
216
+ crossVectors(a: Vector3Like, b: Vector3Like): this;
233
217
  projectOnVector(v: Vector3): this;
234
218
  projectOnPlane(planeNormal: Vector3): this;
235
- reflect(vector: Vector3): this;
219
+ reflect(vector: Vector3Like): this;
236
220
  angleTo(v: Vector3): number;
237
221
 
238
222
  /**
239
223
  * Computes distance of this vector to v.
240
224
  */
241
- distanceTo(v: Vector3): number;
225
+ distanceTo(v: Vector3Like): number;
242
226
 
243
227
  /**
244
228
  * Computes squared distance of this vector to v.
245
229
  */
246
- distanceToSquared(v: Vector3): number;
230
+ distanceToSquared(v: Vector3Like): number;
247
231
 
248
232
  /**
249
- * @deprecated Use {@link Vector3#manhattanDistanceTo .manhattanDistanceTo()} instead.
233
+ * Computes the Manhattan length (distance) from this vector to the given vector v
234
+ *
235
+ * see {@link http://en.wikipedia.org/wiki/Taxicab_geometry|Wikipedia: Taxicab Geometry}
250
236
  */
251
- distanceToManhattan(v: Vector3): number;
237
+ manhattanDistanceTo(v: Vector3Like): number;
252
238
 
253
239
  setFromSpherical(s: Spherical): this;
254
240
  setFromSphericalCoords(r: number, phi: number, theta: number): this;
@@ -264,10 +250,16 @@ export class Vector3 implements Vector {
264
250
  */
265
251
  setFromEuler(e: Euler): this;
266
252
 
253
+ /**
254
+ * Sets this vector's {@link x}, {@link y} and {@link z} components from the r, g, and b components of the specified
255
+ * {@link Color | color}.
256
+ */
257
+ setFromColor(color: RGB): this;
258
+
267
259
  /**
268
260
  * Checks for strict equality of this vector and v.
269
261
  */
270
- equals(v: Vector3): boolean;
262
+ equals(v: Vector3Like): boolean;
271
263
 
272
264
  /**
273
265
  * Sets this vector's x, y and z value from the provided array or array-like.
@@ -1,16 +1,20 @@
1
1
  import { Matrix4 } from './Matrix4.js';
2
- import { Quaternion } from './Quaternion.js';
2
+ import { QuaternionLike } from './Quaternion.js';
3
3
  import { BufferAttribute } from '../core/BufferAttribute.js';
4
- import { Vector } from './Vector2.js';
5
4
 
6
5
  export type Vector4Tuple = [number, number, number, number];
7
6
 
7
+ export interface Vector4Like {
8
+ readonly x: number;
9
+ readonly y: number;
10
+ readonly z: number;
11
+ readonly w: number;
12
+ }
13
+
8
14
  /**
9
15
  * 4D vector.
10
- *
11
- * ( class Vector4 implements Vector<Vector4> )
12
16
  */
13
- export class Vector4 implements Vector {
17
+ export class Vector4 {
14
18
  constructor(x?: number, y?: number, z?: number, w?: number);
15
19
 
16
20
  /**
@@ -79,34 +83,34 @@ export class Vector4 implements Vector {
79
83
  /**
80
84
  * Copies value of v to this vector.
81
85
  */
82
- copy(v: Vector4): this;
86
+ copy(v: Vector4Like): this;
83
87
 
84
88
  /**
85
89
  * Adds v to this vector.
86
90
  */
87
- add(v: Vector4): this;
91
+ add(v: Vector4Like): this;
88
92
 
89
93
  addScalar(scalar: number): this;
90
94
 
91
95
  /**
92
96
  * Sets this vector to a + b.
93
97
  */
94
- addVectors(a: Vector4, b: Vector4): this;
98
+ addVectors(a: Vector4Like, b: Vector4Like): this;
95
99
 
96
- addScaledVector(v: Vector4, s: number): this;
100
+ addScaledVector(v: Vector4Like, s: number): this;
97
101
  /**
98
102
  * Subtracts v from this vector.
99
103
  */
100
- sub(v: Vector4): this;
104
+ sub(v: Vector4Like): this;
101
105
 
102
106
  subScalar(s: number): this;
103
107
 
104
108
  /**
105
109
  * Sets this vector to a - b.
106
110
  */
107
- subVectors(a: Vector4, b: Vector4): this;
111
+ subVectors(a: Vector4Like, b: Vector4Like): this;
108
112
 
109
- multiply(v: Vector4): this;
113
+ multiply(v: Vector4Like): this;
110
114
 
111
115
  /**
112
116
  * Multiplies this vector by scalar s.
@@ -125,7 +129,7 @@ export class Vector4 implements Vector {
125
129
  * http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm
126
130
  * @param q is assumed to be normalized
127
131
  */
128
- setAxisAngleFromQuaternion(q: Quaternion): this;
132
+ setAxisAngleFromQuaternion(q: QuaternionLike): this;
129
133
 
130
134
  /**
131
135
  * http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm
@@ -133,9 +137,9 @@ export class Vector4 implements Vector {
133
137
  */
134
138
  setAxisAngleFromRotationMatrix(m: Matrix4): this;
135
139
 
136
- min(v: Vector4): this;
137
- max(v: Vector4): this;
138
- clamp(min: Vector4, max: Vector4): this;
140
+ min(v: Vector4Like): this;
141
+ max(v: Vector4Like): this;
142
+ clamp(min: Vector4Like, max: Vector4Like): this;
139
143
  clampScalar(min: number, max: number): this;
140
144
  floor(): this;
141
145
  ceil(): this;
@@ -150,7 +154,7 @@ export class Vector4 implements Vector {
150
154
  /**
151
155
  * Computes dot product of this vector and v.
152
156
  */
153
- dot(v: Vector4): number;
157
+ dot(v: Vector4Like): number;
154
158
 
155
159
  /**
156
160
  * Computes squared length of this vector.
@@ -173,6 +177,7 @@ export class Vector4 implements Vector {
173
177
  * Normalizes this vector.
174
178
  */
175
179
  normalize(): this;
180
+
176
181
  /**
177
182
  * Normalizes this vector and multiplies it by l.
178
183
  */
@@ -181,14 +186,14 @@ export class Vector4 implements Vector {
181
186
  /**
182
187
  * Linearly interpolate between this vector and v with alpha factor.
183
188
  */
184
- lerp(v: Vector4, alpha: number): this;
189
+ lerp(v: Vector4Like, alpha: number): this;
185
190
 
186
- lerpVectors(v1: Vector4, v2: Vector4, alpha: number): this;
191
+ lerpVectors(v1: Vector4Like, v2: Vector4Like, alpha: number): this;
187
192
 
188
193
  /**
189
194
  * Checks for strict equality of this vector and v.
190
195
  */
191
- equals(v: Vector4): boolean;
196
+ equals(v: Vector4Like): boolean;
192
197
 
193
198
  /**
194
199
  * Sets this vector's x, y, z and w value from the provided array or array-like.
@@ -162,8 +162,8 @@ declare class BatchedMesh extends Mesh<BufferGeometry, Material> {
162
162
  */
163
163
  deleteGeometry(index: number): this;
164
164
 
165
- getBoundingBoxAt(index: number, target: Box3): Box3;
166
- getBoundingSphereAt(index: number, target: Sphere): Sphere;
165
+ getBoundingBoxAt(index: number, target: Box3): Box3 | null;
166
+ getBoundingSphereAt(index: number, target: Sphere): Sphere | null;
167
167
  }
168
168
 
169
169
  export { BatchedMesh };
@@ -1,4 +1,4 @@
1
- import { Object3D } from '../core/Object3D.js';
1
+ import { Object3D, Object3DEventMap } from '../core/Object3D.js';
2
2
 
3
3
  /**
4
4
  * A {@link Bone} which is part of a {@link THREE.Skeleton | Skeleton}
@@ -15,7 +15,7 @@ import { Object3D } from '../core/Object3D.js';
15
15
  * @see {@link https://threejs.org/docs/index.html#api/en/objects/Bone | Official Documentation}
16
16
  * @see {@link https://github.com/mrdoob/three.js/blob/master/src/objects/Bone.js | Source}
17
17
  */
18
- export class Bone extends Object3D {
18
+ export class Bone<TEventMap extends Object3DEventMap = Object3DEventMap> extends Object3D<TEventMap> {
19
19
  /**
20
20
  * Creates a new {@link Bone}.
21
21
  */
@@ -28,7 +28,8 @@ export interface InstancedMeshEventMap extends Object3DEventMap {
28
28
  export class InstancedMesh<
29
29
  TGeometry extends BufferGeometry = BufferGeometry,
30
30
  TMaterial extends Material | Material[] = Material | Material[],
31
- > extends Mesh<TGeometry, TMaterial, InstancedMeshEventMap> {
31
+ TEventMap extends InstancedMeshEventMap = InstancedMeshEventMap,
32
+ > extends Mesh<TGeometry, TMaterial, TEventMap> {
32
33
  /**
33
34
  * Create a new instance of {@link InstancedMesh}
34
35
  * @param geometry An instance of {@link THREE.BufferGeometry | BufferGeometry}.
@@ -1,4 +1,4 @@
1
- import { Object3D } from '../core/Object3D.js';
1
+ import { Object3D, Object3DEventMap } from '../core/Object3D.js';
2
2
  import { Camera } from '../cameras/Camera.js';
3
3
 
4
4
  /**
@@ -20,7 +20,7 @@ import { Camera } from '../cameras/Camera.js';
20
20
  * @see {@link https://threejs.org/docs/index.html#api/en/objects/LOD | Official Documentation}
21
21
  * @see {@link https://github.com/mrdoob/three.js/blob/master/src/objects/LOD.js | Source}
22
22
  */
23
- export class LOD extends Object3D {
23
+ export class LOD<TEventMap extends Object3DEventMap = Object3DEventMap> extends Object3D<TEventMap> {
24
24
  /**
25
25
  * Creates a new {@link LOD}.
26
26
  */
@@ -1,5 +1,5 @@
1
1
  import { Material } from '../materials/Material.js';
2
- import { Object3D } from '../core/Object3D.js';
2
+ import { Object3D, Object3DEventMap } from '../core/Object3D.js';
3
3
  import { BufferGeometry } from '../core/BufferGeometry.js';
4
4
 
5
5
  /**
@@ -27,7 +27,8 @@ import { BufferGeometry } from '../core/BufferGeometry.js';
27
27
  export class Line<
28
28
  TGeometry extends BufferGeometry = BufferGeometry,
29
29
  TMaterial extends Material | Material[] = Material | Material[],
30
- > extends Object3D {
30
+ TEventMap extends Object3DEventMap = Object3DEventMap,
31
+ > extends Object3D<TEventMap> {
31
32
  /**
32
33
  * Create a new instance of {@link Line}
33
34
  * @param geometry Vertices representing the {@link Line} segment(s). Default {@link THREE.BufferGeometry | `new THREE.BufferGeometry()`}.
@@ -1,6 +1,7 @@
1
1
  import { Line } from './Line.js';
2
2
  import { Material } from '../materials/Material.js';
3
3
  import { BufferGeometry } from '../core/BufferGeometry.js';
4
+ import { Object3DEventMap } from '../core/Object3D.js';
4
5
 
5
6
  /**
6
7
  * A continuous line that connects back to the start.
@@ -15,7 +16,8 @@ import { BufferGeometry } from '../core/BufferGeometry.js';
15
16
  export class LineLoop<
16
17
  TGeometry extends BufferGeometry = BufferGeometry,
17
18
  TMaterial extends Material | Material[] = Material | Material[],
18
- > extends Line<TGeometry, TMaterial> {
19
+ TEventMap extends Object3DEventMap = Object3DEventMap,
20
+ > extends Line<TGeometry, TMaterial, TEventMap> {
19
21
  /**
20
22
  * Create a new instance of {@link LineLoop}
21
23
  * @param geometry List of vertices representing points on the line loop. Default {@link THREE.BufferGeometry | `new THREE.BufferGeometry()`}.
@@ -1,6 +1,7 @@
1
1
  import { Material } from '../materials/Material.js';
2
2
  import { Line } from './Line.js';
3
3
  import { BufferGeometry } from '../core/BufferGeometry.js';
4
+ import { Object3DEventMap } from '../core/Object3D.js';
4
5
 
5
6
  /**
6
7
  * A series of lines drawn between pairs of vertices.
@@ -14,7 +15,8 @@ import { BufferGeometry } from '../core/BufferGeometry.js';
14
15
  export class LineSegments<
15
16
  TGeometry extends BufferGeometry = BufferGeometry,
16
17
  TMaterial extends Material | Material[] = Material | Material[],
17
- > extends Line<TGeometry, TMaterial> {
18
+ TEventMap extends Object3DEventMap = Object3DEventMap,
19
+ > extends Line<TGeometry, TMaterial, TEventMap> {
18
20
  /**
19
21
  * Create a new instance of {@link LineSegments}
20
22
  * @param geometry Pair(s) of vertices representing each line segment(s). Default {@link THREE.BufferGeometry | `new THREE.BufferGeometry()`}.
@@ -1,5 +1,5 @@
1
1
  import { Material } from '../materials/Material.js';
2
- import { Object3D } from '../core/Object3D.js';
2
+ import { Object3D, Object3DEventMap } from '../core/Object3D.js';
3
3
  import { BufferGeometry, NormalOrGLBufferAttributes } from '../core/BufferGeometry.js';
4
4
  import { BufferAttribute } from '../core/BufferAttribute.js';
5
5
  import { InterleavedBufferAttribute } from '../core/InterleavedBufferAttribute.js';
@@ -15,7 +15,8 @@ import { GLBufferAttribute } from '../core/GLBufferAttribute.js';
15
15
  export class Points<
16
16
  TGeometry extends BufferGeometry<NormalOrGLBufferAttributes> = BufferGeometry,
17
17
  TMaterial extends Material | Material[] = Material | Material[],
18
- > extends Object3D {
18
+ TEventMap extends Object3DEventMap = Object3DEventMap,
19
+ > extends Object3D<TEventMap> {
19
20
  /**
20
21
  * Create a new instance of {@link Points}
21
22
  * @param geometry An instance of {@link THREE.BufferGeometry | BufferGeometry}. Default {@link THREE.BufferGeometry | `new THREE.BufferGeometry()`}.
@@ -5,6 +5,7 @@ import { Vector3 } from '../math/Vector3.js';
5
5
  import { Skeleton } from './Skeleton.js';
6
6
  import { Mesh } from './Mesh.js';
7
7
  import { BufferGeometry } from '../core/BufferGeometry.js';
8
+ import { Object3DEventMap } from '../core/Object3D.js';
8
9
  import { Sphere } from '../math/Sphere.js';
9
10
  import { BindMode } from '../constants.js';
10
11
 
@@ -50,7 +51,8 @@ import { BindMode } from '../constants.js';
50
51
  export class SkinnedMesh<
51
52
  TGeometry extends BufferGeometry = BufferGeometry,
52
53
  TMaterial extends Material | Material[] = Material | Material[],
53
- > extends Mesh<TGeometry, TMaterial> {
54
+ TEventMap extends Object3DEventMap = Object3DEventMap,
55
+ > extends Mesh<TGeometry, TMaterial, TEventMap> {
54
56
  /**
55
57
  * Create a new instance of {@link SkinnedMesh}
56
58
  * @param geometry An instance of {@link THREE.BufferGeometry | BufferGeometry}. Default {@link THREE.BufferGeometry | `new THREE.BufferGeometry()`}.
@@ -148,9 +150,4 @@ export class SkinnedMesh<
148
150
  * @param vector
149
151
  */
150
152
  applyBoneTransform(index: number, vector: Vector3): Vector3;
151
-
152
- /**
153
- * @deprecated {@link THREE.SkinnedMesh}: {@link boneTransform | .boneTransform()} was renamed to {@link applyBoneTransform | .applyBoneTransform()} in **r151**.
154
- */
155
- boneTransform(index: number, target: Vector3): Vector3;
156
153
  }
@@ -1,5 +1,5 @@
1
1
  import { Vector2 } from '../math/Vector2.js';
2
- import { Object3D } from '../core/Object3D.js';
2
+ import { Object3D, Object3DEventMap } from '../core/Object3D.js';
3
3
  import { SpriteMaterial } from '../materials/Materials.js';
4
4
  import { BufferGeometry } from '../core/BufferGeometry.js';
5
5
 
@@ -18,7 +18,7 @@ import { BufferGeometry } from '../core/BufferGeometry.js';
18
18
  * @see {@link https://threejs.org/docs/index.html#api/en/objects/Sprite | Official Documentation}
19
19
  * @see {@link https://github.com/mrdoob/three.js/blob/master/src/objects/Sprite.js | Source}
20
20
  */
21
- export class Sprite extends Object3D {
21
+ export class Sprite<TEventMap extends Object3DEventMap = Object3DEventMap> extends Object3D<TEventMap> {
22
22
  /**
23
23
  * Creates a new Sprite.
24
24
  * @param material An instance of {@link THREE.SpriteMaterial | SpriteMaterial}. Default {@link THREE.SpriteMaterial | `new SpriteMaterial()`}, _with white color_.
@@ -1,5 +1,4 @@
1
1
  import { WebGLRenderer } from '../WebGLRenderer.js';
2
- import { WebGLShader } from './WebGLShader.js';
3
2
  import { WebGLUniforms } from './WebGLUniforms.js';
4
3
 
5
4
  export class WebGLProgram {
@@ -46,6 +46,7 @@ export interface WebGLProgramParameters {
46
46
 
47
47
  supportsVertexTextures: boolean;
48
48
  outputColorSpace: ColorSpace;
49
+ alphaToCoverage: boolean;
49
50
 
50
51
  map: boolean;
51
52
  matcap: boolean;
@@ -146,7 +147,7 @@ export interface WebGLProgramParameters {
146
147
 
147
148
  fog: boolean;
148
149
  useFog: boolean;
149
- fogExp2: boolean | null; // null is possible because of a bug: ( fog && fog.isFogExp2 )
150
+ fogExp2: boolean;
150
151
 
151
152
  flatShading: boolean;
152
153
 
@@ -203,6 +204,7 @@ export interface WebGLProgramParameters {
203
204
  extensionDrawBuffers: boolean;
204
205
  extensionShaderTextureLOD: boolean;
205
206
  extensionClipCullDistance: boolean;
207
+ extensionMultiDraw: boolean;
206
208
 
207
209
  rendererExtensionFragDepth: boolean;
208
210
  rendererExtensionDrawBuffers: boolean;
@@ -0,0 +1,27 @@
1
+ import { Texture } from '../../textures/Texture.js';
2
+ import { Mesh } from '../../objects/Mesh.js';
3
+ import { WebGLRenderer } from '../WebGLRenderer.js';
4
+ import { WebXRArrayCamera } from './WebXRManager.js';
5
+
6
+ // FIXME Replace by XRWebGLDepthInformation when typed in @types/webxr
7
+ interface XRWebGLDepthInformation {
8
+ readonly texture: WebGLTexture;
9
+ readonly depthNear: number;
10
+ readonly depthFar: number;
11
+ }
12
+
13
+ export class WebXRDepthSensing {
14
+ texture: Texture | null;
15
+ mesh: Mesh | null;
16
+
17
+ depthNear: number;
18
+ depthFar: number;
19
+
20
+ constructor();
21
+
22
+ init(renderer: WebGLRenderer, depthData: XRWebGLDepthInformation, renderState: XRRenderState): void;
23
+
24
+ render(renderer: WebGLRenderer, cameraXR: WebXRArrayCamera): void;
25
+
26
+ reset(): void;
27
+ }
@@ -7,6 +7,7 @@ import { ArrayCamera } from '../../cameras/ArrayCamera.js';
7
7
  import { PerspectiveCamera } from '../../cameras/PerspectiveCamera.js';
8
8
  import { EventDispatcher } from '../../core/EventDispatcher.js';
9
9
  import { XRTargetRaySpace, XRGripSpace, XRHandSpace } from './WebXRController.js';
10
+ import { WebGLRenderer } from '../WebGLRenderer.js';
10
11
 
11
12
  export type WebXRCamera = PerspectiveCamera & { viewport: Vector4 };
12
13
  export type WebXRArrayCamera = Omit<ArrayCamera, 'cameras'> & { cameras: [WebXRCamera, WebXRCamera] };
@@ -21,7 +22,7 @@ export interface WebXRManagerEventMap {
21
22
  }
22
23
 
23
24
  export class WebXRManager extends EventDispatcher<WebXRManagerEventMap> {
24
- constructor(renderer: any, gl: WebGLRenderingContext);
25
+ constructor(renderer: WebGLRenderer, gl: WebGLRenderingContext);
25
26
 
26
27
  /**
27
28
  * @default false
@@ -53,7 +53,7 @@ export class DataArrayTexture extends Texture {
53
53
  * @param height Height of the texture. Default `1`.
54
54
  * @param depth Depth of the texture. Default `1`.
55
55
  */
56
- constructor(data?: BufferSource, width?: number, height?: number, depth?: number);
56
+ constructor(data?: BufferSource | null, width?: number, height?: number, depth?: number);
57
57
 
58
58
  /**
59
59
  * Read-only flag to check if a given object is of type {@link DataArrayTexture}.
@@ -26,7 +26,17 @@ export class Source {
26
26
  data: any;
27
27
 
28
28
  /**
29
- * Set this to `true` to trigger a data upload to the GPU next time the {@link Source} is used.
29
+ * This property is only relevant when {@link .needsUpdate} is set to `true` and provides more control on how
30
+ * texture data should be processed.
31
+ * When `dataReady` is set to `false`, the engine performs the memory allocation (if necessary) but does not
32
+ * transfer the data into the GPU memory.
33
+ * @default true
34
+ */
35
+ dataReady: boolean;
36
+
37
+ /**
38
+ * When the property is set to `true`, the engine allocates the memory for the texture (if necessary) and triggers
39
+ * the actual texture upload to the GPU next time the source is used.
30
40
  */
31
41
  set needsUpdate(value: boolean);
32
42
 
three/build/three.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from '../src/Three.js';
2
- export as namespace THREE;
@@ -1,2 +0,0 @@
1
- export * from '../src/Three.js';
2
- export as namespace THREE;