@types/three 0.159.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 (211) 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 +45 -11
  9. three/examples/jsm/loaders/LUT3dlLoader.d.ts +29 -2
  10. three/examples/jsm/loaders/LUTCubeLoader.d.ts +37 -2
  11. three/examples/jsm/loaders/MaterialXLoader.d.ts +6 -0
  12. three/examples/jsm/materials/MeshPostProcessingMaterial.d.ts +13 -0
  13. three/examples/jsm/misc/Timer.d.ts +80 -0
  14. three/examples/jsm/nodes/Nodes.d.ts +304 -61
  15. three/examples/jsm/nodes/accessors/BitangentNode.d.ts +9 -0
  16. three/examples/jsm/nodes/accessors/BufferNode.d.ts +4 -1
  17. three/examples/jsm/nodes/accessors/CameraNode.d.ts +24 -6
  18. three/examples/jsm/nodes/accessors/CubeTextureNode.d.ts +17 -4
  19. three/examples/jsm/nodes/accessors/InstanceNode.d.ts +3 -0
  20. three/examples/jsm/nodes/accessors/MaterialNode.d.ts +12 -0
  21. three/examples/jsm/nodes/accessors/MaterialReferenceNode.d.ts +7 -0
  22. three/examples/jsm/nodes/accessors/ModelNode.d.ts +9 -1
  23. three/examples/jsm/nodes/accessors/ModelViewProjectionNode.d.ts +3 -0
  24. three/examples/jsm/nodes/accessors/NormalNode.d.ts +8 -0
  25. three/examples/jsm/nodes/accessors/Object3DNode.d.ts +10 -6
  26. three/examples/jsm/nodes/accessors/PointUVNode.d.ts +3 -0
  27. three/examples/jsm/nodes/accessors/PositionNode.d.ts +8 -0
  28. three/examples/jsm/nodes/accessors/ReferenceNode.d.ts +4 -1
  29. three/examples/jsm/nodes/accessors/ReflectVectorNode.d.ts +3 -0
  30. three/examples/jsm/nodes/accessors/SkinningNode.d.ts +3 -0
  31. three/examples/jsm/nodes/accessors/StorageBufferNode.d.ts +8 -1
  32. three/examples/jsm/nodes/accessors/TangentNode.d.ts +9 -0
  33. three/examples/jsm/nodes/accessors/TextureBicubicNode.d.ts +18 -0
  34. three/examples/jsm/nodes/accessors/TextureNode.d.ts +21 -5
  35. three/examples/jsm/nodes/accessors/UVNode.d.ts +3 -0
  36. three/examples/jsm/nodes/accessors/UserDataNode.d.ts +7 -0
  37. three/examples/jsm/nodes/accessors/VertexColorNode.d.ts +12 -0
  38. three/examples/jsm/nodes/code/CodeNode.d.ts +4 -0
  39. three/examples/jsm/nodes/code/ExpressionNode.d.ts +3 -0
  40. three/examples/jsm/nodes/code/FunctionCallNode.d.ts +13 -1
  41. three/examples/jsm/nodes/code/FunctionNode.d.ts +17 -0
  42. three/examples/jsm/nodes/core/ArrayUniformNode.d.ts +1 -1
  43. three/examples/jsm/nodes/core/AssignNode.d.ts +17 -0
  44. three/examples/jsm/nodes/core/AttributeNode.d.ts +3 -0
  45. three/examples/jsm/nodes/core/BypassNode.d.ts +9 -0
  46. three/examples/jsm/nodes/core/CacheNode.d.ts +11 -0
  47. three/examples/jsm/nodes/core/ConstNode.d.ts +3 -3
  48. three/examples/jsm/nodes/core/ContextNode.d.ts +11 -0
  49. three/examples/jsm/nodes/core/IndexNode.d.ts +18 -0
  50. three/examples/jsm/nodes/core/InputNode.d.ts +4 -4
  51. three/examples/jsm/nodes/core/LightingModel.d.ts +36 -0
  52. three/examples/jsm/nodes/core/Node.d.ts +32 -8
  53. three/examples/jsm/nodes/core/NodeBuilder.d.ts +27 -23
  54. three/examples/jsm/nodes/core/NodeFrame.d.ts +18 -6
  55. three/examples/jsm/nodes/core/NodeUniform.d.ts +12 -8
  56. three/examples/jsm/nodes/core/NodeUtils.d.ts +6 -3
  57. three/examples/jsm/nodes/core/PropertyNode.d.ts +27 -1
  58. three/examples/jsm/nodes/core/UniformNode.d.ts +12 -4
  59. three/examples/jsm/nodes/core/VarNode.d.ts +10 -0
  60. three/examples/jsm/nodes/core/VaryingNode.d.ts +9 -0
  61. three/examples/jsm/nodes/core/constants.d.ts +31 -28
  62. three/examples/jsm/nodes/display/AfterImageNode.d.ts +25 -0
  63. three/examples/jsm/nodes/display/AnamorphicNode.d.ts +32 -0
  64. three/examples/jsm/nodes/display/BlendModeNode.d.ts +21 -6
  65. three/examples/jsm/nodes/display/ColorAdjustmentNode.d.ts +29 -1
  66. three/examples/jsm/nodes/display/ColorSpaceNode.d.ts +17 -0
  67. three/examples/jsm/nodes/display/FrontFacingNode.d.ts +4 -0
  68. three/examples/jsm/nodes/display/GaussianBlurNode.d.ts +28 -0
  69. three/examples/jsm/nodes/display/NormalMapNode.d.ts +13 -1
  70. three/examples/jsm/nodes/display/PassNode.d.ts +44 -0
  71. three/examples/jsm/nodes/display/PosterizeNode.d.ts +12 -0
  72. three/examples/jsm/nodes/display/ToneMappingNode.d.ts +8 -1
  73. three/examples/jsm/nodes/display/ViewportDepthNode.d.ts +32 -0
  74. three/examples/jsm/nodes/display/ViewportNode.d.ts +8 -0
  75. three/examples/jsm/nodes/display/ViewportSharedTextureNode.d.ts +18 -0
  76. three/examples/jsm/nodes/display/ViewportTextureNode.d.ts +33 -0
  77. three/examples/jsm/nodes/fog/FogExp2Node.d.ts +9 -0
  78. three/examples/jsm/nodes/fog/FogNode.d.ts +9 -0
  79. three/examples/jsm/nodes/fog/FogRangeNode.d.ts +9 -0
  80. three/examples/jsm/nodes/functions/BSDF/BRDF_GGX.d.ts +9 -2
  81. three/examples/jsm/nodes/functions/BSDF/BRDF_Lambert.d.ts +3 -2
  82. three/examples/jsm/nodes/functions/BSDF/BRDF_Sheen.d.ts +7 -0
  83. three/examples/jsm/nodes/functions/BSDF/DFGApprox.d.ts +3 -2
  84. three/examples/jsm/nodes/functions/BSDF/D_GGX.d.ts +3 -2
  85. three/examples/jsm/nodes/functions/BSDF/F_Schlick.d.ts +3 -2
  86. three/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +1 -1
  87. three/examples/jsm/nodes/functions/PhongLightingModel.d.ts +7 -0
  88. three/examples/jsm/nodes/functions/PhysicalLightingModel.d.ts +17 -8
  89. three/examples/jsm/nodes/functions/material/getGeometryRoughness.d.ts +1 -1
  90. three/examples/jsm/nodes/functions/material/getRoughness.d.ts +1 -1
  91. three/examples/jsm/nodes/geometry/RangeNode.d.ts +3 -0
  92. three/examples/jsm/nodes/gpgpu/ComputeNode.d.ts +13 -0
  93. three/examples/jsm/nodes/lighting/LightingContextNode.d.ts +20 -8
  94. three/examples/jsm/nodes/lighting/LightsNode.d.ts +3 -0
  95. three/examples/jsm/nodes/materials/LineBasicNodeMaterial.d.ts +1 -2
  96. three/examples/jsm/nodes/materials/Materials.d.ts +9 -17
  97. three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.d.ts +2 -4
  98. three/examples/jsm/nodes/materials/MeshPhongNodeMaterial.d.ts +12 -0
  99. three/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.d.ts +16 -7
  100. three/examples/jsm/nodes/materials/MeshSSSNodeMaterial.d.ts +17 -0
  101. three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +1 -5
  102. three/examples/jsm/nodes/materials/NodeMaterial.d.ts +55 -16
  103. three/examples/jsm/nodes/materials/PointsNodeMaterial.d.ts +2 -8
  104. three/examples/jsm/nodes/materials/SpriteNodeMaterial.d.ts +0 -10
  105. three/examples/jsm/nodes/materialx/MaterialXNodes.d.ts +43 -34
  106. three/examples/jsm/nodes/materialx/lib/mx_hsv.d.ts +5 -3
  107. three/examples/jsm/nodes/materialx/lib/mx_noise.d.ts +7 -5
  108. three/examples/jsm/nodes/math/CondNode.d.ts +13 -0
  109. three/examples/jsm/nodes/math/HashNode.d.ts +16 -0
  110. three/examples/jsm/nodes/math/MathNode.d.ts +140 -1
  111. three/examples/jsm/nodes/math/MathUtils.d.ts +16 -0
  112. three/examples/jsm/nodes/math/OperatorNode.d.ts +53 -1
  113. three/examples/jsm/nodes/math/TriNoise3D.d.ts +12 -0
  114. three/examples/jsm/nodes/procedural/CheckerNode.d.ts +9 -0
  115. three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +124 -31
  116. three/examples/jsm/nodes/utils/DiscardNode.d.ts +16 -0
  117. three/examples/jsm/nodes/utils/EquirectUVNode.d.ts +4 -2
  118. three/examples/jsm/nodes/utils/MatcapUVNode.d.ts +3 -0
  119. three/examples/jsm/nodes/utils/MaxMipLevelNode.d.ts +6 -3
  120. three/examples/jsm/nodes/utils/OscNode.d.ts +6 -0
  121. three/examples/jsm/nodes/utils/ReflectorNode.d.ts +30 -0
  122. three/examples/jsm/nodes/utils/RemapNode.d.ts +24 -1
  123. three/examples/jsm/nodes/utils/RotateNode.d.ts +21 -0
  124. three/examples/jsm/nodes/utils/RotateUVNode.d.ts +9 -0
  125. three/examples/jsm/nodes/utils/SpecularMIPLevelNode.d.ts +5 -1
  126. three/examples/jsm/nodes/utils/SpriteSheetUVNode.d.ts +7 -0
  127. three/examples/jsm/nodes/utils/TimerNode.d.ts +7 -1
  128. three/examples/jsm/nodes/utils/TriplanarTexturesNode.d.ts +28 -7
  129. three/examples/jsm/objects/GroundedSkybox.d.ts +5 -0
  130. three/examples/jsm/objects/QuadMesh.d.ts +15 -0
  131. three/examples/jsm/postprocessing/{HBAOPass.d.ts → GTAOPass.d.ts} +25 -10
  132. three/examples/jsm/postprocessing/SSAOPass.d.ts +1 -1
  133. three/examples/jsm/renderers/common/Backend.d.ts +6 -2
  134. three/examples/jsm/renderers/common/Color4.d.ts +9 -0
  135. three/examples/jsm/renderers/common/Info.d.ts +7 -1
  136. three/examples/jsm/renderers/common/PostProcessing.d.ts +11 -0
  137. three/examples/jsm/renderers/common/Renderer.d.ts +243 -4
  138. three/examples/jsm/renderers/common/StorageTexture.d.ts +5 -0
  139. three/examples/jsm/renderers/webgl/WebGLBackend.d.ts +4 -2
  140. three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +2 -2
  141. three/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodes.d.ts +3 -0
  142. three/examples/jsm/renderers/webgpu/WebGPUBackend.d.ts +15 -6
  143. three/examples/jsm/renderers/webgpu/WebGPURenderer.d.ts +7 -7
  144. three/examples/jsm/shaders/{HBAOShader.d.ts → GTAOShader.d.ts} +23 -8
  145. three/examples/jsm/shaders/PoissonDenoiseShader.d.ts +1 -1
  146. three/examples/jsm/utils/BufferGeometryUtils.d.ts +0 -10
  147. three/examples/jsm/webxr/XRControllerModelFactory.d.ts +6 -5
  148. three/examples/jsm/webxr/XRHandMeshModel.d.ts +10 -2
  149. three/package.json +2 -2
  150. three/src/Three.d.ts +1 -0
  151. three/src/cameras/PerspectiveCamera.d.ts +13 -0
  152. three/src/constants.d.ts +4 -3
  153. three/src/core/InterleavedBufferAttribute.d.ts +12 -2
  154. three/src/core/Object3D.d.ts +13 -13
  155. three/src/core/UniformsGroup.d.ts +3 -3
  156. three/src/extras/core/Curve.d.ts +9 -9
  157. three/src/extras/core/CurvePath.d.ts +8 -7
  158. three/src/geometries/RingGeometry.d.ts +1 -1
  159. three/src/lights/PointLight.d.ts +7 -0
  160. three/src/loaders/MaterialLoader.d.ts +6 -3
  161. three/src/materials/LineBasicMaterial.d.ts +7 -0
  162. three/src/materials/LineDashedMaterial.d.ts +7 -1
  163. three/src/materials/Material.d.ts +17 -15
  164. three/src/materials/MeshBasicMaterial.d.ts +7 -0
  165. three/src/materials/MeshDepthMaterial.d.ts +6 -0
  166. three/src/materials/MeshDistanceMaterial.d.ts +7 -0
  167. three/src/materials/MeshLambertMaterial.d.ts +7 -0
  168. three/src/materials/MeshMatcapMaterial.d.ts +7 -0
  169. three/src/materials/MeshNormalMaterial.d.ts +7 -0
  170. three/src/materials/MeshPhongMaterial.d.ts +7 -0
  171. three/src/materials/MeshPhysicalMaterial.d.ts +6 -1
  172. three/src/materials/MeshStandardMaterial.d.ts +7 -2
  173. three/src/materials/MeshToonMaterial.d.ts +7 -0
  174. three/src/materials/PointsMaterial.d.ts +7 -0
  175. three/src/materials/RawShaderMaterial.d.ts +9 -0
  176. three/src/materials/ShaderMaterial.d.ts +17 -3
  177. three/src/materials/ShadowMaterial.d.ts +7 -0
  178. three/src/materials/SpriteMaterial.d.ts +7 -2
  179. three/src/math/Color.d.ts +1 -1
  180. three/src/math/Matrix4.d.ts +30 -30
  181. three/src/math/Quaternion.d.ts +27 -30
  182. three/src/math/Sphere.d.ts +5 -0
  183. three/src/math/Triangle.d.ts +8 -25
  184. three/src/math/Vector2.d.ts +24 -159
  185. three/src/math/Vector3.d.ts +46 -54
  186. three/src/math/Vector4.d.ts +25 -20
  187. three/src/objects/BatchedMesh.d.ts +2 -2
  188. three/src/objects/Bone.d.ts +2 -2
  189. three/src/objects/InstancedMesh.d.ts +2 -1
  190. three/src/objects/LOD.d.ts +2 -2
  191. three/src/objects/Line.d.ts +3 -2
  192. three/src/objects/LineLoop.d.ts +3 -1
  193. three/src/objects/LineSegments.d.ts +3 -1
  194. three/src/objects/Points.d.ts +3 -2
  195. three/src/objects/SkinnedMesh.d.ts +4 -8
  196. three/src/objects/Sprite.d.ts +2 -2
  197. three/src/renderers/shaders/ShaderLib.d.ts +18 -18
  198. three/src/renderers/shaders/UniformsUtils.d.ts +3 -2
  199. three/src/renderers/webgl/WebGLLights.d.ts +39 -37
  200. three/src/renderers/webgl/WebGLProgram.d.ts +0 -1
  201. three/src/renderers/webgl/WebGLPrograms.d.ts +226 -9
  202. three/src/renderers/webxr/WebXRDepthSensing.d.ts +27 -0
  203. three/src/renderers/webxr/WebXRManager.d.ts +2 -1
  204. three/src/textures/CompressedCubeTexture.d.ts +13 -0
  205. three/src/textures/DataArrayTexture.d.ts +1 -1
  206. three/src/textures/Source.d.ts +11 -1
  207. three/build/three.d.ts +0 -2
  208. three/build/three.min.d.ts +0 -2
  209. three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +0 -310
  210. three/examples/jsm/nodes/shadernode/ShaderNodeElements.d.ts +0 -166
  211. three/examples/jsm/objects/GroundProjectedSkybox.d.ts +0 -13
@@ -3,140 +3,15 @@ import { BufferAttribute } from '../core/BufferAttribute.js';
3
3
 
4
4
  export type Vector2Tuple = [number, number];
5
5
 
6
- /**
7
- * ( interface Vector<T> )
8
- *
9
- * Abstract interface of {@link https://github.com/mrdoob/three.js/blob/master/src/math/Vector2.js|Vector2},
10
- * {@link https://github.com/mrdoob/three.js/blob/master/src/math/Vector3.js|Vector3}
11
- * and {@link https://github.com/mrdoob/three.js/blob/master/src/math/Vector4.js|Vector4}.
12
- *
13
- * Currently the members of Vector is NOT type safe because it accepts different typed vectors.
14
- *
15
- * Those definitions will be changed when TypeScript innovates Generics to be type safe.
16
- *
17
- * @example
18
- * const v:THREE.Vector = new THREE.Vector3();
19
- * v.addVectors(new THREE.Vector2(0, 1), new THREE.Vector2(2, 3)); // invalid but compiled successfully
20
- */
21
- export interface Vector {
22
- setComponent(index: number, value: number): this;
23
-
24
- getComponent(index: number): number;
25
-
26
- set(...args: number[]): this;
27
-
28
- setScalar(scalar: number): this;
29
-
30
- /**
31
- * copy(v:T):T;
32
- */
33
- copy(v: Vector): this;
34
-
35
- /**
36
- * NOTE: The second argument is deprecated.
37
- *
38
- * add(v:T):T;
39
- */
40
- add(v: Vector): this;
41
-
42
- /**
43
- * addVectors(a:T, b:T):T;
44
- */
45
- addVectors(a: Vector, b: Vector): this;
46
-
47
- addScaledVector(vector: Vector, scale: number): this;
48
-
49
- /**
50
- * Adds the scalar value s to this vector's values.
51
- */
52
- addScalar(scalar: number): this;
53
-
54
- /**
55
- * sub(v:T):T;
56
- */
57
- sub(v: Vector): this;
58
-
59
- /**
60
- * subVectors(a:T, b:T):T;
61
- */
62
- subVectors(a: Vector, b: Vector): this;
63
-
64
- /**
65
- * multiplyScalar(s:number):T;
66
- */
67
- multiplyScalar(s: number): this;
68
-
69
- /**
70
- * divideScalar(s:number):T;
71
- */
72
- divideScalar(s: number): this;
73
-
74
- /**
75
- * negate():T;
76
- */
77
- negate(): this;
78
-
79
- /**
80
- * dot(v:T):T;
81
- */
82
- dot(v: Vector): number;
83
-
84
- /**
85
- * lengthSq():number;
86
- */
87
- lengthSq(): number;
88
-
89
- /**
90
- * length():number;
91
- */
92
- length(): number;
93
-
94
- /**
95
- * normalize():T;
96
- */
97
- normalize(): this;
98
-
99
- /**
100
- * NOTE: Vector4 doesn't have the property.
101
- *
102
- * distanceTo(v:T):number;
103
- */
104
- distanceTo?(v: Vector): number;
105
-
106
- /**
107
- * NOTE: Vector4 doesn't have the property.
108
- *
109
- * distanceToSquared(v:T):number;
110
- */
111
- distanceToSquared?(v: Vector): number;
112
-
113
- /**
114
- * setLength(l:number):T;
115
- */
116
- setLength(l: number): this;
117
-
118
- /**
119
- * lerp(v:T, alpha:number):T;
120
- */
121
- lerp(v: Vector, alpha: number): this;
122
-
123
- /**
124
- * equals(v:T):boolean;
125
- */
126
- equals(v: Vector): boolean;
127
-
128
- /**
129
- * clone():T;
130
- */
131
- clone(): Vector;
6
+ export interface Vector2Like {
7
+ readonly x: number;
8
+ readonly y: number;
132
9
  }
133
10
 
134
11
  /**
135
12
  * 2D vector.
136
- *
137
- * ( class Vector2 implements Vector<Vector2> )
138
13
  */
139
- export class Vector2 implements Vector {
14
+ export class Vector2 {
140
15
  constructor(x?: number, y?: number);
141
16
 
142
17
  /**
@@ -190,12 +65,12 @@ export class Vector2 implements Vector {
190
65
  /**
191
66
  * Copies value of v to this vector.
192
67
  */
193
- copy(v: Vector2): this;
68
+ copy(v: Vector2Like): this;
194
69
 
195
70
  /**
196
71
  * Adds v to this vector.
197
72
  */
198
- add(v: Vector2, w?: Vector2): this;
73
+ add(v: Vector2Like): this;
199
74
 
200
75
  /**
201
76
  * Adds the scalar value s to this vector's x and y values.
@@ -205,17 +80,17 @@ export class Vector2 implements Vector {
205
80
  /**
206
81
  * Sets this vector to a + b.
207
82
  */
208
- addVectors(a: Vector2, b: Vector2): this;
83
+ addVectors(a: Vector2Like, b: Vector2Like): this;
209
84
 
210
85
  /**
211
86
  * Adds the multiple of v and s to this vector.
212
87
  */
213
- addScaledVector(v: Vector2, s: number): this;
88
+ addScaledVector(v: Vector2Like, s: number): this;
214
89
 
215
90
  /**
216
91
  * Subtracts v from this vector.
217
92
  */
218
- sub(v: Vector2): this;
93
+ sub(v: Vector2Like): this;
219
94
 
220
95
  /**
221
96
  * Subtracts s from this vector's x and y components.
@@ -225,12 +100,12 @@ export class Vector2 implements Vector {
225
100
  /**
226
101
  * Sets this vector to a - b.
227
102
  */
228
- subVectors(a: Vector2, b: Vector2): this;
103
+ subVectors(a: Vector2Like, b: Vector2Like): this;
229
104
 
230
105
  /**
231
106
  * Multiplies this vector by v.
232
107
  */
233
- multiply(v: Vector2): this;
108
+ multiply(v: Vector2Like): this;
234
109
 
235
110
  /**
236
111
  * Multiplies this vector by scalar s.
@@ -240,7 +115,7 @@ export class Vector2 implements Vector {
240
115
  /**
241
116
  * Divides this vector by v.
242
117
  */
243
- divide(v: Vector2): this;
118
+ divide(v: Vector2Like): this;
244
119
 
245
120
  /**
246
121
  * Divides this vector by scalar s.
@@ -256,12 +131,12 @@ export class Vector2 implements Vector {
256
131
  /**
257
132
  * If this vector's x or y value is greater than v's x or y value, replace that value with the corresponding min value.
258
133
  */
259
- min(v: Vector2): this;
134
+ min(v: Vector2Like): this;
260
135
 
261
136
  /**
262
137
  * If this vector's x or y value is less than v's x or y value, replace that value with the corresponding max value.
263
138
  */
264
- max(v: Vector2): this;
139
+ max(v: Vector2Like): this;
265
140
 
266
141
  /**
267
142
  * If this vector's x or y value is greater than the max vector's x or y value, it is replaced by the corresponding value.
@@ -269,7 +144,7 @@ export class Vector2 implements Vector {
269
144
  * @param min the minimum x and y values.
270
145
  * @param max the maximum x and y values in the desired range.
271
146
  */
272
- clamp(min: Vector2, max: Vector2): this;
147
+ clamp(min: Vector2Like, max: Vector2Like): this;
273
148
 
274
149
  /**
275
150
  * If this vector's x or y values are greater than the max value, they are replaced by the max value.
@@ -315,12 +190,12 @@ export class Vector2 implements Vector {
315
190
  /**
316
191
  * Computes dot product of this vector and v.
317
192
  */
318
- dot(v: Vector2): number;
193
+ dot(v: Vector2Like): number;
319
194
 
320
195
  /**
321
196
  * Computes cross product of this vector and v.
322
197
  */
323
- cross(v: Vector2): number;
198
+ cross(v: Vector2Like): number;
324
199
 
325
200
  /**
326
201
  * Computes squared length of this vector.
@@ -332,11 +207,6 @@ export class Vector2 implements Vector {
332
207
  */
333
208
  length(): number;
334
209
 
335
- /**
336
- * @deprecated Use {@link Vector2#manhattanLength .manhattanLength()} instead.
337
- */
338
- lengthManhattan(): number;
339
-
340
210
  /**
341
211
  * Computes the Manhattan length of this vector.
342
212
  *
@@ -362,24 +232,19 @@ export class Vector2 implements Vector {
362
232
  /**
363
233
  * Computes distance of this vector to v.
364
234
  */
365
- distanceTo(v: Vector2): number;
235
+ distanceTo(v: Vector2Like): number;
366
236
 
367
237
  /**
368
238
  * Computes squared distance of this vector to v.
369
239
  */
370
- distanceToSquared(v: Vector2): number;
371
-
372
- /**
373
- * @deprecated Use {@link Vector2#manhattanDistanceTo .manhattanDistanceTo()} instead.
374
- */
375
- distanceToManhattan(v: Vector2): number;
240
+ distanceToSquared(v: Vector2Like): number;
376
241
 
377
242
  /**
378
243
  * Computes the Manhattan length (distance) from this vector to the given vector v
379
244
  *
380
245
  * see {@link http://en.wikipedia.org/wiki/Taxicab_geometry|Wikipedia: Taxicab Geometry}
381
246
  */
382
- manhattanDistanceTo(v: Vector2): number;
247
+ manhattanDistanceTo(v: Vector2Like): number;
383
248
 
384
249
  /**
385
250
  * Normalizes this vector and multiplies it by l.
@@ -391,7 +256,7 @@ export class Vector2 implements Vector {
391
256
  * @param v vector to interpolate towards.
392
257
  * @param alpha interpolation factor in the closed interval [0, 1].
393
258
  */
394
- lerp(v: Vector2, alpha: number): this;
259
+ lerp(v: Vector2Like, alpha: number): this;
395
260
 
396
261
  /**
397
262
  * Sets this vector to be the vector linearly interpolated between v1 and v2 where alpha is the distance along the line connecting the two vectors - alpha = 0 will be v1, and alpha = 1 will be v2.
@@ -399,12 +264,12 @@ export class Vector2 implements Vector {
399
264
  * @param v2 vector to interpolate towards.
400
265
  * @param alpha interpolation factor in the closed interval [0, 1].
401
266
  */
402
- lerpVectors(v1: Vector2, v2: Vector2, alpha: number): this;
267
+ lerpVectors(v1: Vector2Like, v2: Vector2Like, alpha: number): this;
403
268
 
404
269
  /**
405
270
  * Checks for strict equality of this vector and v.
406
271
  */
407
- equals(v: Vector2): boolean;
272
+ equals(v: Vector2Like): boolean;
408
273
 
409
274
  /**
410
275
  * Sets this vector's x and y value from the provided array or array-like.
@@ -442,7 +307,7 @@ export class Vector2 implements Vector {
442
307
  * @param center the point around which to rotate.
443
308
  * @param angle the angle to rotate, in radians.
444
309
  */
445
- rotateAround(center: Vector2, angle: number): this;
310
+ rotateAround(center: Vector2Like, angle: number): this;
446
311
 
447
312
  /**
448
313
  * Sets this vector's x and y from Math.random
@@ -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 };