@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
@@ -9,6 +9,13 @@ export interface ShadowMaterialParameters extends MaterialParameters {
9
9
  export class ShadowMaterial extends Material {
10
10
  constructor(parameters?: ShadowMaterialParameters);
11
11
 
12
+ /**
13
+ * Read-only flag to check if a given object is of type {@link ShadowMaterial}.
14
+ * @remarks This is a _constant_ value
15
+ * @defaultValue `true`
16
+ */
17
+ readonly isShadowMaterial: true;
18
+
12
19
  /**
13
20
  * @default 'ShadowMaterial'
14
21
  */
@@ -13,6 +13,13 @@ export interface SpriteMaterialParameters extends MaterialParameters {
13
13
 
14
14
  export class SpriteMaterial extends Material {
15
15
  constructor(parameters?: SpriteMaterialParameters);
16
+ /**
17
+ * Read-only flag to check if a given object is of type {@link SpriteMaterial}.
18
+ * @remarks This is a _constant_ value
19
+ * @defaultValue `true`
20
+ */
21
+ readonly isSpriteMaterial: true;
22
+
16
23
  /**
17
24
  * @default 'SpriteMaterial'
18
25
  */
@@ -54,8 +61,6 @@ export class SpriteMaterial extends Material {
54
61
  */
55
62
  fog: boolean;
56
63
 
57
- readonly isSpriteMaterial: true;
58
-
59
64
  setValues(parameters: SpriteMaterialParameters): void;
60
65
  copy(source: SpriteMaterial): this;
61
66
  }
three/src/math/Color.d.ts CHANGED
@@ -255,7 +255,7 @@ export class Color {
255
255
  * Copies given color.
256
256
  * @param color Color to copy.
257
257
  */
258
- copy(color: Color): this;
258
+ copy(color: this): this;
259
259
 
260
260
  /**
261
261
  * Copies given color making conversion from sRGB to linear space.
@@ -94,40 +94,40 @@ export class Matrix4 implements Matrix {
94
94
  n42: number,
95
95
  n43: number,
96
96
  n44: number,
97
- ): Matrix4;
97
+ ): this;
98
98
 
99
99
  /**
100
100
  * Resets this matrix to identity.
101
101
  */
102
- identity(): Matrix4;
102
+ identity(): this;
103
103
  clone(): Matrix4;
104
104
  copy(m: Matrix4): this;
105
- copyPosition(m: Matrix4): Matrix4;
106
- extractBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): Matrix4;
107
- makeBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): Matrix4;
105
+ copyPosition(m: Matrix4): this;
106
+ extractBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): this;
107
+ makeBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): this;
108
108
 
109
109
  /**
110
110
  * Copies the rotation component of the supplied matrix m into this matrix rotation component.
111
111
  */
112
- extractRotation(m: Matrix4): Matrix4;
113
- makeRotationFromEuler(euler: Euler): Matrix4;
114
- makeRotationFromQuaternion(q: Quaternion): Matrix4;
112
+ extractRotation(m: Matrix4): this;
113
+ makeRotationFromEuler(euler: Euler): this;
114
+ makeRotationFromQuaternion(q: Quaternion): this;
115
115
  /**
116
116
  * Constructs a rotation matrix, looking from eye towards center with defined up vector.
117
117
  */
118
- lookAt(eye: Vector3, target: Vector3, up: Vector3): Matrix4;
118
+ lookAt(eye: Vector3, target: Vector3, up: Vector3): this;
119
119
 
120
120
  /**
121
121
  * Multiplies this matrix by m.
122
122
  */
123
- multiply(m: Matrix4): Matrix4;
123
+ multiply(m: Matrix4): this;
124
124
 
125
- premultiply(m: Matrix4): Matrix4;
125
+ premultiply(m: Matrix4): this;
126
126
 
127
127
  /**
128
128
  * Sets this matrix to a x b.
129
129
  */
130
- multiplyMatrices(a: Matrix4, b: Matrix4): Matrix4;
130
+ multiplyMatrices(a: Matrix4, b: Matrix4): this;
131
131
 
132
132
  /**
133
133
  * Sets this matrix to a x b and stores the result into the flat array r.
@@ -140,7 +140,7 @@ export class Matrix4 implements Matrix {
140
140
  /**
141
141
  * Multiplies this matrix by s.
142
142
  */
143
- multiplyScalar(s: number): Matrix4;
143
+ multiplyScalar(s: number): this;
144
144
 
145
145
  /**
146
146
  * Computes determinant of this matrix.
@@ -151,23 +151,23 @@ export class Matrix4 implements Matrix {
151
151
  /**
152
152
  * Transposes this matrix.
153
153
  */
154
- transpose(): Matrix4;
154
+ transpose(): this;
155
155
 
156
156
  /**
157
157
  * Sets the position component for this matrix from vector v.
158
158
  */
159
- setPosition(v: Vector3): Matrix4;
160
- setPosition(x: number, y: number, z: number): Matrix4;
159
+ setPosition(v: Vector3): this;
160
+ setPosition(x: number, y: number, z: number): this;
161
161
 
162
162
  /**
163
163
  * Inverts this matrix.
164
164
  */
165
- invert(): Matrix4;
165
+ invert(): this;
166
166
 
167
167
  /**
168
168
  * Multiplies the columns of this matrix by vector v.
169
169
  */
170
- scale(v: Vector3): Matrix4;
170
+ scale(v: Vector3): this;
171
171
 
172
172
  getMaxScaleOnAxis(): number;
173
173
  /**
@@ -181,21 +181,21 @@ export class Matrix4 implements Matrix {
181
181
  *
182
182
  * @param theta Rotation angle in radians.
183
183
  */
184
- makeRotationX(theta: number): Matrix4;
184
+ makeRotationX(theta: number): this;
185
185
 
186
186
  /**
187
187
  * Sets this matrix as rotation transform around y axis by theta radians.
188
188
  *
189
189
  * @param theta Rotation angle in radians.
190
190
  */
191
- makeRotationY(theta: number): Matrix4;
191
+ makeRotationY(theta: number): this;
192
192
 
193
193
  /**
194
194
  * Sets this matrix as rotation transform around z axis by theta radians.
195
195
  *
196
196
  * @param theta Rotation angle in radians.
197
197
  */
198
- makeRotationZ(theta: number): Matrix4;
198
+ makeRotationZ(theta: number): this;
199
199
 
200
200
  /**
201
201
  * Sets this matrix as rotation transform around axis by angle radians.
@@ -204,27 +204,27 @@ export class Matrix4 implements Matrix {
204
204
  * @param axis Rotation axis.
205
205
  * @param theta Rotation angle in radians.
206
206
  */
207
- makeRotationAxis(axis: Vector3, angle: number): Matrix4;
207
+ makeRotationAxis(axis: Vector3, angle: number): this;
208
208
 
209
209
  /**
210
210
  * Sets this matrix as scale transform.
211
211
  */
212
- makeScale(x: number, y: number, z: number): Matrix4;
212
+ makeScale(x: number, y: number, z: number): this;
213
213
 
214
214
  /**
215
215
  * Sets this matrix as shear transform.
216
216
  */
217
- makeShear(xy: number, xz: number, yx: number, yz: number, zx: number, zy: number): Matrix4;
217
+ makeShear(xy: number, xz: number, yx: number, yz: number, zx: number, zy: number): this;
218
218
 
219
219
  /**
220
220
  * Sets this matrix to the transformation composed of translation, rotation and scale.
221
221
  */
222
- compose(translation: Vector3, rotation: Quaternion, scale: Vector3): Matrix4;
222
+ compose(translation: Vector3, rotation: Quaternion, scale: Vector3): this;
223
223
 
224
224
  /**
225
225
  * Decomposes this matrix into it's position, quaternion and scale components.
226
226
  */
227
- decompose(translation: Vector3, rotation: Quaternion, scale: Vector3): Matrix4;
227
+ decompose(translation: Vector3, rotation: Quaternion, scale: Vector3): this;
228
228
 
229
229
  /**
230
230
  * Creates a perspective projection matrix.
@@ -237,7 +237,7 @@ export class Matrix4 implements Matrix {
237
237
  near: number,
238
238
  far: number,
239
239
  coordinateSystem?: CoordinateSystem,
240
- ): Matrix4;
240
+ ): this;
241
241
 
242
242
  /**
243
243
  * Creates an orthographic projection matrix.
@@ -250,7 +250,7 @@ export class Matrix4 implements Matrix {
250
250
  near: number,
251
251
  far: number,
252
252
  coordinateSystem?: CoordinateSystem,
253
- ): Matrix4;
253
+ ): this;
254
254
  equals(matrix: Matrix4): boolean;
255
255
 
256
256
  /**
@@ -258,7 +258,7 @@ export class Matrix4 implements Matrix {
258
258
  * @param array the source array or array-like.
259
259
  * @param offset (optional) offset into the array-like. Default is 0.
260
260
  */
261
- fromArray(array: number[] | ArrayLike<number>, offset?: number): Matrix4;
261
+ fromArray(array: number[] | ArrayLike<number>, offset?: number): this;
262
262
 
263
263
  /**
264
264
  * Returns an array with the values of this matrix, or copies them into the provided array.
@@ -280,7 +280,7 @@ export class Matrix4 implements Matrix {
280
280
  /**
281
281
  * Set the upper 3x3 elements of this matrix to the values of the Matrix3 m.
282
282
  */
283
- setFromMatrix3(m: Matrix3): Matrix4;
283
+ setFromMatrix3(m: Matrix3): this;
284
284
 
285
285
  /**
286
286
  * @deprecated Use {@link Matrix4#copyPosition .copyPosition()} instead.
@@ -1,9 +1,16 @@
1
1
  import { Euler } from './Euler.js';
2
- import { Vector3 } from './Vector3.js';
2
+ import { Vector3, Vector3Like } from './Vector3.js';
3
3
  import { Matrix4 } from './Matrix4.js';
4
4
  import { BufferAttribute } from '../core/BufferAttribute.js';
5
5
  import { InterleavedBufferAttribute } from '../core/InterleavedBufferAttribute.js';
6
6
 
7
+ export interface QuaternionLike {
8
+ readonly x: number;
9
+ readonly y: number;
10
+ readonly z: number;
11
+ readonly w: number;
12
+ }
13
+
7
14
  /**
8
15
  * Implementation of a quaternion. This is used for rotating things without incurring in the dreaded gimbal lock issue, amongst other advantages.
9
16
  *
@@ -46,7 +53,7 @@ export class Quaternion {
46
53
  /**
47
54
  * Sets values of this quaternion.
48
55
  */
49
- set(x: number, y: number, z: number, w: number): Quaternion;
56
+ set(x: number, y: number, z: number, w: number): this;
50
57
 
51
58
  /**
52
59
  * Clones this quaternion.
@@ -56,36 +63,36 @@ export class Quaternion {
56
63
  /**
57
64
  * Copies values of q to this quaternion.
58
65
  */
59
- copy(q: Quaternion): this;
66
+ copy(q: QuaternionLike): this;
60
67
 
61
68
  /**
62
69
  * Sets this quaternion from rotation specified by Euler angles.
63
70
  */
64
- setFromEuler(euler: Euler, update?: boolean): Quaternion;
71
+ setFromEuler(euler: Euler, update?: boolean): this;
65
72
 
66
73
  /**
67
74
  * Sets this quaternion from rotation specified by axis and angle.
68
75
  * Adapted from http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm.
69
76
  * Axis have to be normalized, angle is in radians.
70
77
  */
71
- setFromAxisAngle(axis: Vector3, angle: number): Quaternion;
78
+ setFromAxisAngle(axis: Vector3Like, angle: number): this;
72
79
 
73
80
  /**
74
81
  * Sets this quaternion from rotation component of m. Adapted from http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm.
75
82
  */
76
- setFromRotationMatrix(m: Matrix4): Quaternion;
77
- setFromUnitVectors(vFrom: Vector3, vTo: Vector3): Quaternion;
83
+ setFromRotationMatrix(m: Matrix4): this;
84
+ setFromUnitVectors(vFrom: Vector3, vTo: Vector3Like): this;
78
85
  angleTo(q: Quaternion): number;
79
- rotateTowards(q: Quaternion, step: number): Quaternion;
86
+ rotateTowards(q: Quaternion, step: number): this;
80
87
 
81
- identity(): Quaternion;
88
+ identity(): this;
82
89
 
83
90
  /**
84
91
  * Inverts this quaternion.
85
92
  */
86
- invert(): Quaternion;
93
+ invert(): this;
87
94
 
88
- conjugate(): Quaternion;
95
+ conjugate(): this;
89
96
  dot(v: Quaternion): number;
90
97
  lengthSq(): number;
91
98
 
@@ -97,22 +104,22 @@ export class Quaternion {
97
104
  /**
98
105
  * Normalizes this quaternion.
99
106
  */
100
- normalize(): Quaternion;
107
+ normalize(): this;
101
108
 
102
109
  /**
103
110
  * Multiplies this quaternion by b.
104
111
  */
105
- multiply(q: Quaternion): Quaternion;
106
- premultiply(q: Quaternion): Quaternion;
112
+ multiply(q: Quaternion): this;
113
+ premultiply(q: Quaternion): this;
107
114
 
108
115
  /**
109
116
  * Sets this quaternion to a x b
110
117
  * Adapted from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm.
111
118
  */
112
- multiplyQuaternions(a: Quaternion, b: Quaternion): Quaternion;
119
+ multiplyQuaternions(a: Quaternion, b: Quaternion): this;
113
120
 
114
- slerp(qb: Quaternion, t: number): Quaternion;
115
- slerpQuaternions(qa: Quaternion, qb: Quaternion, t: number): Quaternion;
121
+ slerp(qb: Quaternion, t: number): this;
122
+ slerpQuaternions(qa: Quaternion, qb: Quaternion, t: number): this;
116
123
  equals(v: Quaternion): boolean;
117
124
 
118
125
  /**
@@ -149,9 +156,9 @@ export class Quaternion {
149
156
  * @param attribute the source attribute.
150
157
  * @param index index in the attribute.
151
158
  */
152
- fromBufferAttribute(attribute: BufferAttribute | InterleavedBufferAttribute, index: number): Quaternion;
159
+ fromBufferAttribute(attribute: BufferAttribute | InterleavedBufferAttribute, index: number): this;
153
160
 
154
- _onChange(callback: () => void): Quaternion;
161
+ _onChange(callback: () => void): this;
155
162
  _onChangeCallback: () => void;
156
163
 
157
164
  static slerpFlat(
@@ -173,17 +180,7 @@ export class Quaternion {
173
180
  stcOffset1: number,
174
181
  ): number[];
175
182
 
176
- /**
177
- * @deprecated Use qm.slerpQuaternions( qa, qb, t ) instead..
178
- */
179
- static slerp(qa: Quaternion, qb: Quaternion, qm: Quaternion, t: number): number;
180
-
181
- /**
182
- * @deprecated Use {@link Vector#applyQuaternion vector.applyQuaternion( quaternion )} instead.
183
- */
184
- multiplyVector3(v: any): any;
185
-
186
- random(): Quaternion;
183
+ random(): this;
187
184
 
188
185
  [Symbol.iterator](): Generator<number, void>;
189
186
  }
@@ -6,6 +6,11 @@ import { Matrix4 } from './Matrix4.js';
6
6
  export class Sphere {
7
7
  constructor(center?: Vector3, radius?: number);
8
8
 
9
+ /**
10
+ * Read-only flag to check if a given object is of type {@link Sphere}.
11
+ */
12
+ readonly isSphere: true;
13
+
9
14
  /**
10
15
  * @default new Vector3()
11
16
  */
@@ -39,14 +39,10 @@ export class Triangle {
39
39
  getMidpoint(target: Vector3): Vector3;
40
40
  getNormal(target: Vector3): Vector3;
41
41
  getPlane(target: Plane): Plane;
42
- getBarycoord(point: Vector3, target: Vector3): Vector3;
43
- /**
44
- * @deprecated Triangle.getUV() has been renamed to Triangle.getInterpolation().
45
- */
46
- getUV(point: Vector3, uv1: Vector2, uv2: Vector2, uv3: Vector2, target: Vector2): Vector2;
47
- getInterpolation(point: Vector3, v1: Vector2, v2: Vector2, v3: Vector2, target: Vector2): Vector2;
48
- getInterpolation(point: Vector3, v1: Vector3, v2: Vector3, v3: Vector3, target: Vector3): Vector3;
49
- getInterpolation(point: Vector3, v1: Vector4, v2: Vector4, v3: Vector4, target: Vector4): Vector4;
42
+ getBarycoord(point: Vector3, target: Vector3): Vector3 | null;
43
+ getInterpolation(point: Vector3, v1: Vector2, v2: Vector2, v3: Vector2, target: Vector2): Vector2 | null;
44
+ getInterpolation(point: Vector3, v1: Vector3, v2: Vector3, v3: Vector3, target: Vector3): Vector3 | null;
45
+ getInterpolation(point: Vector3, v1: Vector4, v2: Vector4, v3: Vector4, target: Vector4): Vector4 | null;
50
46
  containsPoint(point: Vector3): boolean;
51
47
  intersectsBox(box: Box3): boolean;
52
48
  isFrontFacing(direction: Vector3): boolean;
@@ -54,21 +50,8 @@ export class Triangle {
54
50
  equals(triangle: Triangle): boolean;
55
51
 
56
52
  static getNormal(a: Vector3, b: Vector3, c: Vector3, target: Vector3): Vector3;
57
- static getBarycoord(point: Vector3, a: Vector3, b: Vector3, c: Vector3, target: Vector3): Vector3;
53
+ static getBarycoord(point: Vector3, a: Vector3, b: Vector3, c: Vector3, target: Vector3): Vector3 | null;
58
54
  static containsPoint(point: Vector3, a: Vector3, b: Vector3, c: Vector3): boolean;
59
- /**
60
- * @deprecated THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation().
61
- */
62
- static getUV(
63
- point: Vector3,
64
- p1: Vector3,
65
- p2: Vector3,
66
- p3: Vector3,
67
- uv1: Vector2,
68
- uv2: Vector2,
69
- uv3: Vector2,
70
- target: Vector2,
71
- ): Vector2;
72
55
  static getInterpolation(
73
56
  point: Vector3,
74
57
  p1: Vector3,
@@ -78,7 +61,7 @@ export class Triangle {
78
61
  v2: Vector2,
79
62
  v3: Vector2,
80
63
  target: Vector2,
81
- ): Vector2;
64
+ ): Vector2 | null;
82
65
  static getInterpolation(
83
66
  point: Vector3,
84
67
  p1: Vector3,
@@ -88,7 +71,7 @@ export class Triangle {
88
71
  v2: Vector3,
89
72
  v3: Vector3,
90
73
  target: Vector3,
91
- ): Vector3;
74
+ ): Vector3 | null;
92
75
  static getInterpolation(
93
76
  point: Vector3,
94
77
  p1: Vector3,
@@ -98,6 +81,6 @@ export class Triangle {
98
81
  v2: Vector4,
99
82
  v3: Vector4,
100
83
  target: Vector4,
101
- ): Vector4;
84
+ ): Vector4 | null;
102
85
  static isFrontFacing(a: Vector3, b: Vector3, c: Vector3, direction: Vector3): boolean;
103
86
  }