@types/three 0.184.0 → 0.185.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 (208) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +2 -0
  3. three/examples/jsm/controls/FirstPersonControls.d.ts +9 -0
  4. three/examples/jsm/controls/OrbitControls.d.ts +2 -2
  5. three/examples/jsm/controls/TransformControls.d.ts +32 -1
  6. three/examples/jsm/csm/CSMFrustum.d.ts +73 -13
  7. three/examples/jsm/exporters/DRACOExporter.d.ts +1 -1
  8. three/examples/jsm/exporters/GLTFExporter.d.ts +2 -2
  9. three/examples/jsm/exporters/PLYExporter.d.ts +5 -4
  10. three/examples/jsm/exporters/USDZExporter.d.ts +5 -1
  11. three/examples/jsm/generators/CityGenerator.d.ts +75 -0
  12. three/examples/jsm/generators/ForestGenerator.d.ts +79 -0
  13. three/examples/jsm/generators/TerrainGenerator.d.ts +67 -0
  14. three/examples/jsm/generators/TreeGenerator.d.ts +97 -0
  15. three/examples/jsm/generators/city/SidewalkGenerator.d.ts +40 -0
  16. three/examples/jsm/generators/city/SkyscraperGenerator.d.ts +83 -0
  17. three/examples/jsm/geometries/LoftGeometry.d.ts +83 -0
  18. three/examples/jsm/inspector/tabs/Parameters.d.ts +5 -2
  19. three/examples/jsm/lighting/ClusteredLighting.d.ts +45 -0
  20. three/examples/jsm/lighting/LightProbeGrid.d.ts +131 -13
  21. three/examples/jsm/loaders/DRACOLoader.d.ts +20 -6
  22. three/examples/jsm/loaders/EXRLoader.d.ts +2 -12
  23. three/examples/jsm/loaders/GLTFLoader.d.ts +1 -1
  24. three/examples/jsm/loaders/HDRLoader.d.ts +2 -12
  25. three/examples/jsm/loaders/KTX2Loader.d.ts +1 -1
  26. three/examples/jsm/loaders/LWOLoader.d.ts +6 -0
  27. three/examples/jsm/loaders/RGBELoader.d.ts +1 -7
  28. three/examples/jsm/loaders/SVGLoader.d.ts +9 -6
  29. three/examples/jsm/loaders/TGALoader.d.ts +2 -2
  30. three/examples/jsm/loaders/TIFFLoader.d.ts +2 -11
  31. three/examples/jsm/loaders/USDLoader.d.ts +6 -1
  32. three/examples/jsm/misc/TileCreasedNormalsPlugin.d.ts +49 -0
  33. three/examples/jsm/objects/MarchingCubes.d.ts +2 -2
  34. three/examples/jsm/objects/Reflector.d.ts +38 -5
  35. three/examples/jsm/objects/SkyMesh.d.ts +1 -1
  36. three/examples/jsm/physics/RapierPhysics.d.ts +1 -0
  37. three/examples/jsm/tsl/display/BloomNode.d.ts +23 -6
  38. three/examples/jsm/tsl/display/ImportanceSampledEnvironment.d.ts +84 -0
  39. three/examples/jsm/tsl/display/RecurrentDenoiseNode.d.ts +89 -0
  40. three/examples/jsm/tsl/display/SSAAPassNode.d.ts +0 -2
  41. three/examples/jsm/tsl/display/SSGINode.d.ts +4 -1
  42. three/examples/jsm/tsl/display/SSRNode.d.ts +303 -30
  43. three/examples/jsm/tsl/display/TRAANode.d.ts +1 -1
  44. three/examples/jsm/tsl/display/TemporalReprojectNode.d.ts +64 -0
  45. three/examples/jsm/tsl/lighting/ClusteredLightsNode.d.ts +54 -0
  46. three/examples/jsm/tsl/math/curlNoise.d.ts +38 -0
  47. three/examples/jsm/tsl/utils/GroundedSkybox.d.ts +17 -0
  48. three/examples/jsm/tsl/utils/RNoise.d.ts +12 -0
  49. three/examples/jsm/tsl/utils/SpecularHelpers.d.ts +20 -0
  50. three/examples/jsm/webxr/WebGLXRFallback.d.ts +14 -0
  51. three/package.json +3 -3
  52. three/src/Three.TSL.d.ts +10 -3
  53. three/src/Three.WebGPU.Nodes.d.ts +2 -2
  54. three/src/Three.WebGPU.d.ts +5 -3
  55. three/src/animation/AnimationClip.d.ts +0 -10
  56. three/src/cameras/Camera.d.ts +1 -1
  57. three/src/core/InterleavedBuffer.d.ts +1 -1
  58. three/src/core/Object3D.d.ts +8 -4
  59. three/src/core/RenderTarget.d.ts +11 -0
  60. three/src/core/Timer.d.ts +1 -1
  61. three/src/core/UniformsGroup.d.ts +1 -1
  62. three/src/extras/Controls.d.ts +6 -5
  63. three/src/extras/core/ShapePath.d.ts +61 -65
  64. three/src/loaders/DataTextureLoader.d.ts +37 -3
  65. three/src/loaders/MaterialLoader.d.ts +8 -0
  66. three/src/materials/LineBasicMaterial.d.ts +5 -0
  67. three/src/materials/Material.d.ts +9 -1
  68. three/src/materials/MeshBasicMaterial.d.ts +30 -0
  69. three/src/materials/MeshDepthMaterial.d.ts +13 -0
  70. three/src/materials/MeshDistanceMaterial.d.ts +13 -0
  71. three/src/materials/MeshLambertMaterial.d.ts +50 -1
  72. three/src/materials/MeshMatcapMaterial.d.ts +31 -1
  73. three/src/materials/MeshNormalMaterial.d.ts +11 -1
  74. three/src/materials/MeshPhongMaterial.d.ts +50 -1
  75. three/src/materials/MeshPhysicalMaterial.d.ts +50 -0
  76. three/src/materials/MeshStandardMaterial.d.ts +53 -1
  77. three/src/materials/MeshToonMaterial.d.ts +43 -1
  78. three/src/materials/PointsMaterial.d.ts +9 -0
  79. three/src/materials/ShaderMaterial.d.ts +2 -0
  80. three/src/materials/SpriteMaterial.d.ts +9 -0
  81. three/src/materials/nodes/Line2NodeMaterial.d.ts +18 -13
  82. three/src/materials/nodes/NodeMaterial.d.ts +33 -13
  83. three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +0 -84
  84. three/src/math/Box2.d.ts +3 -3
  85. three/src/math/Box3.d.ts +255 -19
  86. three/src/math/Color.d.ts +10 -10
  87. three/src/math/FrustumArray.d.ts +75 -16
  88. three/src/math/Interpolant.d.ts +111 -8
  89. three/src/math/Matrix2.d.ts +1 -1
  90. three/src/math/Matrix3.d.ts +10 -1
  91. three/src/math/Matrix4.d.ts +329 -105
  92. three/src/math/Vector2.d.ts +1 -2
  93. three/src/math/Vector3.d.ts +3 -4
  94. three/src/math/Vector4.d.ts +1 -2
  95. three/src/math/interpolants/BezierInterpolant.d.ts +19 -3
  96. three/src/math/interpolants/CubicInterpolant.d.ts +18 -3
  97. three/src/math/interpolants/DiscreteInterpolant.d.ts +8 -3
  98. three/src/math/interpolants/LinearInterpolant.d.ts +7 -3
  99. three/src/math/interpolants/QuaternionLinearInterpolant.d.ts +7 -3
  100. three/src/nodes/Nodes.d.ts +4 -13
  101. three/src/nodes/TSL.d.ts +7 -5
  102. three/src/nodes/accessors/Batch.d.ts +19 -0
  103. three/src/nodes/accessors/Instance.d.ts +34 -0
  104. three/src/nodes/accessors/MaterialNode.d.ts +86 -79
  105. three/src/nodes/accessors/Morph.d.ts +11 -0
  106. three/src/nodes/accessors/Skinning.d.ts +23 -0
  107. three/src/nodes/accessors/StorageBufferNode.d.ts +22 -23
  108. three/src/nodes/accessors/StorageTexture3DNode.d.ts +17 -0
  109. three/src/nodes/accessors/StorageTextureNode.d.ts +6 -4
  110. three/src/nodes/accessors/TextureNode.d.ts +15 -10
  111. three/src/nodes/core/ArrayNode.d.ts +16 -8
  112. three/src/nodes/core/ContextNode.d.ts +5 -6
  113. three/src/nodes/core/LightingModel.d.ts +2 -0
  114. three/src/nodes/core/Node.d.ts +50 -51
  115. three/src/nodes/core/NodeBuilder.d.ts +1 -133
  116. three/src/nodes/core/OverrideContextNode.d.ts +92 -0
  117. three/src/nodes/core/PropertyNode.d.ts +13 -2
  118. three/src/nodes/core/StructNode.d.ts +0 -2
  119. three/src/nodes/core/StructTypeNode.d.ts +5 -4
  120. three/src/nodes/core/UniformNode.d.ts +48 -9
  121. three/src/nodes/display/BlendModes.d.ts +72 -11
  122. three/src/nodes/display/FrontFacingNode.d.ts +62 -3
  123. three/src/nodes/display/PassNode.d.ts +0 -2
  124. three/src/nodes/display/PremultiplyAlphaFunctions.d.ts +37 -0
  125. three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +53 -45
  126. three/src/nodes/lighting/LightingContextNode.d.ts +9 -2
  127. three/src/nodes/lighting/LightsNode.d.ts +4 -4
  128. three/src/nodes/math/MathNode.d.ts +358 -304
  129. three/src/nodes/math/OperatorNode.d.ts +253 -82
  130. three/src/nodes/tsl/TSLCore.d.ts +16 -9
  131. three/src/nodes/utils/ArrayElementNode.d.ts +5 -4
  132. three/src/nodes/utils/EquirectUV.d.ts +31 -1
  133. three/src/nodes/utils/Packing.d.ts +50 -3
  134. three/src/nodes/utils/RTTNode.d.ts +7 -12
  135. three/src/nodes/utils/Remap.d.ts +216 -29
  136. three/src/nodes/utils/SampleNode.d.ts +18 -8
  137. three/src/objects/BatchedMesh.d.ts +1 -1
  138. three/src/objects/InstancedMesh.d.ts +0 -8
  139. three/src/objects/Skeleton.d.ts +0 -2
  140. three/src/renderers/common/Backend.d.ts +0 -3
  141. three/src/renderers/common/CanvasTarget.d.ts +0 -49
  142. three/src/renderers/common/ClippingContext.d.ts +6 -1
  143. three/src/renderers/common/CubeRenderTarget.d.ts +2 -1
  144. three/src/renderers/common/Info.d.ts +26 -66
  145. three/src/renderers/common/InspectorBase.d.ts +0 -7
  146. three/src/renderers/common/Lighting.d.ts +49 -5
  147. three/src/renderers/common/Renderer.d.ts +34 -458
  148. three/src/renderers/common/RendererUtils.d.ts +1 -2
  149. three/src/renderers/common/TimestampQueryPool.d.ts +1 -1
  150. three/src/renderers/common/XRManager.d.ts +32 -299
  151. three/src/renderers/common/nodes/NodeLibrary.d.ts +0 -117
  152. three/src/renderers/webgl/WebGLPrograms.d.ts +2 -0
  153. three/src/renderers/webgl/WebGLRenderLists.d.ts +5 -1
  154. three/src/renderers/webgl/WebGLState.d.ts +2 -0
  155. three/src/renderers/webgl-fallback/WebGLBackend.d.ts +1 -1
  156. three/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.d.ts +0 -10
  157. three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +0 -1
  158. three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +5 -121
  159. three/src/textures/CubeDepthTexture.d.ts +2 -3
  160. three/src/textures/DataTexture.d.ts +2 -1
  161. three/src/textures/DepthTexture.d.ts +5 -5
  162. three/examples/jsm/lighting/TiledLighting.d.ts +0 -9
  163. three/examples/jsm/tsl/display/AnamorphicNode.d.ts +0 -31
  164. three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +0 -22
  165. three/src/nodes/accessors/BatchNode.d.ts +0 -12
  166. three/src/nodes/accessors/InstanceNode.d.ts +0 -30
  167. three/src/nodes/accessors/InstancedMeshNode.d.ts +0 -10
  168. three/src/nodes/accessors/MorphNode.d.ts +0 -14
  169. three/src/nodes/accessors/SkinningNode.d.ts +0 -32
  170. three/src/renderers/common/Animation.d.ts +0 -102
  171. three/src/renderers/common/Attributes.d.ts +0 -59
  172. three/src/renderers/common/Background.d.ts +0 -47
  173. three/src/renderers/common/BindGroup.d.ts +0 -39
  174. three/src/renderers/common/Binding.d.ts +0 -50
  175. three/src/renderers/common/Bindings.d.ts +0 -132
  176. three/src/renderers/common/Buffer.d.ts +0 -90
  177. three/src/renderers/common/ChainMap.d.ts +0 -49
  178. three/src/renderers/common/Color4.d.ts +0 -55
  179. three/src/renderers/common/ComputePipeline.d.ts +0 -34
  180. three/src/renderers/common/DataMap.d.ts +0 -42
  181. three/src/renderers/common/Geometries.d.ts +0 -111
  182. three/src/renderers/common/Pipeline.d.ts +0 -29
  183. three/src/renderers/common/Pipelines.d.ts +0 -186
  184. three/src/renderers/common/ProgrammableStage.d.ts +0 -73
  185. three/src/renderers/common/RenderBundle.d.ts +0 -25
  186. three/src/renderers/common/RenderBundles.d.ts +0 -34
  187. three/src/renderers/common/RenderContext.d.ts +0 -235
  188. three/src/renderers/common/RenderContexts.d.ts +0 -47
  189. three/src/renderers/common/RenderList.d.ts +0 -226
  190. three/src/renderers/common/RenderLists.d.ts +0 -46
  191. three/src/renderers/common/RenderObject.d.ts +0 -448
  192. three/src/renderers/common/RenderObjectPipeline.d.ts +0 -33
  193. three/src/renderers/common/RenderObjects.d.ts +0 -151
  194. three/src/renderers/common/SampledTexture.d.ts +0 -28
  195. three/src/renderers/common/Sampler.d.ts +0 -19
  196. three/src/renderers/common/Textures.d.ts +0 -125
  197. three/src/renderers/common/Uniform.d.ts +0 -262
  198. three/src/renderers/common/UniformBuffer.d.ts +0 -20
  199. three/src/renderers/common/UniformsGroup.d.ts +0 -152
  200. three/src/renderers/common/XRRenderTarget.d.ts +0 -67
  201. three/src/renderers/common/nodes/NodeBuilderState.d.ts +0 -121
  202. three/src/renderers/common/nodes/NodeManager.d.ts +0 -309
  203. three/src/renderers/common/nodes/NodeSampledTexture.d.ts +0 -29
  204. three/src/renderers/common/nodes/NodeSampler.d.ts +0 -12
  205. three/src/renderers/common/nodes/NodeUniform.d.ts +0 -250
  206. three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +0 -41
  207. three/src/renderers/webgpu/nodes/WGSLNodeFunction.d.ts +0 -6
  208. three/src/renderers/webgpu/nodes/WGSLNodeParser.d.ts +0 -6
@@ -24,38 +24,69 @@ export type Matrix4Tuple = [
24
24
  ];
25
25
 
26
26
  /**
27
- * A 4x4 Matrix.
27
+ * Represents a 4x4 matrix.
28
28
  *
29
- * @example
30
- * // Simple rig for rotating around 3 axes
29
+ * The most common use of a 4x4 matrix in 3D computer graphics is as a transformation matrix.
30
+ * For an introduction to transformation matrices as used in WebGL, check out [this tutorial](https://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices)
31
+ *
32
+ * This allows a 3D vector representing a point in 3D space to undergo
33
+ * transformations such as translation, rotation, shear, scale, reflection,
34
+ * orthogonal or perspective projection and so on, by being multiplied by the
35
+ * matrix. This is known as `applying` the matrix to the vector.
36
+ *
37
+ * A Note on Row-Major and Column-Major Ordering:
38
+ *
39
+ * The constructor and {@link Matrix3#set} method take arguments in
40
+ * [row-major](https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order)
41
+ * order, while internally they are stored in the {@link Matrix3#elements} array in column-major order.
42
+ * This means that calling:
43
+ * ```js
31
44
  * const m = new THREE.Matrix4();
32
- * const m1 = new THREE.Matrix4();
33
- * const m2 = new THREE.Matrix4();
34
- * const m3 = new THREE.Matrix4();
35
- * const alpha = 0;
36
- * const beta = Math.PI;
37
- * const gamma = Math.PI/2;
38
- * m1.makeRotationX( alpha );
39
- * m2.makeRotationY( beta );
40
- * m3.makeRotationZ( gamma );
41
- * m.multiplyMatrices( m1, m2 );
42
- * m.multiply( m3 );
45
+ * m.set( 11, 12, 13, 14,
46
+ * 21, 22, 23, 24,
47
+ * 31, 32, 33, 34,
48
+ * 41, 42, 43, 44 );
49
+ * ```
50
+ * will result in the elements array containing:
51
+ * ```js
52
+ * m.elements = [ 11, 21, 31, 41,
53
+ * 12, 22, 32, 42,
54
+ * 13, 23, 33, 43,
55
+ * 14, 24, 34, 44 ];
56
+ * ```
57
+ * and internally all calculations are performed using column-major ordering.
58
+ * However, as the actual ordering makes no difference mathematically and
59
+ * most people are used to thinking about matrices in row-major order, the
60
+ * three.js documentation shows matrices in row-major order. Just bear in
61
+ * mind that if you are reading the source code, you'll have to take the
62
+ * transpose of any matrices outlined here to make sense of the calculations.
43
63
  */
44
64
  export class Matrix4 {
45
- static readonly isMatrix4: boolean;
46
-
47
- /**
48
- * Array with matrix values.
49
- * @default [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
50
- */
51
- elements: Matrix4Tuple;
52
-
53
65
  /**
54
- * Creates an identity matrix.
66
+ * Constructs a new 4x4 matrix. This constructor
67
+ * initializes the matrix as an identity matrix.
55
68
  */
56
69
  constructor();
57
70
  /**
58
- * Creates a 4x4 matrix with the given arguments in row-major order.
71
+ * Constructs a new 4x4 matrix. The arguments are supposed to be
72
+ * in row-major order.
73
+ *
74
+ * @param {number} [n11] - 1-1 matrix element.
75
+ * @param {number} [n12] - 1-2 matrix element.
76
+ * @param {number} [n13] - 1-3 matrix element.
77
+ * @param {number} [n14] - 1-4 matrix element.
78
+ * @param {number} [n21] - 2-1 matrix element.
79
+ * @param {number} [n22] - 2-2 matrix element.
80
+ * @param {number} [n23] - 2-3 matrix element.
81
+ * @param {number} [n24] - 2-4 matrix element.
82
+ * @param {number} [n31] - 3-1 matrix element.
83
+ * @param {number} [n32] - 3-2 matrix element.
84
+ * @param {number} [n33] - 3-3 matrix element.
85
+ * @param {number} [n34] - 3-4 matrix element.
86
+ * @param {number} [n41] - 4-1 matrix element.
87
+ * @param {number} [n42] - 4-2 matrix element.
88
+ * @param {number} [n43] - 4-3 matrix element.
89
+ * @param {number} [n44] - 4-4 matrix element.
59
90
  */
60
91
  constructor(
61
92
  n11: number,
@@ -75,9 +106,33 @@ export class Matrix4 {
75
106
  n43: number,
76
107
  n44: number,
77
108
  );
78
-
79
109
  /**
80
- * Sets all fields of this matrix.
110
+ * A column-major list of matrix values.
111
+ *
112
+ * @type {Array<number>}
113
+ */
114
+ elements: Matrix4Tuple;
115
+ /**
116
+ * Sets the elements of the matrix.The arguments are supposed to be
117
+ * in row-major order.
118
+ *
119
+ * @param {number} [n11] - 1-1 matrix element.
120
+ * @param {number} [n12] - 1-2 matrix element.
121
+ * @param {number} [n13] - 1-3 matrix element.
122
+ * @param {number} [n14] - 1-4 matrix element.
123
+ * @param {number} [n21] - 2-1 matrix element.
124
+ * @param {number} [n22] - 2-2 matrix element.
125
+ * @param {number} [n23] - 2-3 matrix element.
126
+ * @param {number} [n24] - 2-4 matrix element.
127
+ * @param {number} [n31] - 3-1 matrix element.
128
+ * @param {number} [n32] - 3-2 matrix element.
129
+ * @param {number} [n33] - 3-3 matrix element.
130
+ * @param {number} [n34] - 3-4 matrix element.
131
+ * @param {number} [n41] - 4-1 matrix element.
132
+ * @param {number} [n42] - 4-2 matrix element.
133
+ * @param {number} [n43] - 4-3 matrix element.
134
+ * @param {number} [n44] - 4-4 matrix element.
135
+ * @return {Matrix4} A reference to this matrix.
81
136
  */
82
137
  set(
83
138
  n11: number,
@@ -97,146 +152,303 @@ export class Matrix4 {
97
152
  n43: number,
98
153
  n44: number,
99
154
  ): this;
100
-
101
155
  /**
102
- * Resets this matrix to identity.
156
+ * Sets this matrix to the 4x4 identity matrix.
157
+ *
158
+ * @return {Matrix4} A reference to this matrix.
103
159
  */
104
160
  identity(): this;
105
-
161
+ /**
162
+ * Returns a matrix with copied values from this instance.
163
+ *
164
+ * @return {Matrix4} A clone of this instance.
165
+ */
106
166
  clone(): Matrix4;
107
-
167
+ /**
168
+ * Copies the values of the given matrix to this instance.
169
+ *
170
+ * @param {Matrix4} m - The matrix to copy.
171
+ * @return {Matrix4} A reference to this matrix.
172
+ */
108
173
  copy(m: Matrix4): this;
109
-
174
+ /**
175
+ * Copies the translation component of the given matrix
176
+ * into this matrix's translation component.
177
+ *
178
+ * @param {Matrix4} m - The matrix to copy the translation component.
179
+ * @return {Matrix4} A reference to this matrix.
180
+ */
110
181
  copyPosition(m: Matrix4): this;
111
-
112
182
  /**
113
- * Set the upper 3x3 elements of this matrix to the values of the Matrix3 m.
183
+ * Set the upper 3x3 elements of this matrix to the values of given 3x3 matrix.
184
+ *
185
+ * @param {Matrix3} m - The 3x3 matrix.
186
+ * @return {Matrix4} A reference to this matrix.
114
187
  */
115
188
  setFromMatrix3(m: Matrix3): this;
116
-
189
+ /**
190
+ * Extracts the basis of this matrix into the three axis vectors provided.
191
+ *
192
+ * @param {Vector3} xAxis - The basis's x axis.
193
+ * @param {Vector3} yAxis - The basis's y axis.
194
+ * @param {Vector3} zAxis - The basis's z axis.
195
+ * @return {Matrix4} A reference to this matrix.
196
+ */
117
197
  extractBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): this;
118
-
198
+ /**
199
+ * Sets the given basis vectors to this matrix.
200
+ *
201
+ * @param {Vector3} xAxis - The basis's x axis.
202
+ * @param {Vector3} yAxis - The basis's y axis.
203
+ * @param {Vector3} zAxis - The basis's z axis.
204
+ * @return {Matrix4} A reference to this matrix.
205
+ */
119
206
  makeBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): this;
120
-
121
207
  /**
122
- * Copies the rotation component of the supplied matrix m into this matrix rotation component.
208
+ * Extracts the rotation component of the given matrix
209
+ * into this matrix's rotation component.
210
+ *
211
+ * Note: This method does not support reflection matrices.
212
+ *
213
+ * @param {Matrix4} m - The matrix.
214
+ * @return {Matrix4} A reference to this matrix.
123
215
  */
124
216
  extractRotation(m: Matrix4): this;
125
-
217
+ /**
218
+ * Sets the rotation component (the upper left 3x3 matrix) of this matrix to
219
+ * the rotation specified by the given Euler angles. The rest of
220
+ * the matrix is set to the identity. Depending on the {@link Euler#order},
221
+ * there are six possible outcomes. See [this page](https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix)
222
+ * for a complete list.
223
+ *
224
+ * @param {Euler} euler - The Euler angles.
225
+ * @return {Matrix4} A reference to this matrix.
226
+ */
126
227
  makeRotationFromEuler(euler: Euler): this;
127
-
228
+ /**
229
+ * Sets the rotation component of this matrix to the rotation specified by
230
+ * the given Quaternion as outlined [here](https://en.wikipedia.org/wiki/Rotation_matrix#Quaternion)
231
+ * The rest of the matrix is set to the identity.
232
+ *
233
+ * @param {Quaternion} q - The Quaternion.
234
+ * @return {Matrix4} A reference to this matrix.
235
+ */
128
236
  makeRotationFromQuaternion(q: Quaternion): this;
129
-
130
237
  /**
131
- * Sets the rotation component of the transformation matrix, looking from [eye]{@link Vector3} towards
132
- * [target]{@link Vector3}, and oriented by the up-direction [up]{@link Vector3}.
238
+ * Sets the rotation component of the transformation matrix, looking from `eye` towards
239
+ * `target`, and oriented by the up-direction.
240
+ *
241
+ * @param {Vector3} eye - The eye vector.
242
+ * @param {Vector3} target - The target vector.
243
+ * @param {Vector3} up - The up vector.
244
+ * @return {Matrix4} A reference to this matrix.
133
245
  */
134
246
  lookAt(eye: Vector3, target: Vector3, up: Vector3): this;
135
-
136
247
  /**
137
- * Multiplies this matrix by m.
248
+ * Post-multiplies this matrix by the given 4x4 matrix.
249
+ *
250
+ * @param {Matrix4} m - The matrix to multiply with.
251
+ * @return {Matrix4} A reference to this matrix.
138
252
  */
139
253
  multiply(m: Matrix4): this;
140
-
254
+ /**
255
+ * Pre-multiplies this matrix by the given 4x4 matrix.
256
+ *
257
+ * @param {Matrix4} m - The matrix to multiply with.
258
+ * @return {Matrix4} A reference to this matrix.
259
+ */
141
260
  premultiply(m: Matrix4): this;
142
-
143
261
  /**
144
- * Sets this matrix to a x b.
262
+ * Multiples the given 4x4 matrices and stores the result
263
+ * in this matrix.
264
+ *
265
+ * @param {Matrix4} a - The first matrix.
266
+ * @param {Matrix4} b - The second matrix.
267
+ * @return {Matrix4} A reference to this matrix.
145
268
  */
146
269
  multiplyMatrices(a: Matrix4, b: Matrix4): this;
147
-
148
270
  /**
149
- * Multiplies this matrix by s.
271
+ * Multiplies every component of the matrix by the given scalar.
272
+ *
273
+ * @param {number} s - The scalar.
274
+ * @return {Matrix4} A reference to this matrix.
150
275
  */
151
276
  multiplyScalar(s: number): this;
152
-
153
277
  /**
154
- * Computes determinant of this matrix.
155
- * Based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm
278
+ * Computes and returns the determinant of this matrix.
279
+ *
280
+ * Based on the method outlined [here](http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.html).
281
+ *
282
+ * @return {number} The determinant.
156
283
  */
157
284
  determinant(): number;
158
-
159
285
  /**
160
- * Transposes this matrix.
286
+ * Computes and returns the determinant of the 4x4 matrix, but assumes the
287
+ * matrix is affine, saving some computations.
288
+ *
289
+ * For affine matrices (like an object's world matrix), this value equals the
290
+ * full 4x4 {@link Matrix4#determinant} but is cheaper to compute.
291
+ *
292
+ * Assumes the bottom row is [0, 0, 0, 1].
293
+ *
294
+ * @return {number} The determinant of the matrix.
295
+ */
296
+ determinantAffine(): number;
297
+ /**
298
+ * Transposes this matrix in place.
299
+ *
300
+ * @return {Matrix4} A reference to this matrix.
161
301
  */
162
302
  transpose(): this;
163
-
164
303
  /**
165
- * Sets the position component for this matrix from vector v.
304
+ * Sets the position component for this matrix from the given vector,
305
+ * without affecting the rest of the matrix.
306
+ *
307
+ * @param {number|Vector3} v - The vector object.
308
+ * @return {Matrix4} A reference to this matrix.
166
309
  */
167
310
  setPosition(v: Vector3): this;
311
+ /**
312
+ * Sets the position component for this matrix from the given vector,
313
+ * without affecting the rest of the matrix.
314
+ *
315
+ * @param {number} x - The x component of the vector.
316
+ * @param {number} y - The y component of the vector.
317
+ * @param {number} z - The z component of the vector.
318
+ * @return {Matrix4} A reference to this matrix.
319
+ */
168
320
  setPosition(x: number, y: number, z: number): this;
169
-
170
321
  /**
171
- * Inverts this matrix.
322
+ * Inverts this matrix, using the [analytic method](https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution).
323
+ * You can not invert with a determinant of zero. If you attempt this, the method produces
324
+ * a zero matrix instead.
325
+ *
326
+ * @return {Matrix4} A reference to this matrix.
172
327
  */
173
328
  invert(): this;
174
-
175
329
  /**
176
- * Multiplies the columns of this matrix by vector v.
330
+ * Multiplies the columns of this matrix by the given vector.
331
+ *
332
+ * @param {Vector3} v - The scale vector.
333
+ * @return {Matrix4} A reference to this matrix.
177
334
  */
178
335
  scale(v: Vector3): this;
179
-
336
+ /**
337
+ * Gets the maximum scale value of the three axes.
338
+ *
339
+ * @return {number} The maximum scale.
340
+ */
180
341
  getMaxScaleOnAxis(): number;
181
-
182
342
  /**
183
- * Sets this matrix as translation transform.
343
+ * Sets this matrix as a translation transform from the given vector.
344
+ *
345
+ * @param {Vector3} v - A translation vector.
346
+ * @return {Matrix4} A reference to this matrix.
184
347
  */
185
348
  makeTranslation(v: Vector3): this;
349
+ /**
350
+ * Sets this matrix as a translation transform from the given vector.
351
+ *
352
+ * @param {number} x - The amount to translate in the X axis.
353
+ * @param {number} y - The amount to translate in the Y axis.
354
+ * @param {number} z - The amount to translate in the z axis.
355
+ * @return {Matrix4} A reference to this matrix.
356
+ */
186
357
  makeTranslation(x: number, y: number, z: number): this;
187
-
188
358
  /**
189
- * Sets this matrix as rotation transform around x axis by theta radians.
359
+ * Sets this matrix as a rotational transformation around the X axis by
360
+ * the given angle.
190
361
  *
191
- * @param theta Rotation angle in radians.
362
+ * @param {number} theta - The rotation in radians.
363
+ * @return {Matrix4} A reference to this matrix.
192
364
  */
193
365
  makeRotationX(theta: number): this;
194
-
195
366
  /**
196
- * Sets this matrix as rotation transform around y axis by theta radians.
367
+ * Sets this matrix as a rotational transformation around the Y axis by
368
+ * the given angle.
197
369
  *
198
- * @param theta Rotation angle in radians.
370
+ * @param {number} theta - The rotation in radians.
371
+ * @return {Matrix4} A reference to this matrix.
199
372
  */
200
373
  makeRotationY(theta: number): this;
201
-
202
374
  /**
203
- * Sets this matrix as rotation transform around z axis by theta radians.
375
+ * Sets this matrix as a rotational transformation around the Z axis by
376
+ * the given angle.
204
377
  *
205
- * @param theta Rotation angle in radians.
378
+ * @param {number} theta - The rotation in radians.
379
+ * @return {Matrix4} A reference to this matrix.
206
380
  */
207
381
  makeRotationZ(theta: number): this;
208
-
209
382
  /**
210
- * Sets this matrix as rotation transform around axis by angle radians.
211
- * Based on http://www.gamedev.net/reference/articles/article1199.asp.
383
+ * Sets this matrix as a rotational transformation around the given axis by
384
+ * the given angle.
385
+ *
386
+ * This is a somewhat controversial but mathematically sound alternative to
387
+ * rotating via Quaternions. See the discussion [here](https://www.gamedev.net/articles/programming/math-and-physics/do-we-really-need-quaternions-r1199).
212
388
  *
213
- * @param axis Rotation axis.
214
- * @param angle Rotation angle in radians.
389
+ * @param {Vector3} axis - The normalized rotation axis.
390
+ * @param {number} angle - The rotation in radians.
391
+ * @return {Matrix4} A reference to this matrix.
215
392
  */
216
393
  makeRotationAxis(axis: Vector3, angle: number): this;
217
-
218
394
  /**
219
- * Sets this matrix as scale transform.
395
+ * Sets this matrix as a scale transformation.
396
+ *
397
+ * @param {number} x - The amount to scale in the X axis.
398
+ * @param {number} y - The amount to scale in the Y axis.
399
+ * @param {number} z - The amount to scale in the Z axis.
400
+ * @return {Matrix4} A reference to this matrix.
220
401
  */
221
402
  makeScale(x: number, y: number, z: number): this;
222
-
223
403
  /**
224
- * Sets this matrix as shear transform.
404
+ * Sets this matrix as a shear transformation.
405
+ *
406
+ * @param {number} xy - The amount to shear X by Y.
407
+ * @param {number} xz - The amount to shear X by Z.
408
+ * @param {number} yx - The amount to shear Y by X.
409
+ * @param {number} yz - The amount to shear Y by Z.
410
+ * @param {number} zx - The amount to shear Z by X.
411
+ * @param {number} zy - The amount to shear Z by Y.
412
+ * @return {Matrix4} A reference to this matrix.
225
413
  */
226
414
  makeShear(xy: number, xz: number, yx: number, yz: number, zx: number, zy: number): this;
227
-
228
415
  /**
229
- * Sets this matrix to the transformation composed of translation, rotation and scale.
416
+ * Sets this matrix to the transformation composed of the given position,
417
+ * rotation (Quaternion) and scale.
418
+ *
419
+ * @param {Vector3} position - The position vector.
420
+ * @param {Quaternion} quaternion - The rotation as a Quaternion.
421
+ * @param {Vector3} scale - The scale vector.
422
+ * @return {Matrix4} A reference to this matrix.
230
423
  */
231
424
  compose(position: Vector3, quaternion: Quaternion, scale: Vector3): this;
232
-
233
425
  /**
234
- * Decomposes this matrix into it's position, quaternion and scale components.
426
+ * Decomposes this matrix into its position, rotation and scale components
427
+ * and provides the result in the given objects.
428
+ *
429
+ * Note: Not all matrices are decomposable in this way. For example, if an
430
+ * object has a non-uniformly scaled parent, then the object's world matrix
431
+ * may not be decomposable, and this method may not be appropriate.
432
+ *
433
+ * @param {Vector3} position - The position vector.
434
+ * @param {Quaternion} quaternion - The rotation as a Quaternion.
435
+ * @param {Vector3} scale - The scale vector.
436
+ * @return {Matrix4} A reference to this matrix.
235
437
  */
236
438
  decompose(position: Vector3, quaternion: Quaternion, scale: Vector3): this;
237
-
238
439
  /**
239
- * Creates a perspective projection matrix.
440
+ * Creates a perspective projection matrix. This is used internally by
441
+ * {@link PerspectiveCamera#updateProjectionMatrix}.
442
+
443
+ * @param {number} left - Left boundary of the viewing frustum at the near plane.
444
+ * @param {number} right - Right boundary of the viewing frustum at the near plane.
445
+ * @param {number} top - Top boundary of the viewing frustum at the near plane.
446
+ * @param {number} bottom - Bottom boundary of the viewing frustum at the near plane.
447
+ * @param {number} near - The distance from the camera to the near plane.
448
+ * @param {number} far - The distance from the camera to the far plane.
449
+ * @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} [coordinateSystem=WebGLCoordinateSystem] - The coordinate system.
450
+ * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.
451
+ * @return {Matrix4} A reference to this matrix.
240
452
  */
241
453
  makePerspective(
242
454
  left: number,
@@ -248,9 +460,19 @@ export class Matrix4 {
248
460
  coordinateSystem?: CoordinateSystem,
249
461
  reversedDepth?: boolean,
250
462
  ): this;
251
-
252
463
  /**
253
- * Creates an orthographic projection matrix.
464
+ * Creates a orthographic projection matrix. This is used internally by
465
+ * {@link OrthographicCamera#updateProjectionMatrix}.
466
+
467
+ * @param {number} left - Left boundary of the viewing frustum at the near plane.
468
+ * @param {number} right - Right boundary of the viewing frustum at the near plane.
469
+ * @param {number} top - Top boundary of the viewing frustum at the near plane.
470
+ * @param {number} bottom - Bottom boundary of the viewing frustum at the near plane.
471
+ * @param {number} near - The distance from the camera to the near plane.
472
+ * @param {number} far - The distance from the camera to the far plane.
473
+ * @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} [coordinateSystem=WebGLCoordinateSystem] - The coordinate system.
474
+ * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.
475
+ * @return {Matrix4} A reference to this matrix.
254
476
  */
255
477
  makeOrthographic(
256
478
  left: number,
@@ -262,26 +484,28 @@ export class Matrix4 {
262
484
  coordinateSystem?: CoordinateSystem,
263
485
  reversedDepth?: boolean,
264
486
  ): this;
265
-
266
- equals(matrix: Matrix4): boolean;
267
-
268
487
  /**
269
- * Sets the values of this matrix from the provided array or array-like.
270
- * @param array the source array or array-like.
271
- * @param offset (optional) offset into the array-like. Default is 0.
488
+ * Returns `true` if this matrix is equal with the given one.
489
+ *
490
+ * @param {Matrix4} matrix - The matrix to test for equality.
491
+ * @return {boolean} Whether this matrix is equal with the given one.
272
492
  */
273
- fromArray(array: ArrayLike<number>, offset?: number): this;
274
-
493
+ equals(matrix: Matrix4): boolean;
275
494
  /**
276
- * Writes the elements of this matrix to an array in
277
- * {@link https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major} format.
495
+ * Sets the elements of the matrix from the given array.
496
+ *
497
+ * @param {Array<number>} array - The matrix elements in column-major order.
498
+ * @param {number} [offset=0] - Index of the first element in the array.
499
+ * @return {Matrix4} A reference to this matrix.
278
500
  */
279
- toArray(): Matrix4Tuple;
501
+ fromArray(array: ArrayLike<number>, offset?: number): this;
280
502
  /**
281
- * Writes the elements of this matrix to an array in
282
- * {@link https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major} format.
283
- * @param array array to store the resulting vector in.
284
- * @param offset (optional) offset in the array at which to put the result.
503
+ * Writes the elements of this matrix to the given array. If no array is provided,
504
+ * the method returns a new instance.
505
+ *
506
+ * @param {Array<number>} [array=[]] - The target array holding the matrix elements in column-major order.
507
+ * @param {number} [offset=0] - Index of the first element in the array.
508
+ * @return {Array<number>} The matrix elements in column-major order.
285
509
  */
286
- toArray<TArray extends ArrayLike<number>>(array: TArray, offset?: number): TArray;
510
+ toArray<TArray extends ArrayLike<number> = Matrix4Tuple>(array?: TArray, offset?: number): TArray;
287
511
  }
@@ -12,8 +12,6 @@ export interface Vector2Like {
12
12
  * 2D vector.
13
13
  */
14
14
  export class Vector2 {
15
- static readonly isVector2: boolean;
16
-
17
15
  constructor(x?: number, y?: number);
18
16
 
19
17
  /**
@@ -27,6 +25,7 @@ export class Vector2 {
27
25
  y: number;
28
26
  width: number;
29
27
  height: number;
28
+ readonly isVector2: true;
30
29
 
31
30
  /**
32
31
  * Sets value of this vector.
@@ -29,8 +29,6 @@ export interface Vector3Like {
29
29
  * c.crossVectors( a, b );
30
30
  */
31
31
  export class Vector3 {
32
- static readonly isVector3: boolean;
33
-
34
32
  constructor(x?: number, y?: number, z?: number);
35
33
 
36
34
  /**
@@ -47,11 +45,12 @@ export class Vector3 {
47
45
  * @default 0
48
46
  */
49
47
  z: number;
48
+ readonly isVector3: true;
50
49
 
51
50
  /**
52
51
  * Sets value of this vector.
53
52
  */
54
- set(x: number, y: number, z: number): this;
53
+ set(x: number, y: number, z?: number): this;
55
54
 
56
55
  /**
57
56
  * Sets all values of this vector.
@@ -217,7 +216,7 @@ export class Vector3 {
217
216
  crossVectors(a: Vector3Like, b: Vector3Like): this;
218
217
  projectOnVector(v: Vector3): this;
219
218
  projectOnPlane(planeNormal: Vector3): this;
220
- reflect(vector: Vector3Like): this;
219
+ reflect(normal: Vector3Like): this;
221
220
  angleTo(v: Vector3): number;
222
221
 
223
222
  /**
@@ -15,8 +15,6 @@ export interface Vector4Like {
15
15
  * 4D vector.
16
16
  */
17
17
  export class Vector4 {
18
- static readonly isVector4: boolean;
19
-
20
18
  constructor(x?: number, y?: number, z?: number, w?: number);
21
19
 
22
20
  /**
@@ -41,6 +39,7 @@ export class Vector4 {
41
39
 
42
40
  width: number;
43
41
  height: number;
42
+ readonly isVector4: true;
44
43
 
45
44
  /**
46
45
  * Sets value of this vector.
@@ -1,7 +1,23 @@
1
+ import { TypedArray } from "../../core/BufferAttribute.js";
1
2
  import { Interpolant } from "../Interpolant.js";
2
3
 
4
+ /**
5
+ * A Bezier interpolant using cubic Bezier curves with 2D control points.
6
+ *
7
+ * This interpolant supports the COLLADA/Maya style of Bezier animation where
8
+ * each keyframe has explicit in/out tangent control points specified as
9
+ * 2D coordinates (time, value).
10
+ *
11
+ * Tangent data is read from `inTangents` and `outTangents` on the interpolant
12
+ * (populated by `KeyframeTrack.InterpolantFactoryMethodBezier`).
13
+ *
14
+ * For a track with N keyframes and stride S:
15
+ * - Each tangent array has N * S * 2 values
16
+ * - Layout: [k0_c0_time, k0_c0_value, k0_c1_time, k0_c1_value, ..., k0_cS_time, k0_cS_value,
17
+ * k1_c0_time, k1_c0_value, ...]
18
+ *
19
+ * @augments Interpolant
20
+ */
3
21
  export class BezierInterpolant extends Interpolant {
4
- constructor(parameterPositions: any, samplesValues: any, sampleSize: number, resultBuffer?: any);
5
-
6
- interpolate_(i1: number, t0: number, t: number, t1: number): any;
22
+ interpolate_(i1: number, t0: number, t: number, t1: number): TypedArray;
7
23
  }