@types/three 0.144.0 → 0.147.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 (100) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/animation/CCDIKSolver.d.ts +9 -4
  3. three/examples/jsm/animation/MMDPhysics.d.ts +6 -1
  4. three/examples/jsm/controls/OrbitControls.d.ts +198 -2
  5. three/examples/jsm/csm/CSMHelper.d.ts +1 -0
  6. three/examples/jsm/helpers/OctreeHelper.d.ts +3 -0
  7. three/examples/jsm/helpers/VertexNormalsHelper.d.ts +2 -0
  8. three/examples/jsm/helpers/VertexTangentsHelper.d.ts +2 -0
  9. three/examples/jsm/interactive/SelectionHelper.d.ts +1 -0
  10. three/examples/jsm/loaders/PCDLoader.d.ts +1 -1
  11. three/examples/jsm/loaders/PLYLoader.d.ts +2 -0
  12. three/examples/jsm/loaders/RGBELoader.d.ts +0 -1
  13. three/examples/jsm/loaders/USDZLoader.d.ts +18 -0
  14. three/examples/jsm/nodes/Nodes.d.ts +21 -2
  15. three/examples/jsm/nodes/accessors/BitangentNode.d.ts +18 -0
  16. three/examples/jsm/nodes/accessors/NormalNode.d.ts +1 -6
  17. three/examples/jsm/nodes/accessors/PositionNode.d.ts +2 -0
  18. three/examples/jsm/nodes/accessors/TangentNode.d.ts +18 -0
  19. three/examples/jsm/nodes/core/NodeBuilder.d.ts +8 -3
  20. three/examples/jsm/nodes/core/NodeVarying.d.ts +8 -0
  21. three/examples/jsm/nodes/core/constants.d.ts +13 -13
  22. three/examples/jsm/nodes/display/BlendModeNode.d.ts +32 -0
  23. three/examples/jsm/nodes/display/PosterizeNode.d.ts +8 -0
  24. three/examples/jsm/nodes/display/ViewportNode.d.ts +23 -0
  25. three/examples/jsm/nodes/materialx/MaterialXNodes.d.ts +94 -0
  26. three/examples/jsm/nodes/materialx/{functions/lib → lib}/mx_hsv.d.ts +1 -1
  27. three/examples/jsm/nodes/materialx/{functions/lib → lib}/mx_noise.d.ts +1 -1
  28. three/examples/jsm/nodes/math/MathNode.d.ts +1 -2
  29. three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +24 -2
  30. three/examples/jsm/nodes/shadernode/ShaderNodeElements.d.ts +38 -0
  31. three/examples/jsm/nodes/utils/EquirectUVNode.d.ts +6 -0
  32. three/examples/jsm/nodes/utils/RemapNode.d.ts +13 -0
  33. three/examples/jsm/nodes/utils/TimerNode.d.ts +6 -1
  34. three/examples/jsm/nodes/utils/TriplanarTexturesNode.d.ts +22 -0
  35. three/examples/jsm/objects/ShadowMesh.d.ts +6 -3
  36. three/examples/jsm/postprocessing/AdaptiveToneMappingPass.d.ts +2 -2
  37. three/examples/jsm/postprocessing/AfterimagePass.d.ts +3 -3
  38. three/examples/jsm/postprocessing/BloomPass.d.ts +3 -3
  39. three/examples/jsm/postprocessing/BokehPass.d.ts +2 -4
  40. three/examples/jsm/postprocessing/ClearPass.d.ts +1 -1
  41. three/examples/jsm/postprocessing/CubeTexturePass.d.ts +1 -1
  42. three/examples/jsm/postprocessing/DotScreenPass.d.ts +2 -2
  43. three/examples/jsm/postprocessing/EffectComposer.d.ts +2 -1
  44. three/examples/jsm/postprocessing/FilmPass.d.ts +2 -2
  45. three/examples/jsm/postprocessing/GlitchPass.d.ts +2 -2
  46. three/examples/jsm/postprocessing/HalftonePass.d.ts +2 -2
  47. three/examples/jsm/postprocessing/MaskPass.d.ts +1 -1
  48. three/examples/jsm/postprocessing/OutlinePass.d.ts +2 -2
  49. three/examples/jsm/postprocessing/Pass.d.ts +2 -0
  50. three/examples/jsm/postprocessing/RenderPass.d.ts +1 -1
  51. three/examples/jsm/postprocessing/RenderPixelatedPass.d.ts +28 -0
  52. three/examples/jsm/postprocessing/SAOPass.d.ts +2 -2
  53. three/examples/jsm/postprocessing/SMAAPass.d.ts +2 -2
  54. three/examples/jsm/postprocessing/SSAARenderPass.d.ts +2 -2
  55. three/examples/jsm/postprocessing/SSAOPass.d.ts +2 -2
  56. three/examples/jsm/postprocessing/SavePass.d.ts +2 -2
  57. three/examples/jsm/postprocessing/ShaderPass.d.ts +2 -2
  58. three/examples/jsm/postprocessing/TexturePass.d.ts +2 -2
  59. three/examples/jsm/postprocessing/UnrealBloomPass.d.ts +2 -2
  60. three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +5 -4
  61. three/examples/jsm/shaders/VelocityShader.d.ts +13 -0
  62. three/examples/jsm/utils/BufferGeometryUtils.d.ts +11 -0
  63. three/examples/jsm/utils/SceneUtils.d.ts +9 -1
  64. three/examples/jsm/webxr/OculusHandPointerModel.d.ts +2 -2
  65. three/index.d.ts +1 -1
  66. three/package.json +3 -3
  67. three/src/Three.d.ts +2 -0
  68. three/src/core/Object3D.d.ts +9 -1
  69. three/src/helpers/ArrowHelper.d.ts +4 -0
  70. three/src/helpers/Box3Helper.d.ts +2 -0
  71. three/src/helpers/BoxHelper.d.ts +2 -0
  72. three/src/helpers/GridHelper.d.ts +1 -4
  73. three/src/helpers/PlaneHelper.d.ts +2 -0
  74. three/src/helpers/PolarGridHelper.d.ts +2 -0
  75. three/src/helpers/SkeletonHelper.d.ts +2 -0
  76. three/src/lights/PointLight.d.ts +1 -1
  77. three/src/lights/SpotLight.d.ts +7 -1
  78. three/src/loaders/DataTextureLoader.d.ts +1 -1
  79. three/src/materials/MeshLambertMaterial.d.ts +1 -1
  80. three/src/math/ColorManagement.d.ts +11 -1
  81. three/src/math/Euler.d.ts +13 -11
  82. three/src/math/Matrix3.d.ts +46 -0
  83. three/src/math/Quaternion.d.ts +10 -1
  84. three/src/objects/LOD.d.ts +22 -2
  85. three/src/renderers/WebGL3DRenderTarget.d.ts +1 -1
  86. three/src/renderers/WebGLArrayRenderTarget.d.ts +1 -1
  87. three/src/renderers/WebGLCubeRenderTarget.d.ts +1 -1
  88. three/src/renderers/WebGLMultipleRenderTargets.d.ts +1 -1
  89. three/src/renderers/WebGLRenderTarget.d.ts +1 -1
  90. three/src/renderers/WebGLRenderer.d.ts +1 -5
  91. three/src/renderers/shaders/UniformsLib.d.ts +3 -2
  92. three/src/renderers/webgl/WebGLCapabilities.d.ts +1 -0
  93. three/src/renderers/webxr/WebXRController.d.ts +6 -1
  94. three/src/renderers/webxr/WebXRManager.d.ts +8 -0
  95. three/src/scenes/Scene.d.ts +16 -5
  96. three/src/textures/CanvasTexture.d.ts +2 -2
  97. three/src/textures/CompressedArrayTexture.d.ts +17 -0
  98. three/src/textures/Texture.d.ts +10 -2
  99. three/examples/jsm/nodes/core/NodeVary.d.ts +0 -6
  100. three/examples/jsm/shaders/PixelShader.d.ts +0 -11
@@ -12,7 +12,7 @@ import {
12
12
  Texture,
13
13
  } from '../../../src/Three';
14
14
 
15
- import { Pass } from './Pass';
15
+ import { Pass, FullScreenQuad } from './Pass';
16
16
 
17
17
  export class OutlinePass extends Pass {
18
18
  constructor(resolution: Vector2, scene: Scene, camera: Camera, selectedObjects?: Object3D[]);
@@ -48,7 +48,7 @@ export class OutlinePass extends Pass {
48
48
  materialCopy: ShaderMaterial;
49
49
  oldClearColor: Color;
50
50
  oldClearAlpha: number;
51
- fsQuad: object;
51
+ fsQuad: FullScreenQuad;
52
52
  tempPulseColor1: Color;
53
53
  tempPulseColor2: Color;
54
54
  textureMatrix: Matrix4;
@@ -15,6 +15,8 @@ export class Pass {
15
15
  deltaTime: number,
16
16
  maskActive: boolean,
17
17
  ): void;
18
+
19
+ dispose(): void;
18
20
  }
19
21
 
20
22
  export class FullScreenQuad {
@@ -1,6 +1,6 @@
1
1
  import { Scene, Camera, Material, Color } from '../../../src/Three';
2
2
 
3
- import { Pass } from './Pass';
3
+ import { Pass, FullScreenQuad } from './Pass';
4
4
 
5
5
  export class RenderPass extends Pass {
6
6
  constructor(scene: Scene, camera: Camera, overrideMaterial?: Material, clearColor?: Color, clearAlpha?: number);
@@ -0,0 +1,28 @@
1
+ import { Scene, Camera, ShaderMaterial, Vector2, MeshNormalMaterial, WebGLRenderTarget } from '../../../src/Three';
2
+
3
+ import { Pass, FullScreenQuad } from './Pass';
4
+
5
+ export interface RenderPixelatedPassParameters {
6
+ normalEdgeStrength?: number;
7
+ depthEdgeStrength?: number;
8
+ }
9
+
10
+ export class RenderPixelatedPass extends Pass {
11
+ constructor(pixelSize: number, scene: Scene, camera: Camera, options?: RenderPixelatedPassParameters);
12
+ pixelSize: number;
13
+ resolution: Vector2;
14
+ renderResolution: Vector2;
15
+
16
+ pixelatedMaterial: ShaderMaterial;
17
+ normalMaterial: MeshNormalMaterial;
18
+
19
+ fsQuad: FullScreenQuad;
20
+ scene: Scene;
21
+ camera: Camera;
22
+
23
+ normalEdgeStrength: RenderPixelatedPassParameters['normalEdgeStrength'];
24
+ depthEdgeStrength: RenderPixelatedPassParameters['depthEdgeStrength'];
25
+
26
+ beautyRenderTarget: WebGLRenderTarget;
27
+ normalRenderTarget: WebGLRenderTarget;
28
+ }
@@ -12,7 +12,7 @@ import {
12
12
  ColorRepresentation,
13
13
  } from '../../../src/Three';
14
14
 
15
- import { Pass } from './Pass';
15
+ import { Pass, FullScreenQuad } from './Pass';
16
16
 
17
17
  export enum OUTPUT {
18
18
  Beauty,
@@ -57,7 +57,7 @@ export class SAOPass extends Pass {
57
57
  hBlurMaterial: ShaderMaterial;
58
58
  materialCopy: ShaderMaterial;
59
59
  depthCopy: ShaderMaterial;
60
- fsQuad: object;
60
+ fsQuad: FullScreenQuad;
61
61
  params: SAOPassParams;
62
62
 
63
63
  static OUTPUT: typeof OUTPUT;
@@ -1,6 +1,6 @@
1
1
  import { ShaderMaterial, Texture, WebGLRenderTarget } from '../../../src/Three';
2
2
 
3
- import { Pass } from './Pass';
3
+ import { Pass, FullScreenQuad } from './Pass';
4
4
 
5
5
  export class SMAAPass extends Pass {
6
6
  constructor(width: number, height: number);
@@ -14,7 +14,7 @@ export class SMAAPass extends Pass {
14
14
  materialWeights: ShaderMaterial;
15
15
  uniformsBlend: object;
16
16
  materialBlend: ShaderMaterial;
17
- fsQuad: object;
17
+ fsQuad: FullScreenQuad;
18
18
 
19
19
  getAreaTexture(): string;
20
20
  getSearchTexture(): string;
@@ -1,6 +1,6 @@
1
1
  import { Scene, Camera, ColorRepresentation, ShaderMaterial, WebGLRenderTarget } from '../../../src/Three';
2
2
 
3
- import { Pass } from './Pass';
3
+ import { Pass, FullScreenQuad } from './Pass';
4
4
 
5
5
  export class SSAARenderPass extends Pass {
6
6
  constructor(scene: Scene, camera: Camera, clearColor?: ColorRepresentation, clearAlpha?: number);
@@ -12,6 +12,6 @@ export class SSAARenderPass extends Pass {
12
12
  clearAlpha: number;
13
13
  copyUniforms: object;
14
14
  copyMaterial: ShaderMaterial;
15
- fsQuad: object;
15
+ fsQuad: FullScreenQuad;
16
16
  sampleRenderTarget: undefined | WebGLRenderTarget;
17
17
  }
@@ -12,7 +12,7 @@ import {
12
12
  ColorRepresentation,
13
13
  } from '../../../src/Three';
14
14
 
15
- import { Pass } from './Pass';
15
+ import { Pass, FullScreenQuad } from './Pass';
16
16
 
17
17
  export enum SSAOPassOUTPUT {
18
18
  Default,
@@ -46,7 +46,7 @@ export class SSAOPass extends Pass {
46
46
  blurMaterial: ShaderMaterial;
47
47
  depthRenderMaterial: ShaderMaterial;
48
48
  copyMaterial: ShaderMaterial;
49
- fsQuad: object;
49
+ fsQuad: FullScreenQuad;
50
50
  originalClearColor: Color;
51
51
 
52
52
  static OUTPUT: SSAOPassOUTPUT;
@@ -1,6 +1,6 @@
1
1
  import { ShaderMaterial, WebGLRenderTarget } from '../../../src/Three';
2
2
 
3
- import { Pass } from './Pass';
3
+ import { Pass, FullScreenQuad } from './Pass';
4
4
 
5
5
  export class SavePass extends Pass {
6
6
  constructor(renderTarget?: WebGLRenderTarget);
@@ -8,5 +8,5 @@ export class SavePass extends Pass {
8
8
  renderTarget: WebGLRenderTarget;
9
9
  uniforms: object;
10
10
  material: ShaderMaterial;
11
- fsQuad: object;
11
+ fsQuad: FullScreenQuad;
12
12
  }
@@ -1,11 +1,11 @@
1
1
  import { ShaderMaterial } from '../../../src/Three';
2
2
 
3
- import { Pass } from './Pass';
3
+ import { Pass, FullScreenQuad } from './Pass';
4
4
 
5
5
  export class ShaderPass extends Pass {
6
6
  constructor(shader: object, textureID?: string);
7
7
  textureID: string;
8
8
  uniforms: { [name: string]: { value: any } };
9
9
  material: ShaderMaterial;
10
- fsQuad: object;
10
+ fsQuad: FullScreenQuad;
11
11
  }
@@ -1,6 +1,6 @@
1
1
  import { Texture, ShaderMaterial } from '../../../src/Three';
2
2
 
3
- import { Pass } from './Pass';
3
+ import { Pass, FullScreenQuad } from './Pass';
4
4
 
5
5
  export class TexturePass extends Pass {
6
6
  constructor(map: Texture, opacity?: number);
@@ -8,5 +8,5 @@ export class TexturePass extends Pass {
8
8
  opacity: number;
9
9
  uniforms: object;
10
10
  material: ShaderMaterial;
11
- fsQuad: object;
11
+ fsQuad: FullScreenQuad;
12
12
  }
@@ -1,6 +1,6 @@
1
1
  import { Color, MeshBasicMaterial, ShaderMaterial, Vector2, Vector3, WebGLRenderTarget } from '../../../src/Three';
2
2
 
3
- import { Pass } from './Pass';
3
+ import { Pass, FullScreenQuad } from './Pass';
4
4
 
5
5
  export class UnrealBloomPass extends Pass {
6
6
  constructor(resolution: Vector2, strength: number, radius: number, threshold: number);
@@ -23,7 +23,7 @@ export class UnrealBloomPass extends Pass {
23
23
  oldClearColor: Color;
24
24
  oldClearAlpha: number;
25
25
  basic: MeshBasicMaterial;
26
- fsQuad: object;
26
+ fsQuad: FullScreenQuad;
27
27
 
28
28
  dispose(): void;
29
29
  getSeperableBlurMaterial(): ShaderMaterial;
@@ -1,5 +1,5 @@
1
1
  import NodeBuilder from '../../../nodes/core/NodeBuilder';
2
- import { Texture, TextureEncoding, Renderer, Object3D } from '../../../../../src/Three';
2
+ import { Renderer, Object3D } from '../../../../../src/Three';
3
3
  import Node from '../../../nodes/core/Node';
4
4
  import SlotNode from './SlotNode';
5
5
  import { NodeShaderStageOption } from '../../../nodes/core/constants';
@@ -39,15 +39,16 @@ export class WebGLNodeBuilder extends NodeBuilder {
39
39
 
40
40
  getVarys(shaderStage: string): string;
41
41
 
42
- addCodeAfterCode(shaderStage: string, snippet: string, code: string): string;
42
+ addCode(shaderStage: string, source: string, code: string, scope?: this): string;
43
43
  addCodeAfterInclude(shaderStage: string, snippet: string, code: string): string;
44
44
 
45
- replaceCode(shaderStage: string, source: string, target: string): void;
45
+ replaceCode(shaderStage: string, source: string, target: string, scope?: this): void;
46
46
  parseInclude(shaderStage: string, ...includes: string[]): void;
47
- getTextureEncodingFromMap(map: Texture): TextureEncoding;
48
47
 
49
48
  getInstanceIndex(): string;
50
49
  getFrontFacing(): string;
50
+ getFragCoord(): 'gl_FragCoord';
51
+ isFlipY(): true;
51
52
 
52
53
  buildCode(): void;
53
54
  build(): this;
@@ -0,0 +1,13 @@
1
+ import { IUniform, UniformsLib } from '../../../src/Three';
2
+
3
+ export const VelocityShader: {
4
+ uniforms: typeof UniformsLib['common'] &
5
+ typeof UniformsLib['displacementmap'] & {
6
+ modelMatrixPrev: IUniform;
7
+ currentProjectionViewMatrix: IUniform;
8
+ previousProjectionViewMatrix: IUniform;
9
+ };
10
+
11
+ fragmentShader: string;
12
+ vertexShader: string;
13
+ };
@@ -1,3 +1,5 @@
1
+ // https://threejs.org/docs/?q=buffergeome#examples/en/utils/BufferGeometryUtils
2
+
1
3
  import {
2
4
  BufferAttribute,
3
5
  BufferGeometry,
@@ -8,6 +10,7 @@ import {
8
10
  Points,
9
11
  } from '../../../src/Three';
10
12
 
13
+ export function deepCloneAttribute(attribute: BufferAttribute): BufferAttribute;
11
14
  export function mergeBufferGeometries(geometries: BufferGeometry[], useGroups?: boolean): BufferGeometry;
12
15
  export function mergeBufferAttributes(attributes: BufferAttribute[]): BufferAttribute;
13
16
  export function interleaveAttributes(attributes: BufferAttribute[]): InterleavedBufferAttribute;
@@ -23,3 +26,11 @@ export function computeMikkTSpaceTangents(
23
26
  export function mergeGroups(geometry: BufferGeometry): BufferGeometry;
24
27
  export function deinterleaveAttribute(geometry: BufferGeometry): void;
25
28
  export function deinterleaveGeometry(geometry: BufferGeometry): void;
29
+
30
+ /**
31
+ * Creates a new, non-indexed geometry with smooth normals everywhere except faces that meet at an angle greater than the crease angle.
32
+ *
33
+ * @param geometry The input geometry.
34
+ * @param creaseAngle The crease angle.
35
+ */
36
+ export function toCreasedNormals(geometry: BufferGeometry, creaseAngle?: number): BufferGeometry;
@@ -1,4 +1,4 @@
1
- import { BufferGeometry, Group, InstancedMesh, Material, Object3D, Scene, Mesh } from '../../../src/Three';
1
+ import { BufferGeometry, Group, InstancedMesh, Material, Object3D, Scene, Mesh, Vector3 } from '../../../src/Three';
2
2
 
3
3
  export function createMeshesFromInstancedMesh(instancedMesh: InstancedMesh): Group;
4
4
  export function createMultiMaterialObject(geometry: BufferGeometry, materials: Material[]): Group;
@@ -12,3 +12,11 @@ export function detach(child: Object3D, parent: Object3D, scene: Scene): void;
12
12
  export function attach(child: Object3D, scene: Scene, parent: Object3D): void;
13
13
 
14
14
  export function createMeshesFromMultiMaterialMesh(mesh: Mesh): Group;
15
+
16
+ export function sortInstancedMesh(mesh: InstancedMesh, compareFn: (a: number, b: number) => number): void;
17
+
18
+ export function reduceVertices<TValue>(
19
+ object: Object3D,
20
+ func: (value: TValue, vertex: Vector3) => TValue,
21
+ initialValue: TValue,
22
+ ): TValue;
@@ -7,7 +7,7 @@ import {
7
7
  MeshBasicMaterial,
8
8
  Object3D,
9
9
  Raycaster,
10
- SphereBufferGeometry,
10
+ SphereGeometry,
11
11
  Texture,
12
12
  Vector3,
13
13
  } from '../../../src/Three';
@@ -30,7 +30,7 @@ export class OculusHandPointerModel extends Object3D {
30
30
  pinched: boolean;
31
31
  attached: boolean;
32
32
 
33
- cursorObject: Mesh<SphereBufferGeometry, MeshBasicMaterial> | null;
33
+ cursorObject: Mesh<SphereGeometry, MeshBasicMaterial> | null;
34
34
 
35
35
  raycaster: Raycaster;
36
36
 
three/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for three 0.144
1
+ // Type definitions for three 0.147
2
2
  // Project: https://threejs.org/
3
3
  // Definitions by: Josh Ellis <https://github.com/joshuaellis>
4
4
  // Nathan Bierema <https://github.com/Methuselah96>
three/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/three",
3
- "version": "0.144.0",
3
+ "version": "0.147.0",
4
4
  "description": "TypeScript definitions for three",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three",
6
6
  "license": "MIT",
@@ -27,6 +27,6 @@
27
27
  "dependencies": {
28
28
  "@types/webxr": "*"
29
29
  },
30
- "typesPublisherContentHash": "fd44eeaf35ec2ad7992d39b9da4bfde0290790e3cec4fb679df94f09e35c72dd",
31
- "typeScriptVersion": "4.1"
30
+ "typesPublisherContentHash": "ada9d7ae4579346a43c927cb2bb915136e542a27b0d12fd83ad85b97b699d134",
31
+ "typeScriptVersion": "4.2"
32
32
  }
three/src/Three.d.ts CHANGED
@@ -158,6 +158,7 @@ export * from './math/Vector2';
158
158
  export * from './math/Quaternion';
159
159
  export * from './math/Color';
160
160
  export * from './math/SphericalHarmonics3';
161
+ export { ColorManagement } from './math/ColorManagement';
161
162
  import * as MathUtils from './math/MathUtils';
162
163
  export { MathUtils };
163
164
  /**
@@ -223,6 +224,7 @@ export * from './scenes/Scene';
223
224
  * Textures
224
225
  */
225
226
  export * from './textures/VideoTexture';
227
+ export * from './textures/CompressedArrayTexture';
226
228
  export * from './textures/DataTexture';
227
229
  export * from './textures/DataTexture2DArray';
228
230
  export * from './textures/DataTexture3D';
@@ -109,6 +109,13 @@ export class Object3D<E extends BaseEvent = Event> extends EventDispatcher<E> {
109
109
  */
110
110
  matrixAutoUpdate: boolean;
111
111
 
112
+ /**
113
+ * When this is set, the renderer checks every frame if the object and its children need matrix updates.
114
+ * Otherwise, you have to maintain all matrices in the object and its children yourself.
115
+ * @default THREE.Object3D.DefaultMatrixWorldAutoUpdate
116
+ */
117
+ matrixWorldAutoUpdate: boolean;
118
+
112
119
  /**
113
120
  * When this is set, it calculates the matrixWorld in that frame and resets this property to false.
114
121
  * @default false
@@ -210,6 +217,7 @@ export class Object3D<E extends BaseEvent = Event> extends EventDispatcher<E> {
210
217
 
211
218
  static DefaultUp: Vector3;
212
219
  static DefaultMatrixAutoUpdate: boolean;
220
+ static DefaultMatrixWorldAutoUpdate: boolean;
213
221
 
214
222
  /**
215
223
  * Applies the matrix transform to the object and updates the object's position, rotation and scale.
@@ -364,7 +372,7 @@ export class Object3D<E extends BaseEvent = Event> extends EventDispatcher<E> {
364
372
  */
365
373
  getObjectByName(name: string): Object3D | undefined;
366
374
 
367
- getObjectByProperty(name: string, value: string): Object3D | undefined;
375
+ getObjectByProperty(name: string, value: any): Object3D | undefined;
368
376
 
369
377
  getWorldPosition(target: Vector3): Vector3;
370
378
  getWorldQuaternion(target: Quaternion): Quaternion;
@@ -55,4 +55,8 @@ export class ArrowHelper extends Object3D {
55
55
  * @param color The desired color.
56
56
  */
57
57
  setColor(color: ColorRepresentation): void;
58
+
59
+ copy(source: this): this;
60
+
61
+ dispose(): void;
58
62
  }
@@ -15,4 +15,6 @@ export class Box3Helper extends LineSegments {
15
15
  type: string;
16
16
 
17
17
  box: Box3;
18
+
19
+ dispose(): void;
18
20
  }
@@ -17,4 +17,6 @@ export class BoxHelper extends LineSegments {
17
17
  update(object?: Object3D): void;
18
18
 
19
19
  setFromObject(object: Object3D): this;
20
+
21
+ dispose(): void;
20
22
  }
@@ -15,8 +15,5 @@ export class GridHelper extends LineSegments {
15
15
  */
16
16
  type: string;
17
17
 
18
- /**
19
- * @deprecated Colors should be specified in the constructor.
20
- */
21
- setColors(color1?: ColorRepresentation, color2?: ColorRepresentation): void;
18
+ dispose(): void;
22
19
  }
@@ -22,4 +22,6 @@ export class PlaneHelper extends LineSegments {
22
22
  size: number;
23
23
 
24
24
  updateMatrixWorld(force?: boolean): void;
25
+
26
+ dispose(): void;
25
27
  }
@@ -23,4 +23,6 @@ export class PolarGridHelper extends LineSegments {
23
23
  * @default 'PolarGridHelper'
24
24
  */
25
25
  type: string;
26
+
27
+ dispose(): void;
26
28
  }
@@ -25,4 +25,6 @@ export class SkeletonHelper extends LineSegments {
25
25
 
26
26
  getBoneList(object: Object3D): Bone[];
27
27
  update(): void;
28
+
29
+ dispose(): void;
28
30
  }
@@ -18,7 +18,7 @@ export class PointLight extends Light {
18
18
 
19
19
  /**
20
20
  * Light's intensity.
21
- * @default 1
21
+ * @default 2
22
22
  */
23
23
  intensity: number;
24
24
 
@@ -4,6 +4,7 @@ import { Object3D } from './../core/Object3D';
4
4
  import { SpotLightShadow } from './SpotLightShadow';
5
5
  import { Light } from './Light';
6
6
  import { ColorRepresentation } from '../utils';
7
+ import { Texture } from '../textures/Texture';
7
8
 
8
9
  /**
9
10
  * A point light that can cast shadow in one direction.
@@ -36,7 +37,7 @@ export class SpotLight extends Light {
36
37
 
37
38
  /**
38
39
  * Light's intensity.
39
- * @default 1
40
+ * @default 2
40
41
  */
41
42
  intensity: number;
42
43
 
@@ -68,5 +69,10 @@ export class SpotLight extends Light {
68
69
  */
69
70
  penumbra: number;
70
71
 
72
+ /**
73
+ * @default null
74
+ */
75
+ map: Texture | null;
76
+
71
77
  readonly isSpotLight: true;
72
78
  }
@@ -7,7 +7,7 @@ export class DataTextureLoader extends Loader {
7
7
 
8
8
  load(
9
9
  url: string,
10
- onLoad: (dataTexture: DataTexture, texData: object) => void,
10
+ onLoad?: (dataTexture: DataTexture, texData: object) => void,
11
11
  onProgress?: (event: ProgressEvent) => void,
12
12
  onError?: (event: ErrorEvent) => void,
13
13
  ): DataTexture;
@@ -67,7 +67,7 @@ export class MeshLambertMaterial extends Material {
67
67
  /**
68
68
  * @default 1
69
69
  */
70
- dispalcementScale: number;
70
+ displacementScale: number;
71
71
 
72
72
  /**
73
73
  * @default 0
@@ -1,4 +1,4 @@
1
- import { LinearSRGBColorSpace, SRGBColorSpace } from '../constants';
1
+ import { ColorSpace, LinearSRGBColorSpace, SRGBColorSpace } from '../constants';
2
2
  import { Color } from './Color';
3
3
 
4
4
  export function SRGBToLinear(c: number): number;
@@ -6,6 +6,16 @@ export function SRGBToLinear(c: number): number;
6
6
  export function LinearToSRGB(c: number): number;
7
7
 
8
8
  export namespace ColorManagement {
9
+ /**
10
+ * @default true
11
+ */
12
+ let legacyMode: boolean;
13
+
14
+ /**
15
+ * @default LinearSRGBColorSpace
16
+ */
17
+ let workingColorSpace: ColorSpace;
18
+
9
19
  function convert(
10
20
  color: Color,
11
21
  sourceColorSpace: SRGBColorSpace | LinearSRGBColorSpace,
three/src/math/Euler.d.ts CHANGED
@@ -2,8 +2,10 @@ import { Matrix4 } from './Matrix4';
2
2
  import { Quaternion } from './Quaternion';
3
3
  import { Vector3 } from './Vector3';
4
4
 
5
+ export type EulerOrder = 'XYZ' | 'YXZ' | 'ZXY' | 'ZYX' | 'YZX' | 'XZY';
6
+
5
7
  export class Euler {
6
- constructor(x?: number, y?: number, z?: number, order?: string);
8
+ constructor(x?: number, y?: number, z?: number, order?: EulerOrder);
7
9
 
8
10
  /**
9
11
  * @default 0
@@ -23,25 +25,25 @@ export class Euler {
23
25
  /**
24
26
  * @default THREE.Euler.DefaultOrder
25
27
  */
26
- order: string;
28
+ order: EulerOrder;
27
29
  readonly isEuler: true;
28
30
 
29
31
  _onChangeCallback: () => void;
30
32
 
31
- set(x: number, y: number, z: number, order?: string): Euler;
33
+ set(x: number, y: number, z: number, order?: EulerOrder): Euler;
32
34
  clone(): this;
33
35
  copy(euler: Euler): this;
34
- setFromRotationMatrix(m: Matrix4, order?: string, update?: boolean): Euler;
35
- setFromQuaternion(q: Quaternion, order?: string, update?: boolean): Euler;
36
- setFromVector3(v: Vector3, order?: string): Euler;
37
- reorder(newOrder: string): Euler;
36
+ setFromRotationMatrix(m: Matrix4, order?: EulerOrder, update?: boolean): Euler;
37
+ setFromQuaternion(q: Quaternion, order?: EulerOrder, update?: boolean): Euler;
38
+ setFromVector3(v: Vector3, order?: EulerOrder): Euler;
39
+ reorder(newOrder: EulerOrder): Euler;
38
40
  equals(euler: Euler): boolean;
39
- fromArray(xyzo: any[]): Euler;
40
- toArray(array?: number[], offset?: number): number[];
41
+ fromArray(xyzo: [number, number, number, EulerOrder?, ...any[]]): Euler;
42
+ toArray(array?: Array<number | string | undefined>, offset?: number): Array<number | string | undefined>;
41
43
  _onChange(callback: () => void): this;
42
44
 
43
- static RotationOrders: string[];
44
- static DefaultOrder: string;
45
+ static RotationOrders: EulerOrder[];
46
+ static DefaultOrder: 'XYZ';
45
47
 
46
48
  [Symbol.iterator](): Generator<string | number, void>;
47
49
  }
@@ -1,3 +1,5 @@
1
+ // https://threejs.org/docs/#api/en/math/Matrix3
2
+
1
3
  import { Matrix4 } from './Matrix4';
2
4
  import { Vector3 } from './Vector3';
3
5
 
@@ -99,6 +101,50 @@ export class Matrix3 implements Matrix {
99
101
 
100
102
  scale(sx: number, sy: number): Matrix3;
101
103
 
104
+ /**
105
+ * Sets this matrix as a 2D translation transform:
106
+ *
107
+ * ```
108
+ * 1, 0, x,
109
+ * 0, 1, y,
110
+ * 0, 0, 1
111
+ * ```
112
+ *
113
+ * @param x the amount to translate in the X axis.
114
+ * @param y the amount to translate in the Y axis.
115
+ */
116
+ makeTranslation(x: number, y: number): this;
117
+ makeTranslation(x: number, y: number): Matrix3;
118
+
119
+ /**
120
+ * Sets this matrix as a 2D rotational transformation by theta radians. The resulting matrix will be:
121
+ *
122
+ * ```
123
+ * cos(θ) -sin(θ) 0
124
+ * sin(θ) cos(θ) 0
125
+ * 0 0 1
126
+ * ```
127
+ *
128
+ * @param theta Rotation angle in radians. Positive values rotate counterclockwise.
129
+ */
130
+ makeRotation(theta: number): this;
131
+ makeRotation(theta: number): Matrix3;
132
+
133
+ /**
134
+ * Sets this matrix as a 2D scale transform:
135
+ *
136
+ * ```
137
+ * x, 0, 0,
138
+ * 0, y, 0,
139
+ * 0, 0, 1
140
+ * ```
141
+ *
142
+ * @param x the amount to scale in the X axis.
143
+ * @param y the amount to scale in the Y axis.
144
+ */
145
+ makeScale(x: number, y: number): this;
146
+ makeScale(x: number, y: number): Matrix3;
147
+
102
148
  rotate(theta: number): Matrix3;
103
149
 
104
150
  translate(tx: number, ty: number): Matrix3;
@@ -1,6 +1,8 @@
1
1
  import { Euler } from './Euler';
2
2
  import { Vector3 } from './Vector3';
3
3
  import { Matrix4 } from './Matrix4';
4
+ import { BufferAttribute } from '../core/BufferAttribute';
5
+ import { InterleavedBufferAttribute } from '../core/InterleavedBufferAttribute';
4
6
 
5
7
  /**
6
8
  * Implementation of a quaternion. This is used for rotating things without incurring in the dreaded gimbal lock issue, amongst other advantages.
@@ -136,6 +138,13 @@ export class Quaternion {
136
138
  */
137
139
  toArray(array: ArrayLike<number>, offset?: number): ArrayLike<number>;
138
140
 
141
+ /**
142
+ * Sets x, y, z, w properties of this quaternion from the attribute.
143
+ * @param attribute the source attribute.
144
+ * @param index index in the attribute.
145
+ */
146
+ fromBufferAttribute(attribute: BufferAttribute | InterleavedBufferAttribute, index: number): Quaternion;
147
+
139
148
  _onChange(callback: () => void): Quaternion;
140
149
  _onChangeCallback: () => void;
141
150
 
@@ -147,7 +156,7 @@ export class Quaternion {
147
156
  src1: number[],
148
157
  stcOffset1: number,
149
158
  t: number,
150
- ): Quaternion;
159
+ ): void;
151
160
 
152
161
  static multiplyQuaternionsFlat(
153
162
  dst: number[],