@types/three 0.132.2 → 0.135.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 (58) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/controls/ArcballControls.d.ts +160 -0
  3. three/examples/jsm/controls/DragControls.d.ts +2 -1
  4. three/examples/jsm/csm/CSM.d.ts +47 -22
  5. three/examples/jsm/csm/CSMFrustum.d.ts +19 -0
  6. three/examples/jsm/csm/CSMHelper.d.ts +20 -7
  7. three/examples/jsm/csm/CSMShader.d.ts +4 -0
  8. three/examples/jsm/exporters/GLTFExporter.d.ts +1 -0
  9. three/examples/jsm/geometries/ParametricGeometries.d.ts +4 -2
  10. three/{src → examples/jsm}/geometries/ParametricGeometry.d.ts +2 -3
  11. three/{src → examples/jsm}/geometries/TextGeometry.d.ts +3 -2
  12. three/examples/jsm/lines/LineSegmentsGeometry.d.ts +2 -2
  13. three/{src → examples/jsm}/loaders/FontLoader.d.ts +14 -3
  14. three/examples/jsm/loaders/GLTFLoader.d.ts +25 -2
  15. three/examples/jsm/loaders/LogLuvLoader.d.ts +19 -0
  16. three/examples/jsm/misc/GPUComputationRenderer.d.ts +8 -6
  17. three/examples/jsm/modifiers/TessellateModifier.d.ts +1 -1
  18. three/examples/jsm/nodes/inputs/ColorNode.d.ts +1 -1
  19. three/examples/jsm/nodes/materials/StandardNodeMaterial.d.ts +1 -1
  20. three/examples/jsm/nodes/materials/nodes/StandardNode.d.ts +1 -1
  21. three/examples/jsm/objects/MarchingCubes.d.ts +11 -5
  22. three/examples/jsm/postprocessing/SSRPass.d.ts +0 -3
  23. three/examples/jsm/postprocessing/SSRrPass.d.ts +0 -17
  24. three/examples/jsm/renderers/CSS2DRenderer.d.ts +5 -1
  25. three/examples/jsm/renderers/CSS3DRenderer.d.ts +5 -1
  26. three/examples/jsm/webxr/OculusHandPointerModel.d.ts +3 -3
  27. three/index.d.ts +1 -1
  28. three/package.json +3 -3
  29. three/src/Three.d.ts +0 -3
  30. three/src/cameras/OrthographicCamera.d.ts +1 -1
  31. three/src/core/Layers.d.ts +1 -0
  32. three/src/core/Object3D.d.ts +40 -8
  33. three/src/core/Raycaster.d.ts +12 -4
  34. three/src/extras/core/CurvePath.d.ts +1 -1
  35. three/src/geometries/EdgesGeometry.d.ts +3 -2
  36. three/src/geometries/ExtrudeGeometry.d.ts +1 -1
  37. three/src/geometries/Geometries.d.ts +0 -2
  38. three/src/geometries/LatheGeometry.d.ts +1 -1
  39. three/src/geometries/PolyhedronGeometry.d.ts +1 -1
  40. three/src/geometries/ShapeGeometry.d.ts +1 -1
  41. three/src/geometries/TubeGeometry.d.ts +1 -1
  42. three/src/geometries/WireframeGeometry.d.ts +6 -2
  43. three/src/lights/DirectionalLight.d.ts +1 -1
  44. three/src/lights/LightShadow.d.ts +3 -3
  45. three/src/loaders/LoaderUtils.d.ts +1 -0
  46. three/src/materials/Material.d.ts +1 -1
  47. three/src/materials/MeshPhysicalMaterial.d.ts +29 -7
  48. three/src/math/Quaternion.d.ts +2 -0
  49. three/src/math/Triangle.d.ts +10 -1
  50. three/src/math/Vector3.d.ts +2 -0
  51. three/src/renderers/WebGLRenderer.d.ts +11 -7
  52. three/src/renderers/webgl/WebGLRenderLists.d.ts +0 -3
  53. three/src/textures/Texture.d.ts +6 -0
  54. three/examples/jsm/controls/DeviceOrientationControls.d.ts +0 -19
  55. three/examples/jsm/csm/Frustum.d.ts +0 -16
  56. three/examples/jsm/csm/Shader.d.ts +0 -6
  57. three/src/extras/core/Font.d.ts +0 -14
  58. three/src/extras/objects/ImmediateRenderObject.d.ts +0 -59
@@ -8,8 +8,12 @@ export class CSS2DObject extends Object3D {
8
8
  onAfterRender: (renderer: unknown, scene: Scene, camera: Camera) => void;
9
9
  }
10
10
 
11
+ export type CSS2DParameters = {
12
+ element?: HTMLElement;
13
+ };
14
+
11
15
  export class CSS2DRenderer {
12
- constructor();
16
+ constructor(parameters?: CSS2DParameters);
13
17
  domElement: HTMLElement;
14
18
 
15
19
  getSize(): { width: number; height: number };
@@ -12,8 +12,12 @@ export class CSS3DSprite extends CSS3DObject {
12
12
  constructor(element: HTMLElement);
13
13
  }
14
14
 
15
+ export type CSS3DParameters = {
16
+ element?: HTMLElement;
17
+ };
18
+
15
19
  export class CSS3DRenderer {
16
- constructor();
20
+ constructor(parameters?: CSS3DParameters);
17
21
  domElement: HTMLElement;
18
22
 
19
23
  getSize(): { width: number; height: number };
@@ -53,11 +53,11 @@ export class OculusHandPointerModel extends Object3D {
53
53
 
54
54
  public isAttached(): boolean;
55
55
 
56
- public intersectObject(object: Object3D): Intersection[] | void;
56
+ public intersectObject(object: Object3D, recursive?: boolean): Intersection[] | void;
57
57
 
58
- public intersectObjects(objects: Object3D[]): Intersection[] | void;
58
+ public intersectObjects(objects: Object3D[], recursive?: boolean): Intersection[] | void;
59
59
 
60
- public checkIntersections(objects: Object3D[]): void;
60
+ public checkIntersections(objects: Object3D[], recursive?: boolean): void;
61
61
 
62
62
  public setCursor(distance: number): void;
63
63
  }
three/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for three 0.132
1
+ // Type definitions for three 0.135
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.132.2",
3
+ "version": "0.135.0",
4
4
  "description": "TypeScript definitions for three",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three",
6
6
  "license": "MIT",
@@ -25,6 +25,6 @@
25
25
  },
26
26
  "scripts": {},
27
27
  "dependencies": {},
28
- "typesPublisherContentHash": "688c86261a68868c7e44ee0974f12fca38a721ba8b285b2e5ac7d48169235371",
29
- "typeScriptVersion": "3.7"
28
+ "typesPublisherContentHash": "d0154c4f95513cc2c40c0bf65e56ad0b1bd41ffca75f306c6e9bf6c0c8e6dd84",
29
+ "typeScriptVersion": "3.8"
30
30
  }
three/src/Three.d.ts CHANGED
@@ -58,12 +58,10 @@ export * from './core/Clock';
58
58
  /**
59
59
  * Extras
60
60
  */
61
- export * from './extras/objects/ImmediateRenderObject';
62
61
  export * from './extras/curves/Curves';
63
62
  export * from './extras/core/Shape';
64
63
  export * from './extras/core/Path';
65
64
  export * from './extras/core/ShapePath';
66
- export * from './extras/core/Font';
67
65
  export * from './extras/core/CurvePath';
68
66
  export * from './extras/core/Curve';
69
67
  export * from './extras/DataUtils';
@@ -121,7 +119,6 @@ export * from './loaders/BufferGeometryLoader';
121
119
  export * from './loaders/LoadingManager';
122
120
  export * from './loaders/ImageLoader';
123
121
  export * from './loaders/ImageBitmapLoader';
124
- export * from './loaders/FontLoader';
125
122
  export * from './loaders/FileLoader';
126
123
  export * from './loaders/Loader';
127
124
  export * from './loaders/LoaderUtils';
@@ -18,7 +18,7 @@ export class OrthographicCamera extends Camera {
18
18
  * @param [near=0.1] Camera frustum near plane.
19
19
  * @param [far=2000] Camera frustum far plane.
20
20
  */
21
- constructor(left: number, right: number, top: number, bottom: number, near?: number, far?: number);
21
+ constructor(left?: number, right?: number, top?: number, bottom?: number, near?: number, far?: number);
22
22
 
23
23
  type: 'OrthographicCamera';
24
24
 
@@ -13,4 +13,5 @@ export class Layers {
13
13
  disable(channel: number): void;
14
14
  disableAll(): void;
15
15
  test(layers: Layers): boolean;
16
+ isEnabled(channel: number): boolean;
16
17
  }
@@ -119,6 +119,7 @@ export class Object3D<E extends BaseEvent = Event> extends EventDispatcher<E> {
119
119
  * @default new THREE.Layers()
120
120
  */
121
121
  layers: Layers;
122
+
122
123
  /**
123
124
  * Object gets rendered if true.
124
125
  * @default true
@@ -211,18 +212,41 @@ export class Object3D<E extends BaseEvent = Event> extends EventDispatcher<E> {
211
212
  static DefaultMatrixAutoUpdate: boolean;
212
213
 
213
214
  /**
214
- * This updates the position, rotation and scale with the matrix.
215
+ * Applies the matrix transform to the object and updates the object's position, rotation and scale.
215
216
  */
216
217
  applyMatrix4(matrix: Matrix4): void;
217
218
 
219
+ /**
220
+ * Applies the rotation represented by the quaternion to the object.
221
+ */
218
222
  applyQuaternion(quaternion: Quaternion): this;
219
223
 
224
+ /**
225
+ * axis -- A normalized vector in object space.
226
+ * angle -- angle in radians
227
+ * @param axis A normalized vector in object space.
228
+ * @param angle angle in radians
229
+ */
220
230
  setRotationFromAxisAngle(axis: Vector3, angle: number): void;
221
231
 
232
+ /**
233
+ * Calls setRotationFromEuler(euler) on the .quaternion.
234
+ * @param euler Euler angle specifying rotation amount.
235
+ */
222
236
  setRotationFromEuler(euler: Euler): void;
223
237
 
238
+ /**
239
+ * Calls setFromRotationMatrix(m) on the .quaternion.
240
+ *
241
+ * Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
242
+ * @param m rotate the quaternion by the rotation component of the matrix.
243
+ */
224
244
  setRotationFromMatrix(m: Matrix4): void;
225
245
 
246
+ /**
247
+ * Copy the given quaternion into .quaternion.
248
+ * @param q normalized Quaternion
249
+ */
226
250
  setRotationFromQuaternion(q: Quaternion): void;
227
251
 
228
252
  /**
@@ -240,24 +264,25 @@ export class Object3D<E extends BaseEvent = Event> extends EventDispatcher<E> {
240
264
  rotateOnWorldAxis(axis: Vector3, angle: number): this;
241
265
 
242
266
  /**
243
- *
244
- * @param angle
267
+ * Rotates the object around x axis in local space.
268
+ * @param angle the angle to rotate in radians.
245
269
  */
246
270
  rotateX(angle: number): this;
247
271
 
248
272
  /**
249
- *
250
- * @param angle
273
+ * Rotates the object around y axis in local space.
274
+ * @param angle the angle to rotate in radians.
251
275
  */
252
276
  rotateY(angle: number): this;
253
277
 
254
278
  /**
255
- *
256
- * @param angle
279
+ * Rotates the object around z axis in local space.
280
+ * @param angle the angle to rotate in radians.
257
281
  */
258
282
  rotateZ(angle: number): this;
259
283
 
260
284
  /**
285
+ * Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
261
286
  * @param axis A normalized vector in object space.
262
287
  * @param distance The distance to translate.
263
288
  */
@@ -294,7 +319,9 @@ export class Object3D<E extends BaseEvent = Event> extends EventDispatcher<E> {
294
319
  worldToLocal(vector: Vector3): Vector3;
295
320
 
296
321
  /**
297
- * Rotates object to face point in space.
322
+ * Optionally, the x, y and z components of the world space position.
323
+ * Rotates the object to face a point in world space.
324
+ * This method does not support objects having non-uniformly-scaled parent(s).
298
325
  * @param vector A world vector to look at.
299
326
  */
300
327
  lookAt(vector: Vector3 | number, y?: number, z?: number): void;
@@ -361,6 +388,11 @@ export class Object3D<E extends BaseEvent = Event> extends EventDispatcher<E> {
361
388
  */
362
389
  updateMatrixWorld(force?: boolean): void;
363
390
 
391
+ /**
392
+ * Updates the global transform of the object.
393
+ * @param updateParents recursively updates global transform of ancestors.
394
+ * @param updateChildren recursively updates global transform of descendants.
395
+ */
364
396
  updateWorldMatrix(updateParents: boolean, updateChildren: boolean): void;
365
397
 
366
398
  toJSON(meta?: { geometries: any; materials: any; textures: any; images: any }): any;
@@ -13,14 +13,14 @@ export interface Face {
13
13
  materialIndex: number;
14
14
  }
15
15
 
16
- export interface Intersection {
16
+ export interface Intersection<TIntersected extends Object3D = Object3D> {
17
17
  distance: number;
18
18
  distanceToRay?: number | undefined;
19
19
  point: Vector3;
20
20
  index?: number | undefined;
21
21
  face?: Face | null | undefined;
22
22
  faceIndex?: number | undefined;
23
- object: Object3D;
23
+ object: TIntersected;
24
24
  uv?: Vector2 | undefined;
25
25
  instanceId?: number | undefined;
26
26
  }
@@ -97,7 +97,11 @@ export class Raycaster {
97
97
  * @param recursive If true, it also checks all descendants. Otherwise it only checks intersecton with the object. Default is false.
98
98
  * @param optionalTarget (optional) target to set the result. Otherwise a new Array is instantiated. If set, you must clear this array prior to each call (i.e., array.length = 0;).
99
99
  */
100
- intersectObject(object: Object3D, recursive?: boolean, optionalTarget?: Intersection[]): Intersection[];
100
+ intersectObject<TIntersected extends Object3D>(
101
+ object: Object3D,
102
+ recursive?: boolean,
103
+ optionalTarget?: Array<Intersection<TIntersected>>,
104
+ ): Array<Intersection<TIntersected>>;
101
105
 
102
106
  /**
103
107
  * Checks all intersection between the ray and the objects with or without the descendants.
@@ -107,5 +111,9 @@ export class Raycaster {
107
111
  * @param recursive If true, it also checks all descendants of the objects. Otherwise it only checks intersecton with the objects. Default is false.
108
112
  * @param optionalTarget (optional) target to set the result. Otherwise a new Array is instantiated. If set, you must clear this array prior to each call (i.e., array.length = 0;).
109
113
  */
110
- intersectObjects(objects: Object3D[], recursive?: boolean, optionalTarget?: Intersection[]): Intersection[];
114
+ intersectObjects<TIntersected extends Object3D>(
115
+ objects: Object3D[],
116
+ recursive?: boolean,
117
+ optionalTarget?: Array<Intersection<TIntersected>>,
118
+ ): Array<Intersection<TIntersected>>;
111
119
  }
@@ -21,6 +21,6 @@ export class CurvePath<T extends Vector> extends Curve<T> {
21
21
 
22
22
  add(curve: Curve<T>): void;
23
23
  closePath(): void;
24
- getPoint(t: number): T;
24
+ getPoint(t: number, optionalTarget?: T): T;
25
25
  getCurveLengths(): number[];
26
26
  }
@@ -1,11 +1,11 @@
1
1
  import { BufferGeometry } from '../core/BufferGeometry';
2
2
 
3
- export class EdgesGeometry extends BufferGeometry {
3
+ export class EdgesGeometry<TBufferGeometry extends BufferGeometry = BufferGeometry> extends BufferGeometry {
4
4
  /**
5
5
  * @param geometry
6
6
  * @param [thresholdAngle=1]
7
7
  */
8
- constructor(geometry: BufferGeometry, thresholdAngle?: number);
8
+ constructor(geometry?: TBufferGeometry, thresholdAngle?: number);
9
9
 
10
10
  /**
11
11
  * @default 'EdgesGeometry'
@@ -13,6 +13,7 @@ export class EdgesGeometry extends BufferGeometry {
13
13
  type: string;
14
14
 
15
15
  parameters: {
16
+ geometry: TBufferGeometry;
16
17
  thresholdAngle: number;
17
18
  };
18
19
  }
@@ -57,7 +57,7 @@ export interface UVGenerator {
57
57
  }
58
58
 
59
59
  export class ExtrudeGeometry extends BufferGeometry {
60
- constructor(shapes: Shape | Shape[], options?: ExtrudeGeometryOptions);
60
+ constructor(shapes?: Shape | Shape[], options?: ExtrudeGeometryOptions);
61
61
 
62
62
  /**
63
63
  * @default 'ExtrudeGeometry'
@@ -8,14 +8,12 @@ export * from './ExtrudeGeometry';
8
8
  export * from './IcosahedronGeometry';
9
9
  export * from './LatheGeometry';
10
10
  export * from './OctahedronGeometry';
11
- export * from './ParametricGeometry';
12
11
  export * from './PlaneGeometry';
13
12
  export * from './PolyhedronGeometry';
14
13
  export * from './RingGeometry';
15
14
  export * from './ShapeGeometry';
16
15
  export * from './SphereGeometry';
17
16
  export * from './TetrahedronGeometry';
18
- export * from './TextGeometry';
19
17
  export * from './TorusGeometry';
20
18
  export * from './TorusKnotGeometry';
21
19
  export * from './TubeGeometry';
@@ -8,7 +8,7 @@ export class LatheGeometry extends BufferGeometry {
8
8
  * @param [phiStart=0]
9
9
  * @param [phiLength=Math.PI * 2]
10
10
  */
11
- constructor(points: Vector2[], segments?: number, phiStart?: number, phiLength?: number);
11
+ constructor(points?: Vector2[], segments?: number, phiStart?: number, phiLength?: number);
12
12
 
13
13
  /**
14
14
  * @default 'LatheGeometry'
@@ -7,7 +7,7 @@ export class PolyhedronGeometry extends BufferGeometry {
7
7
  * @param [radius=1]
8
8
  * @param [detail=0]
9
9
  */
10
- constructor(vertices: number[], indices: number[], radius?: number, detail?: number);
10
+ constructor(vertices?: number[], indices?: number[], radius?: number, detail?: number);
11
11
 
12
12
  /**
13
13
  * @default 'PolyhedronGeometry'
@@ -7,7 +7,7 @@ export class ShapeGeometry extends BufferGeometry {
7
7
  */
8
8
  type: string;
9
9
 
10
- constructor(shapes: Shape | Shape[], curveSegments?: number);
10
+ constructor(shapes?: Shape | Shape[], curveSegments?: number);
11
11
 
12
12
  static fromJSON(data: any): ShapeGeometry;
13
13
  }
@@ -11,7 +11,7 @@ export class TubeGeometry extends BufferGeometry {
11
11
  * @param [closed=false]
12
12
  */
13
13
  constructor(
14
- path: Curve<Vector3>,
14
+ path?: Curve<Vector3>,
15
15
  tubularSegments?: number,
16
16
  radius?: number,
17
17
  radiusSegments?: number,
@@ -1,10 +1,14 @@
1
1
  import { BufferGeometry } from './../core/BufferGeometry';
2
2
 
3
- export class WireframeGeometry extends BufferGeometry {
4
- constructor(geometry: BufferGeometry);
3
+ export class WireframeGeometry<TBufferGeometry extends BufferGeometry = BufferGeometry> extends BufferGeometry {
4
+ constructor(geometry?: TBufferGeometry);
5
5
 
6
6
  /**
7
7
  * @default 'WireframeGeometry'
8
8
  */
9
9
  type: string;
10
+
11
+ parameters: {
12
+ geometry: TBufferGeometry;
13
+ };
10
14
  }
@@ -24,7 +24,7 @@ export class DirectionalLight extends Light {
24
24
  /**
25
25
  * @default THREE.Object3D.DefaultUp
26
26
  */
27
- position: Vector3;
27
+ readonly position: Vector3;
28
28
 
29
29
  /**
30
30
  * Target used for shadow camera orientation.
@@ -3,7 +3,7 @@ import { Light } from './../lights/Light';
3
3
  import { Vector2 } from './../math/Vector2';
4
4
  import { Vector4 } from './../math/Vector4';
5
5
  import { Matrix4 } from './../math/Matrix4';
6
- import { RenderTarget } from '../renderers/webgl/WebGLRenderLists';
6
+ import { WebGLRenderTarget } from '../renderers/WebGLRenderTarget';
7
7
 
8
8
  export class LightShadow {
9
9
  constructor(camera: Camera);
@@ -38,12 +38,12 @@ export class LightShadow {
38
38
  /**
39
39
  * @default null
40
40
  */
41
- map: RenderTarget;
41
+ map: WebGLRenderTarget;
42
42
 
43
43
  /**
44
44
  * @default null
45
45
  */
46
- mapPass: RenderTarget;
46
+ mapPass: WebGLRenderTarget;
47
47
 
48
48
  /**
49
49
  * @default new THREE.Matrix4()
@@ -1,6 +1,7 @@
1
1
  export interface LoaderUtils {
2
2
  decodeText(array: BufferSource): string;
3
3
  extractUrlBase(url: string): string;
4
+ resolveURL(url: string, path: string): string;
4
5
  }
5
6
 
6
7
  export const LoaderUtils: LoaderUtils;
@@ -317,7 +317,7 @@ export class Material extends EventDispatcher {
317
317
  * If *null*, the value is opposite that of side, above.
318
318
  * @default null
319
319
  */
320
- shadowSide: Side;
320
+ shadowSide: Side | null;
321
321
 
322
322
  /**
323
323
  * Defines whether this material is tone mapped according to the renderer's toneMapping setting.
@@ -14,17 +14,19 @@ export interface MeshPhysicalMaterialParameters extends MeshStandardMaterialPara
14
14
  reflectivity?: number | undefined;
15
15
  ior?: number | undefined;
16
16
 
17
- sheenTint?: Color | undefined;
17
+ sheen?: number | undefined;
18
+ sheenColor?: Color | undefined;
19
+ sheenRoughness?: number | undefined;
18
20
 
19
21
  transmission?: number | undefined;
20
22
  transmissionMap?: Texture | null | undefined;
21
23
  attenuationDistance?: number | undefined;
22
- attenuationTint?: Color | undefined;
24
+ attenuationColor?: Color | undefined;
23
25
 
24
26
  specularIntensity?: number | undefined;
25
- specularTint?: Color | undefined;
27
+ specularColor?: Color | undefined;
26
28
  specularIntensityMap?: Texture | null | undefined;
27
- specularTintMap?: Texture | null | undefined;
29
+ specularColorMap?: Texture | null | undefined;
28
30
  }
29
31
 
30
32
  export class MeshPhysicalMaterial extends MeshStandardMaterial {
@@ -80,10 +82,30 @@ export class MeshPhysicalMaterial extends MeshStandardMaterial {
80
82
  */
81
83
  ior: number;
82
84
 
85
+ /**
86
+ * @default 0.0
87
+ */
88
+ sheen: number;
89
+
90
+ /**
91
+ * @default Color( 0x000000 )
92
+ */
93
+ sheenColor: Color;
94
+
95
+ /**
96
+ * @default null
97
+ */
98
+ sheenColorMap: Texture | null;
99
+
100
+ /**
101
+ * @default 1.0
102
+ */
103
+ sheenRoughness: number;
104
+
83
105
  /**
84
106
  * @default null
85
107
  */
86
- sheenTint: Color | null;
108
+ sheenRoughnessMap: Texture | null;
87
109
 
88
110
  /**
89
111
  * @default 0
@@ -123,7 +145,7 @@ export class MeshPhysicalMaterial extends MeshStandardMaterial {
123
145
  /**
124
146
  * @default Color(1, 1, 1)
125
147
  */
126
- specularTint: Color;
148
+ specularColor: Color;
127
149
 
128
150
  /**
129
151
  * @default null
@@ -133,5 +155,5 @@ export class MeshPhysicalMaterial extends MeshStandardMaterial {
133
155
  /**
134
156
  * @default null
135
157
  */
136
- specularTintMap: Texture | null;
158
+ specularColorMap: Texture | null;
137
159
  }
@@ -172,4 +172,6 @@ export class Quaternion {
172
172
  * @deprecated Use {@link Quaternion#invert .invert()} instead.
173
173
  */
174
174
  inverse(): Quaternion;
175
+
176
+ random(): Quaternion;
175
177
  }
@@ -3,6 +3,9 @@ import { Vector3 } from './Vector3';
3
3
  import { Plane } from './Plane';
4
4
  import { Box3 } from './Box3';
5
5
 
6
+ import { InterleavedBufferAttribute } from '../core/InterleavedBufferAttribute';
7
+ import { BufferAttribute } from '../core/BufferAttribute';
8
+
6
9
  export class Triangle {
7
10
  constructor(a?: Vector3, b?: Vector3, c?: Vector3);
8
11
 
@@ -22,7 +25,13 @@ export class Triangle {
22
25
  c: Vector3;
23
26
 
24
27
  set(a: Vector3, b: Vector3, c: Vector3): Triangle;
25
- setFromPointsAndIndices(points: Vector3[], i0: number, i1: number, i2: number): Triangle;
28
+ setFromPointsAndIndices(points: Vector3[], i0: number, i1: number, i2: number): this;
29
+ setFromAttributeAndIndices(
30
+ attribute: BufferAttribute | InterleavedBufferAttribute,
31
+ i0: number,
32
+ i1: number,
33
+ i2: number,
34
+ ): this;
26
35
  clone(): this;
27
36
  copy(triangle: Triangle): this;
28
37
  getArea(): number;
@@ -287,4 +287,6 @@ export class Vector3 implements Vector {
287
287
  * Sets this vector's x, y and z from Math.random
288
288
  */
289
289
  random(): this;
290
+
291
+ randomDirection(): this;
290
292
  }
@@ -6,12 +6,13 @@ import { WebGLShadowMap } from './webgl/WebGLShadowMap';
6
6
  import { WebGLCapabilities } from './webgl/WebGLCapabilities';
7
7
  import { WebGLProperties } from './webgl/WebGLProperties';
8
8
  import { WebGLProgram } from './webgl/WebGLProgram';
9
- import { RenderTarget, WebGLRenderLists } from './webgl/WebGLRenderLists';
9
+ import { WebGLRenderLists } from './webgl/WebGLRenderLists';
10
10
  import { WebGLState } from './webgl/WebGLState';
11
11
  import { Vector2 } from './../math/Vector2';
12
12
  import { Vector4 } from './../math/Vector4';
13
13
  import { Color } from './../math/Color';
14
14
  import { WebGLRenderTarget } from './WebGLRenderTarget';
15
+ import { WebGLMultipleRenderTargets } from './WebGLMultipleRenderTargets';
15
16
  import { Object3D } from './../core/Object3D';
16
17
  import { Material } from './../materials/Material';
17
18
  import { ToneMapping, ShadowMapType, CullFace, TextureEncoding } from '../constants';
@@ -221,6 +222,7 @@ export class WebGLRenderer implements Renderer {
221
222
  getContext(): WebGLRenderingContext;
222
223
  getContextAttributes(): any;
223
224
  forceContextLoss(): void;
225
+ forceContextRestore(): void;
224
226
 
225
227
  /**
226
228
  * @deprecated Use {@link WebGLCapabilities#getMaxAnisotropy .capabilities.getMaxAnisotropy()} instead.
@@ -322,8 +324,6 @@ export class WebGLRenderer implements Renderer {
322
324
  resetGLState(): void;
323
325
  dispose(): void;
324
326
 
325
- renderBufferImmediate(object: Object3D, program: WebGLProgram): void;
326
-
327
327
  renderBufferDirect(
328
328
  camera: Camera,
329
329
  scene: Scene,
@@ -375,12 +375,12 @@ export class WebGLRenderer implements Renderer {
375
375
  /**
376
376
  * Returns the current render target. If no render target is set, null is returned.
377
377
  */
378
- getRenderTarget(): RenderTarget | null;
378
+ getRenderTarget(): WebGLRenderTarget | null;
379
379
 
380
380
  /**
381
381
  * @deprecated Use {@link WebGLRenderer#getRenderTarget .getRenderTarget()} instead.
382
382
  */
383
- getCurrentRenderTarget(): RenderTarget | null;
383
+ getCurrentRenderTarget(): WebGLRenderTarget | null;
384
384
 
385
385
  /**
386
386
  * Sets the active render target.
@@ -389,10 +389,14 @@ export class WebGLRenderer implements Renderer {
389
389
  * @param activeCubeFace Specifies the active cube side (PX 0, NX 1, PY 2, NY 3, PZ 4, NZ 5) of {@link WebGLCubeRenderTarget}.
390
390
  * @param activeMipmapLevel Specifies the active mipmap level.
391
391
  */
392
- setRenderTarget(renderTarget: RenderTarget | null, activeCubeFace?: number, activeMipmapLevel?: number): void;
392
+ setRenderTarget(
393
+ renderTarget: WebGLRenderTarget | WebGLMultipleRenderTargets | null,
394
+ activeCubeFace?: number,
395
+ activeMipmapLevel?: number,
396
+ ): void;
393
397
 
394
398
  readRenderTargetPixels(
395
- renderTarget: RenderTarget,
399
+ renderTarget: WebGLRenderTarget | WebGLMultipleRenderTargets,
396
400
  x: number,
397
401
  y: number,
398
402
  width: number,
@@ -7,9 +7,6 @@ import { Camera } from './../../cameras/Camera';
7
7
  import { BufferGeometry } from '../../core/BufferGeometry';
8
8
  import { WebGLProperties } from './WebGLProperties';
9
9
 
10
- // tslint:disable-next-line:no-empty-interface
11
- export interface RenderTarget {} // not defined in the code, used in LightShadow and WebGRenderer classes
12
-
13
10
  export interface RenderItem {
14
11
  id: number;
15
12
  object: Object3D;
@@ -158,6 +158,12 @@ export class Texture extends EventDispatcher {
158
158
  */
159
159
  isRenderTargetTexture: boolean;
160
160
 
161
+ /**
162
+ * An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
163
+ * @default {}
164
+ */
165
+ userData: any;
166
+
161
167
  /**
162
168
  * @default 0
163
169
  */
@@ -1,19 +0,0 @@
1
- import { Camera, EventDispatcher } from '../../../src/Three';
2
-
3
- export class DeviceOrientationControls extends EventDispatcher {
4
- constructor(object: Camera);
5
-
6
- object: Camera;
7
-
8
- // API
9
-
10
- alphaOffset: number;
11
- deviceOrientation: any;
12
- enabled: boolean;
13
- screenOrientation: number;
14
-
15
- connect(): void;
16
- disconnect(): void;
17
- dispose(): void;
18
- update(): void;
19
- }