@types/three 0.144.0 → 0.146.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 (67) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/animation/CCDIKSolver.d.ts +2 -1
  3. three/examples/jsm/animation/MMDPhysics.d.ts +6 -1
  4. three/examples/jsm/csm/CSMHelper.d.ts +1 -0
  5. three/examples/jsm/helpers/OctreeHelper.d.ts +3 -0
  6. three/examples/jsm/helpers/VertexNormalsHelper.d.ts +2 -0
  7. three/examples/jsm/helpers/VertexTangentsHelper.d.ts +2 -0
  8. three/examples/jsm/loaders/PCDLoader.d.ts +1 -1
  9. three/examples/jsm/loaders/RGBELoader.d.ts +0 -1
  10. three/examples/jsm/loaders/USDZLoader.d.ts +18 -0
  11. three/examples/jsm/nodes/Nodes.d.ts +19 -2
  12. three/examples/jsm/nodes/accessors/BitangentNode.d.ts +18 -0
  13. three/examples/jsm/nodes/accessors/NormalNode.d.ts +1 -6
  14. three/examples/jsm/nodes/accessors/PositionNode.d.ts +2 -0
  15. three/examples/jsm/nodes/accessors/TangentNode.d.ts +18 -0
  16. three/examples/jsm/nodes/core/NodeBuilder.d.ts +4 -3
  17. three/examples/jsm/nodes/core/NodeVarying.d.ts +8 -0
  18. three/examples/jsm/nodes/core/constants.d.ts +13 -13
  19. three/examples/jsm/nodes/display/BlendModeNode.d.ts +32 -0
  20. three/examples/jsm/nodes/display/PosterizeNode.d.ts +8 -0
  21. three/examples/jsm/nodes/materialx/MaterialXNodes.d.ts +94 -0
  22. three/examples/jsm/nodes/materialx/{functions/lib → lib}/mx_hsv.d.ts +1 -1
  23. three/examples/jsm/nodes/materialx/{functions/lib → lib}/mx_noise.d.ts +1 -1
  24. three/examples/jsm/nodes/math/MathNode.d.ts +1 -2
  25. three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +24 -2
  26. three/examples/jsm/nodes/shadernode/ShaderNodeElements.d.ts +30 -0
  27. three/examples/jsm/nodes/utils/EquirectUVNode.d.ts +6 -0
  28. three/examples/jsm/nodes/utils/RemapNode.d.ts +13 -0
  29. three/examples/jsm/nodes/utils/TimerNode.d.ts +6 -1
  30. three/examples/jsm/nodes/utils/TriplanarTexturesNode.d.ts +22 -0
  31. three/examples/jsm/postprocessing/BloomPass.d.ts +1 -1
  32. three/examples/jsm/postprocessing/BokehPass.d.ts +0 -2
  33. three/examples/jsm/postprocessing/EffectComposer.d.ts +1 -0
  34. three/examples/jsm/postprocessing/Pass.d.ts +2 -0
  35. three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +2 -2
  36. three/examples/jsm/shaders/VelocityShader.d.ts +13 -0
  37. three/examples/jsm/utils/BufferGeometryUtils.d.ts +1 -0
  38. three/examples/jsm/utils/SceneUtils.d.ts +9 -1
  39. three/index.d.ts +1 -1
  40. three/package.json +2 -2
  41. three/src/Three.d.ts +2 -0
  42. three/src/core/Object3D.d.ts +9 -1
  43. three/src/helpers/ArrowHelper.d.ts +4 -0
  44. three/src/helpers/Box3Helper.d.ts +2 -0
  45. three/src/helpers/BoxHelper.d.ts +2 -0
  46. three/src/helpers/GridHelper.d.ts +1 -4
  47. three/src/helpers/PlaneHelper.d.ts +2 -0
  48. three/src/helpers/PolarGridHelper.d.ts +2 -0
  49. three/src/helpers/SkeletonHelper.d.ts +2 -0
  50. three/src/loaders/DataTextureLoader.d.ts +1 -1
  51. three/src/materials/MeshLambertMaterial.d.ts +1 -1
  52. three/src/math/ColorManagement.d.ts +11 -1
  53. three/src/math/Euler.d.ts +13 -11
  54. three/src/math/Quaternion.d.ts +10 -1
  55. three/src/renderers/WebGL3DRenderTarget.d.ts +1 -1
  56. three/src/renderers/WebGLArrayRenderTarget.d.ts +1 -1
  57. three/src/renderers/WebGLCubeRenderTarget.d.ts +1 -1
  58. three/src/renderers/WebGLMultipleRenderTargets.d.ts +1 -1
  59. three/src/renderers/WebGLRenderTarget.d.ts +1 -1
  60. three/src/renderers/WebGLRenderer.d.ts +1 -5
  61. three/src/renderers/shaders/UniformsLib.d.ts +3 -2
  62. three/src/renderers/webgl/WebGLCapabilities.d.ts +1 -0
  63. three/src/scenes/Scene.d.ts +2 -5
  64. three/src/textures/CanvasTexture.d.ts +2 -2
  65. three/src/textures/CompressedArrayTexture.d.ts +17 -0
  66. three/src/textures/Texture.d.ts +5 -1
  67. three/examples/jsm/nodes/core/NodeVary.d.ts +0 -6
@@ -12,10 +12,12 @@ import {
12
12
  } from '../../../../src/Three';
13
13
  import LightingContextNode, { LightingModelNode } from '../lighting/LightingContextNode';
14
14
  import {
15
+ BlendModeNode,
15
16
  CheckerNode,
16
17
  ColorAdjustmentNode,
17
18
  ColorSpaceNode,
18
19
  CubeTextureNode,
20
+ EquirectUVNode,
19
21
  FogNode,
20
22
  FogRangeNode,
21
23
  InstanceNode,
@@ -24,12 +26,15 @@ import {
24
26
  MaxMipLevelNode,
25
27
  NormalMapNode,
26
28
  OscNode,
29
+ PosterizeNode,
30
+ RemapNode,
27
31
  ReflectVectorNode,
28
32
  RotateUVNode,
29
33
  SkinningNode,
30
34
  SpriteSheetUVNode,
31
35
  TimerNode,
32
36
  ToneMappingNode,
37
+ TriplanarTexturesNode,
33
38
  } from '../Nodes';
34
39
 
35
40
  //
@@ -69,6 +74,11 @@ export function skinning(skinnedMesh: SkinnedMesh): Swizzable<SkinningNode>;
69
74
 
70
75
  // display
71
76
 
77
+ export function burn(baseNode: NodeRepresentation, blendNode?: NodeRepresentation): Swizzable<BlendModeNode>;
78
+ export function dodge(baseNode: NodeRepresentation, blendNode?: NodeRepresentation): Swizzable<BlendModeNode>;
79
+ export function overlay(baseNode: NodeRepresentation, blendNode?: NodeRepresentation): Swizzable<BlendModeNode>;
80
+ export function screen(baseNode: NodeRepresentation, blendNode?: NodeRepresentation): Swizzable<BlendModeNode>;
81
+
72
82
  export function saturation(
73
83
  colorNode: NodeRepresentation,
74
84
  adjustmentNode?: NodeRepresentation,
@@ -87,6 +97,8 @@ export function toneMapping(
87
97
  color: NodeRepresentation,
88
98
  ): Swizzable<ToneMappingNode>;
89
99
 
100
+ export function posterize(sourceNode: NodeRepresentation, stepsNode: NodeRepresentation): Swizzable<PosterizeNode>;
101
+
90
102
  // lighting
91
103
 
92
104
  export function lights(lights: Light[]): Swizzable<LightsNode>;
@@ -95,6 +107,8 @@ export function lightingContext(node: Node, lightingModelNode?: LightingModelNod
95
107
  // utils
96
108
 
97
109
  export const matcapUV: Swizzable<MatcapUVNode>;
110
+ export const equirectUV: Swizzable<EquirectUVNode>;
111
+
98
112
  export function maxMipLevel(texture: Texture): Swizzable<MaxMipLevelNode>;
99
113
 
100
114
  export function oscSine(timeNode?: NodeRepresentation): Swizzable<OscNode>;
@@ -102,6 +116,9 @@ export function oscSquare(timeNode?: NodeRepresentation): Swizzable<OscNode>;
102
116
  export function oscTriangle(timeNode?: NodeRepresentation): Swizzable<OscNode>;
103
117
  export function oscSawtooth(timeNode?: NodeRepresentation): Swizzable<OscNode>;
104
118
 
119
+ export function remap(node: Node, inLowNode: Node): Swizzable<RemapNode>;
120
+ export function remapClamp(node: Node, inLowNode: Node): Swizzable<RemapNode>;
121
+
105
122
  export function rotateUV(uvNode: Node, rotationNode: Node, centerNode?: Node): Swizzable<RotateUVNode>;
106
123
 
107
124
  export function spritesheetUV(
@@ -113,6 +130,19 @@ export function spritesheetUV(
113
130
  export function timerLocal(timeScale: number, value?: number): Swizzable<TimerNode>;
114
131
  export function timerGlobal(timeScale: number, value?: number): Swizzable<TimerNode>;
115
132
  export function timerDelta(timeScale: number, value?: number): Swizzable<TimerNode>;
133
+ export const frameId: Swizzable<TimerNode>;
134
+ export function triplanarTextures(
135
+ textureXNode: NodeRepresentation,
136
+ textureYNode?: NodeRepresentation,
137
+ textureZNode?: NodeRepresentation,
138
+ scaleNode?: NodeRepresentation,
139
+ positionNode?: NodeRepresentation,
140
+ normalNode?: NodeRepresentation,
141
+ ): Swizzable<TriplanarTexturesNode>;
142
+ export function triplanarTexture(
143
+ texture: NodeRepresentation,
144
+ ...params: NodeRepresentation[]
145
+ ): Swizzable<TriplanarTexturesNode>;
116
146
 
117
147
  // geometry
118
148
 
@@ -0,0 +1,6 @@
1
+ import { PositionNode, TempNode } from '../Nodes';
2
+ import { Swizzable } from '../shadernode/ShaderNodeElements';
3
+
4
+ export default class EquirectUVNode extends TempNode {
5
+ constructor(dirNode?: Swizzable<PositionNode>);
6
+ }
@@ -0,0 +1,13 @@
1
+ import Node from '../core/Node';
2
+
3
+ export default class RemapNode extends Node {
4
+ node: Node;
5
+ inLowNode: Node;
6
+ inHighNode: Node;
7
+ outLowNode: Node;
8
+ outHighNode: Node;
9
+
10
+ doClamp: boolean;
11
+
12
+ constructor(node: Node, inLowNode: Node, inHighNode: Node, outLowNode: Node, outHighNode: Node);
13
+ }
@@ -1,11 +1,16 @@
1
1
  import UniformNode from '../core/UniformNode';
2
2
 
3
- export type TimerNodeScope = typeof TimerNode.LOCAL | typeof TimerNode.GLOBAL | typeof TimerNode.DELTA;
3
+ export type TimerNodeScope =
4
+ | typeof TimerNode.LOCAL
5
+ | typeof TimerNode.GLOBAL
6
+ | typeof TimerNode.DELTA
7
+ | typeof TimerNode.FRAME;
4
8
 
5
9
  export default class TimerNode extends UniformNode {
6
10
  static LOCAL: 'local';
7
11
  static GLOBAL: 'global';
8
12
  static DELTA: 'delta';
13
+ static FRAME: 'frame';
9
14
 
10
15
  scope: TimerNodeScope;
11
16
  scale: number;
@@ -0,0 +1,22 @@
1
+ import Node from '../core/Node';
2
+ import { PositionNode, Swizzable, TextureNode } from '../Nodes';
3
+
4
+ export default class TriplanarTexturesNode extends Node {
5
+ textureXNode: TextureNode;
6
+ textureYNode: TextureNode | null;
7
+ textureZNode: TextureNode | null;
8
+
9
+ scaleNode: Swizzable;
10
+
11
+ positionNode: Swizzable<PositionNode>;
12
+ normalNode: Swizzable<PositionNode>;
13
+
14
+ constructor(
15
+ textureXNode: Node,
16
+ textureYNode?: TextureNode | null,
17
+ textureZNode?: TextureNode | null,
18
+ scaleNode?: Swizzable,
19
+ positionNode?: Swizzable<PositionNode>,
20
+ normalNode?: Swizzable<PositionNode>,
21
+ );
22
+ }
@@ -3,7 +3,7 @@ import { WebGLRenderTarget, ShaderMaterial } from '../../../src/Three';
3
3
  import { Pass } from './Pass';
4
4
 
5
5
  export class BloomPass extends Pass {
6
- constructor(strength?: number, kernelSize?: number, sigma?: number, resolution?: number);
6
+ constructor(strength?: number, kernelSize?: number, sigma?: number);
7
7
  renderTargetX: WebGLRenderTarget;
8
8
  renderTargetY: WebGLRenderTarget;
9
9
  copyUniforms: object;
@@ -7,8 +7,6 @@ export interface BokehPassParamters {
7
7
  aspect?: number;
8
8
  aperture?: number;
9
9
  maxblur?: number;
10
- width?: number;
11
- height?: number;
12
10
  }
13
11
 
14
12
  export class BokehPass extends Pass {
@@ -27,4 +27,5 @@ export class EffectComposer {
27
27
  reset(renderTarget?: WebGLRenderTarget): void;
28
28
  setSize(width: number, height: number): void;
29
29
  setPixelRatio(pixelRatio: number): void;
30
+ dispose(): void;
30
31
  }
@@ -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 {
@@ -39,10 +39,10 @@ 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
47
  getTextureEncodingFromMap(map: Texture): TextureEncoding;
48
48
 
@@ -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
+ };
@@ -8,6 +8,7 @@ import {
8
8
  Points,
9
9
  } from '../../../src/Three';
10
10
 
11
+ export function deepCloneAttribute(attribute: BufferAttribute): BufferAttribute;
11
12
  export function mergeBufferGeometries(geometries: BufferGeometry[], useGroups?: boolean): BufferGeometry;
12
13
  export function mergeBufferAttributes(attributes: BufferAttribute[]): BufferAttribute;
13
14
  export function interleaveAttributes(attributes: BufferAttribute[]): InterleavedBufferAttribute;
@@ -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;
three/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for three 0.144
1
+ // Type definitions for three 0.146
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.146.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",
30
+ "typesPublisherContentHash": "8811cec6dcb6daed91e5163eee03aeed7a0b56ad67126ce3b6ade0354b3d8614",
31
31
  "typeScriptVersion": "4.1"
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
  }
@@ -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,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[],
@@ -12,7 +12,7 @@ export class WebGL3DRenderTarget extends WebGLRenderTarget {
12
12
  * @param height the height of the render target, in pixels.
13
13
  * @param depth the depth of the render target.
14
14
  */
15
- constructor(width: number, height: number, depth: number);
15
+ constructor(width?: number, height?: number, depth?: number);
16
16
 
17
17
  /**
18
18
  * The depth of the render target.
@@ -12,7 +12,7 @@ export class WebGLArrayRenderTarget extends WebGLRenderTarget {
12
12
  * @param height the height of the render target, in pixels.
13
13
  * @param depth the depth/layer count of the render target.
14
14
  */
15
- constructor(width: number, height: number, depth: number);
15
+ constructor(width?: number, height?: number, depth?: number);
16
16
 
17
17
  /**
18
18
  * The depth of the render target.
@@ -4,7 +4,7 @@ import { Texture } from './../textures/Texture';
4
4
  import { CubeTexture } from './../textures/CubeTexture';
5
5
 
6
6
  export class WebGLCubeRenderTarget extends WebGLRenderTarget {
7
- constructor(size: number, options?: WebGLRenderTargetOptions);
7
+ constructor(size?: number, options?: WebGLRenderTargetOptions);
8
8
 
9
9
  texture: CubeTexture;
10
10
 
@@ -18,7 +18,7 @@ export class WebGLMultipleRenderTargets extends EventDispatcher {
18
18
  * @param options object that holds texture parameters for an auto-generated target texture and depthBuffer/stencilBuffer booleans.
19
19
  * For an explanation of the texture parameters see {@link Texture}.
20
20
  */
21
- constructor(width: number, height: number, count: number, options?: WebGLRenderTargetOptions);
21
+ constructor(width?: number, height?: number, count?: number, options?: WebGLRenderTargetOptions);
22
22
 
23
23
  setSize(width: number, height: number, depth?: number): this;
24
24
  copy(source: WebGLMultipleRenderTargets): this;
@@ -26,7 +26,7 @@ export interface WebGLRenderTargetOptions {
26
26
  }
27
27
 
28
28
  export class WebGLRenderTarget extends EventDispatcher {
29
- constructor(width: number, height: number, options?: WebGLRenderTargetOptions);
29
+ constructor(width?: number, height?: number, options?: WebGLRenderTargetOptions);
30
30
 
31
31
  width: number;
32
32
  height: number;
@@ -17,7 +17,7 @@ import { Material } from './../materials/Material';
17
17
  import { ToneMapping, ShadowMapType, CullFace, TextureEncoding } from '../constants';
18
18
  import { WebXRManager } from '../renderers/webxr/WebXRManager';
19
19
  import { BufferGeometry } from './../core/BufferGeometry';
20
- import { Texture } from '../textures/Texture';
20
+ import { OffscreenCanvas, Texture } from '../textures/Texture';
21
21
  import { Data3DTexture } from '../textures/Data3DTexture';
22
22
  import { Vector3 } from '../math/Vector3';
23
23
  import { Box3 } from '../math/Box3';
@@ -31,10 +31,6 @@ export interface Renderer {
31
31
  setSize(width: number, height: number, updateStyle?: boolean): void;
32
32
  }
33
33
 
34
- /** This is only available in worker JS contexts, not the DOM. */
35
- // tslint:disable-next-line:no-empty-interface
36
- export interface OffscreenCanvas extends EventTarget {}
37
-
38
34
  export interface WebGLRendererParameters {
39
35
  /**
40
36
  * A Canvas where the renderer draws its output.
@@ -19,8 +19,9 @@ export let UniformsLib: {
19
19
  envMap: IUniform;
20
20
  flipEnvMap: IUniform;
21
21
  reflectivity: IUniform;
22
- refractionRatio: IUniform;
23
- maxMipLevel: IUniform;
22
+ ior: IUniform;
23
+ refractRatio: IUniform;
24
+ backgroundBlurriness: IUniform;
24
25
  };
25
26
  aomap: {
26
27
  aoMap: IUniform;
@@ -20,6 +20,7 @@ export class WebGLCapabilities {
20
20
  vertexTextures: boolean;
21
21
  floatFragmentTextures: boolean;
22
22
  floatVertexTextures: boolean;
23
+ maxSamples: number;
23
24
 
24
25
  getMaxAnisotropy(): number;
25
26
  getMaxPrecision(precision: string): string;
@@ -22,17 +22,14 @@ export class Scene extends Object3D {
22
22
  */
23
23
  fog: FogBase | null;
24
24
 
25
+ backgroundBlurriness: number;
26
+
25
27
  /**
26
28
  * If not null, it will force everything in the scene to be rendered with that material. Default is null.
27
29
  * @default null
28
30
  */
29
31
  overrideMaterial: Material | null;
30
32
 
31
- /**
32
- * @default true
33
- */
34
- autoUpdate: boolean;
35
-
36
33
  /**
37
34
  * @default null
38
35
  */
@@ -1,4 +1,4 @@
1
- import { Texture } from './Texture';
1
+ import { OffscreenCanvas, Texture } from './Texture';
2
2
  import { Mapping, Wrapping, TextureFilter, PixelFormat, TextureDataType } from '../constants';
3
3
 
4
4
  export class CanvasTexture extends Texture {
@@ -15,7 +15,7 @@ export class CanvasTexture extends Texture {
15
15
  * @param [encoding=THREE.LinearEncoding]
16
16
  */
17
17
  constructor(
18
- canvas: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap,
18
+ canvas: TexImageSource | OffscreenCanvas,
19
19
  mapping?: Mapping,
20
20
  wrapS?: Wrapping,
21
21
  wrapT?: Wrapping,
@@ -0,0 +1,17 @@
1
+ import { CompressedPixelFormat, TextureDataType, Wrapping } from '../constants';
2
+ import { CompressedTexture } from './CompressedTexture.js';
3
+
4
+ export class CompressedArrayTexture extends CompressedTexture {
5
+ isCompressedArrayTexture: true;
6
+
7
+ wrapR: Wrapping;
8
+
9
+ constructor(
10
+ mipmaps: ImageData[],
11
+ width: number,
12
+ height: number,
13
+ depth: number,
14
+ format?: CompressedPixelFormat,
15
+ type?: TextureDataType,
16
+ );
17
+ }