@types/three 0.152.1 → 0.153.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 (45) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/animation/MMDAnimationHelper.d.ts +2 -0
  3. three/examples/jsm/csm/CSM.d.ts +1 -1
  4. three/examples/jsm/exporters/DRACOExporter.d.ts +1 -1
  5. three/examples/jsm/exporters/PLYExporter.d.ts +20 -3
  6. three/examples/jsm/exporters/STLExporter.d.ts +11 -1
  7. three/examples/jsm/geometries/TeapotGeometry.d.ts +1 -1
  8. three/examples/jsm/loaders/IFCLoader.d.ts +4 -4
  9. three/examples/jsm/misc/GPUComputationRenderer.d.ts +1 -1
  10. three/examples/jsm/nodes/accessors/ModelViewProjectionNode.d.ts +1 -1
  11. three/examples/jsm/nodes/core/NodeBuilder.d.ts +1 -1
  12. three/examples/jsm/postprocessing/FilmPass.d.ts +1 -1
  13. three/examples/jsm/utils/UVsDebug.d.ts +1 -1
  14. three/index.d.ts +1 -1
  15. three/package.json +2 -2
  16. three/src/cameras/Camera.d.ts +7 -4
  17. three/src/cameras/CubeCamera.d.ts +5 -0
  18. three/src/constants.d.ts +26 -2
  19. three/src/core/BufferAttribute.d.ts +9 -1
  20. three/src/helpers/GridHelper.d.ts +3 -1
  21. three/src/lights/DirectionalLight.d.ts +1 -1
  22. three/src/lights/Light.d.ts +1 -1
  23. three/src/lights/PointLight.d.ts +4 -4
  24. three/src/lights/RectAreaLight.d.ts +2 -2
  25. three/src/lights/SpotLight.d.ts +5 -5
  26. three/src/materials/MeshPhysicalMaterial.d.ts +19 -0
  27. three/src/math/Color.d.ts +2 -1
  28. three/src/math/Frustum.d.ts +2 -1
  29. three/src/math/MathUtils.d.ts +65 -44
  30. three/src/math/Matrix3.d.ts +16 -1
  31. three/src/math/Matrix4.d.ts +45 -8
  32. three/src/math/Vector2.d.ts +5 -0
  33. three/src/math/Vector3.d.ts +5 -0
  34. three/src/math/Vector4.d.ts +5 -0
  35. three/src/renderers/WebGLRenderer.d.ts +3 -1
  36. three/src/renderers/webxr/WebXRManager.d.ts +23 -6
  37. three/src/textures/DepthTexture.d.ts +9 -0
  38. three/src/textures/FramebufferTexture.d.ts +2 -3
  39. three/src/textures/Source.d.ts +2 -0
  40. three/examples/jsm/exporters/ColladaExporter.d.ts +0 -22
  41. three/examples/jsm/geometries/LightningStrike.d.ts +0 -108
  42. three/examples/jsm/loaders/PRWMLoader.d.ts +0 -16
  43. three/examples/jsm/objects/LightningStorm.d.ts +0 -32
  44. three/examples/jsm/postprocessing/AdaptiveToneMappingPass.d.ts +0 -29
  45. three/examples/jsm/shaders/ToneMapShader.d.ts +0 -14
three/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for three (https://threejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Thu, 25 May 2023 20:34:45 GMT
11
+ * Last updated: Thu, 06 Jul 2023 18:35:25 GMT
12
12
  * Dependencies: [@types/fflate](https://npmjs.com/package/@types/fflate), [@types/lil-gui](https://npmjs.com/package/@types/lil-gui), [@types/stats.js](https://npmjs.com/package/@types/stats.js), [@types/tweenjs__tween.js](https://npmjs.com/package/@types/tweenjs__tween.js), [@types/webxr](https://npmjs.com/package/@types/webxr)
13
13
  * Global values: `THREE`
14
14
 
@@ -17,6 +17,7 @@ export interface MMDAnimationHelperParameter {
17
17
  sync?: boolean | undefined;
18
18
  afterglow?: number | undefined;
19
19
  resetPhysicsOnLoop?: boolean | undefined;
20
+ pmxAnimation?: boolean | undefined;
20
21
  }
21
22
 
22
23
  export interface MMDAnimationHelperAddParameter {
@@ -55,6 +56,7 @@ export class MMDAnimationHelper {
55
56
  sync: boolean;
56
57
  afterglow: number;
57
58
  resetPhysicsOnLoop: boolean;
59
+ pmxAnimation: boolean;
58
60
  };
59
61
  enabled: {
60
62
  animation: boolean;
@@ -24,7 +24,7 @@ export interface CMSParameters {
24
24
  }
25
25
 
26
26
  export class CSM {
27
- constructor(data?: CMSParameters);
27
+ constructor(data: CMSParameters);
28
28
  camera: Camera;
29
29
  parent: Object3D;
30
30
  cascades: number;
@@ -13,5 +13,5 @@ export interface DRACOExporterOptions {
13
13
  export class DRACOExporter {
14
14
  constructor();
15
15
 
16
- parse(object: Mesh | Points, options: DRACOExporterOptions): Int8Array;
16
+ parse(object: Mesh | Points, options?: DRACOExporterOptions): Int8Array;
17
17
  }
@@ -1,13 +1,30 @@
1
1
  import { Object3D } from '../../../src/Three';
2
2
 
3
- export interface PLYExporterOptions {
4
- binary?: boolean;
3
+ export interface PLYExporterOptionsBase {
5
4
  excludeAttributes?: string[];
6
5
  littleEndian?: boolean;
7
6
  }
8
7
 
8
+ export interface PLYExporterOptionsBinary extends PLYExporterOptionsBase {
9
+ binary: true;
10
+ }
11
+
12
+ export interface PLYExporterOptionsString extends PLYExporterOptionsBase {
13
+ binary?: false;
14
+ }
15
+
16
+ export interface PLYExporterOptions extends PLYExporterOptionsBase {
17
+ binary?: boolean;
18
+ }
19
+
9
20
  export class PLYExporter {
10
21
  constructor();
11
22
 
12
- parse(object: Object3D, onDone: (res: string) => void, options: PLYExporterOptions): string | null;
23
+ parse(object: Object3D, onDone: (res: ArrayBuffer) => void, options: PLYExporterOptionsBinary): ArrayBuffer | null;
24
+ parse(object: Object3D, onDone: (res: string) => void, options?: PLYExporterOptionsString): string | null;
25
+ parse(
26
+ object: Object3D,
27
+ onDone: (res: string | ArrayBuffer) => void,
28
+ options?: PLYExporterOptions,
29
+ ): string | ArrayBuffer | null;
13
30
  }
@@ -1,5 +1,13 @@
1
1
  import { Object3D } from '../../../src/Three';
2
2
 
3
+ export interface STLExporterOptionsBinary {
4
+ binary: true;
5
+ }
6
+
7
+ export interface STLExporterOptionsString {
8
+ binary?: false;
9
+ }
10
+
3
11
  export interface STLExporterOptions {
4
12
  binary?: boolean;
5
13
  }
@@ -7,5 +15,7 @@ export interface STLExporterOptions {
7
15
  export class STLExporter {
8
16
  constructor();
9
17
 
10
- parse(scene: Object3D, options?: STLExporterOptions): string;
18
+ parse(scene: Object3D, options: STLExporterOptionsBinary): DataView;
19
+ parse(scene: Object3D, options?: STLExporterOptionsString): string;
20
+ parse(scene: Object3D, options?: STLExporterOptions): string | DataView;
11
21
  }
@@ -8,6 +8,6 @@ export class TeapotGeometry extends BufferGeometry {
8
8
  lid?: boolean,
9
9
  body?: boolean,
10
10
  fitLid?: boolean,
11
- blinn?: number,
11
+ blinn?: boolean,
12
12
  );
13
13
  }
@@ -199,7 +199,7 @@ export class IFCManager {
199
199
  /**
200
200
  * Removes the specified subset.
201
201
  * @param modelID ID of the IFC model.
202
- * @parent The parent where the subset is (can be any `THREE.Object3D`).
202
+ * @param parent The parent where the subset is (can be any `THREE.Object3D`).
203
203
  * @param material Material assigned to the subset, if any.
204
204
  */
205
205
  removeSubset(modelID: number, parent?: Object3D, material?: Material): void;
@@ -378,7 +378,7 @@ export class IFCModel extends Mesh {
378
378
  * @deprecated Use `IfcModel.ifcManager.removeSubset` instead.
379
379
  *
380
380
  * Removes the specified subset.
381
- * @parent The parent where the subset is (can be any `THREE.Object3D`).
381
+ * @param parent The parent where the subset is (can be any `THREE.Object3D`).
382
382
  * @param material Material assigned to the subset, if any.
383
383
  */
384
384
  removeSubset(parent?: Object3D, material?: Material): void;
@@ -602,13 +602,13 @@ export class IfcAPI {
602
602
  /**
603
603
  * Opens a model and returns a modelID number
604
604
  * @param data Buffer containing IFC data (bytes)
605
- * @param settings Settings settings for loading the model
605
+ * @param settings Settings for loading the model
606
606
  */
607
607
  OpenModel(data: string | Uint8Array, settings?: LoaderSettings): number;
608
608
 
609
609
  /**
610
610
  * Creates a new model and returns a modelID number
611
- * @param settings Settings settings for generating data the model
611
+ * @param settings Settings for generating data the model
612
612
  */
613
613
  CreateModel(settings?: LoaderSettings): number;
614
614
 
@@ -49,7 +49,7 @@ export class GPUComputationRenderer {
49
49
  magFilter: MagnificationTextureFilter,
50
50
  ): WebGLRenderTarget;
51
51
  createTexture(): DataTexture;
52
- renderTexture(input: Texture, output: Texture): void;
52
+ renderTexture(input: Texture, output: WebGLRenderTarget): void;
53
53
  doRenderTarget(material: Material, output: WebGLRenderTarget): void;
54
54
  dispose(): void;
55
55
  }
@@ -2,5 +2,5 @@ import Node from '../core/Node';
2
2
  import PositionNode from './PositionNode';
3
3
 
4
4
  export default class ModelViewProjectionNode extends Node {
5
- constructor(position?: PositionNode);
5
+ constructor(positionNode?: PositionNode);
6
6
  }
@@ -106,7 +106,7 @@ export default abstract class NodeBuilder {
106
106
  getVectorFromMatrix(type: NodeTypeOption): NodeTypeOption;
107
107
  getDataFromNode(node: Node, shaderStage?: NodeShaderStageOption): NodeData;
108
108
  getNodeProperties(node: Node, shaderStage?: NodeShaderStageOption): AnyObject;
109
- getUniformFromNode(node: Node, shaderStage: NodeShaderStageOption, type: NodeTypeOption): NodeUniform;
109
+ getUniformFromNode(node: Node, type: NodeTypeOption, shaderStage?: NodeShaderStageOption): NodeUniform;
110
110
  getVarFromNode(node: Node, type: NodeTypeOption, shaderStage?: NodeShaderStageOption): NodeVar;
111
111
  getVaryFromNode(node: Node, type: NodeTypeOption): NodeVarying;
112
112
  getCodeFromNode(node: Node, type: NodeTypeOption, shaderStage?: NodeShaderStageOption): string;
@@ -3,7 +3,7 @@ import { ShaderMaterial } from '../../../src/Three';
3
3
  import { Pass, FullScreenQuad } from './Pass';
4
4
 
5
5
  export class FilmPass extends Pass {
6
- constructor(noiseIntensity?: number, scanlinesIntensity?: number, scanlinesCount?: number, grayscale?: number);
6
+ constructor(noiseIntensity?: number, scanlinesIntensity?: number, scanlinesCount?: number, grayscale?: boolean);
7
7
  uniforms: object;
8
8
  material: ShaderMaterial;
9
9
  fsQuad: FullScreenQuad;
@@ -1,3 +1,3 @@
1
1
  import { BufferGeometry } from '../../../src/Three';
2
2
 
3
- export function UVsDebug(geometry: BufferGeometry, size: number): HTMLCanvasElement;
3
+ export function UVsDebug(geometry: BufferGeometry, size?: number): HTMLCanvasElement;
three/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for three 0.152
1
+ // Type definitions for three 0.153
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.152.1",
3
+ "version": "0.153.0",
4
4
  "description": "TypeScript definitions for three",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three",
6
6
  "license": "MIT",
@@ -31,7 +31,7 @@
31
31
  "fflate": "~0.6.9",
32
32
  "lil-gui": "~0.17.0"
33
33
  },
34
- "typesPublisherContentHash": "4a1b7a1820d0565498723427b382216d64d91a892d84b4a3ad2c73c41a5fe823",
34
+ "typesPublisherContentHash": "776e445e303f817fc78a39d4f0acdac279c33b7cc46a10995a77955c8386f84d",
35
35
  "typeScriptVersion": "4.4",
36
36
  "exports": {
37
37
  ".": {
@@ -1,7 +1,8 @@
1
- import { Matrix4 } from './../math/Matrix4';
2
- import { Vector3 } from './../math/Vector3';
3
- import { Object3D } from './../core/Object3D';
4
- import { Layers } from '../Three';
1
+ import { Matrix4 } from '../math/Matrix4';
2
+ import { Vector3 } from '../math/Vector3';
3
+ import { Object3D } from '../core/Object3D';
4
+ import { Layers } from '../core/Layers';
5
+ import { CoordinateSystem } from '../constants';
5
6
 
6
7
  /**
7
8
  * Abstract base class for cameras
@@ -59,6 +60,8 @@ export abstract class Camera extends Object3D {
59
60
  */
60
61
  projectionMatrixInverse: Matrix4;
61
62
 
63
+ coordinateSystem: CoordinateSystem;
64
+
62
65
  /**
63
66
  * Returns a {@link THREE.Vector3 | Vector3} representing the world space direction in which the {@link Camera} is looking.
64
67
  * @remarks Note: A {@link Camera} looks down its local, negative z-axis.
@@ -2,6 +2,7 @@ import { WebGLCubeRenderTarget } from './../renderers/WebGLCubeRenderTarget';
2
2
  import { Scene } from './../scenes/Scene';
3
3
  import { WebGLRenderer } from './../renderers/WebGLRenderer';
4
4
  import { Object3D } from './../core/Object3D';
5
+ import { CoordinateSystem } from '../constants';
5
6
 
6
7
  /**
7
8
  * Creates **6** {@link THREE.PerspectiveCamera | cameras} that render to a {@link THREE.WebGLCubeRenderTarget | WebGLCubeRenderTarget}.
@@ -53,6 +54,10 @@ export class CubeCamera extends Object3D {
53
54
  */
54
55
  renderTarget: WebGLCubeRenderTarget;
55
56
 
57
+ coordinateSystem: CoordinateSystem;
58
+
59
+ updateCoordinateSystem(): void;
60
+
56
61
  /**
57
62
  * Call this to update the {@link CubeCamera.renderTarget | renderTarget}.
58
63
  * @param renderer The current WebGL renderer
three/src/constants.d.ts CHANGED
@@ -323,6 +323,8 @@ export const UnsignedShort4444Type: 1017;
323
323
  export const UnsignedShort5551Type: 1018;
324
324
  export const UnsignedInt248Type: 1020;
325
325
 
326
+ export type AttributeGPUType = typeof FloatType | typeof IntType;
327
+
326
328
  /**
327
329
  * Texture Types.
328
330
  * @remarks Must correspond to the correct {@link PixelFormat | format}.
@@ -409,7 +411,7 @@ export const RGIntegerFormat: 1031;
409
411
  */
410
412
  export const RGBAIntegerFormat: 1033;
411
413
 
412
- export const _SRGBAFormat = 1035; // fallback for WebGL 1
414
+ export const _SRGBAFormat: 1035; // fallback for WebGL 1
413
415
 
414
416
  /**
415
417
  * Texture Pixel Formats Modes. Compatible only with {@link WebGLRenderingContext | WebGL 1 Rendering Context}.
@@ -709,7 +711,7 @@ export type NormalMapTypes = typeof TangentSpaceNormalMap | typeof ObjectSpaceNo
709
711
  export const NoColorSpace: '';
710
712
  export const SRGBColorSpace: 'srgb';
711
713
  export const LinearSRGBColorSpace: 'srgb-linear';
712
- export const DisplayP3ColorSpace = 'display-p3';
714
+ export const DisplayP3ColorSpace: 'display-p3';
713
715
  export type ColorSpace =
714
716
  | typeof NoColorSpace
715
717
  | typeof SRGBColorSpace
@@ -754,6 +756,24 @@ export type StencilFunc =
754
756
  | typeof GreaterEqualStencilFunc
755
757
  | typeof AlwaysStencilFunc;
756
758
 
759
+ export const NeverCompare: 512;
760
+ export const LessCompare: 513;
761
+ export const EqualCompare: 514;
762
+ export const LessEqualCompare: 515;
763
+ export const GreaterCompare: 516;
764
+ export const NotEqualCompare: 517;
765
+ export const GreaterEqualCompare: 518;
766
+ export const AlwaysCompare: 519;
767
+ export type TextureComparisonFunction =
768
+ | typeof NeverCompare
769
+ | typeof LessCompare
770
+ | typeof EqualCompare
771
+ | typeof LessEqualCompare
772
+ | typeof GreaterCompare
773
+ | typeof NotEqualCompare
774
+ | typeof GreaterEqualCompare
775
+ | typeof AlwaysCompare;
776
+
757
777
  // usage types
758
778
  export const StaticDrawUsage: 35044;
759
779
  export const DynamicDrawUsage: 35048;
@@ -779,6 +799,10 @@ export const GLSL1: '100';
779
799
  export const GLSL3: '300 es';
780
800
  export type GLSLVersion = typeof GLSL1 | typeof GLSL3;
781
801
 
802
+ export const WebGLCoordinateSystem: 2000;
803
+ export const WebGPUCoordinateSystem: 2001;
804
+ export type CoordinateSystem = typeof WebGLCoordinateSystem | typeof WebGPUCoordinateSystem;
805
+
782
806
  ///////////////////////////////////////////////////////////////////////////////
783
807
  // Texture - Internal Pixel Formats
784
808
 
@@ -1,4 +1,4 @@
1
- import { Usage } from '../constants';
1
+ import { Usage, AttributeGPUType } from '../constants';
2
2
  import { Matrix3 } from './../math/Matrix3';
3
3
  import { Matrix4 } from './../math/Matrix4';
4
4
 
@@ -66,6 +66,14 @@ export class BufferAttribute {
66
66
  */
67
67
  usage: Usage;
68
68
 
69
+ /**
70
+ * Configures the bound GPU type for use in shaders. Either {@link FloatType} or {@link IntType}, default is {@link FloatType}.
71
+ *
72
+ * Note: this only has an effect for integer arrays and is not configurable for float arrays. For lower precision
73
+ * float types, see https://threejs.org/docs/#api/en/core/bufferAttributeTypes/BufferAttributeTypes.
74
+ */
75
+ gpuType: AttributeGPUType;
76
+
69
77
  /**
70
78
  * This can be used to only update some components of stored vectors (for example, just the component related to color).
71
79
  * @defaultValue `{ offset: number = 0; count: number = -1 }`
@@ -1,5 +1,7 @@
1
1
  import { ColorRepresentation } from '../math/Color';
2
2
  import { LineSegments } from './../objects/LineSegments';
3
+ import { BufferGeometry } from '../core/BufferGeometry';
4
+ import { LineBasicMaterial } from '../materials/LineBasicMaterial';
3
5
 
4
6
  /**
5
7
  * The {@link GridHelper} is an object to define grids
@@ -16,7 +18,7 @@ import { LineSegments } from './../objects/LineSegments';
16
18
  * @see {@link https://threejs.org/docs/index.html#api/en/helpers/GridHelper | Official Documentation}
17
19
  * @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/GridHelper.js | Source}
18
20
  */
19
- export class GridHelper extends LineSegments {
21
+ export class GridHelper extends LineSegments<BufferGeometry, LineBasicMaterial> {
20
22
  /**
21
23
  * Creates a new {@link GridHelper} of size 'size' and divided into 'divisions' segments per side
22
24
  * @remarks
@@ -65,7 +65,7 @@ export class DirectionalLight extends Light<DirectionalLightShadow> {
65
65
  * This is set equal to {@link THREE.Object3D.DEFAULT_UP}, so that the light shines from the top down.
66
66
  * @defaultValue {@link Object3D.DEFAULT_UP} _(0, 1, 0)_
67
67
  */
68
- override position: Vector3;
68
+ override readonly position: Vector3;
69
69
 
70
70
  /**
71
71
  * A {@link THREE.DirectionalLightShadow | DirectionalLightShadow} used to calculate shadows for this light.
@@ -38,7 +38,7 @@ export abstract class Light<TShadowSupport extends LightShadow | undefined = Lig
38
38
 
39
39
  /**
40
40
  * The light's intensity, or strength.
41
- * In {@link THREE.WebGLRenderer.physicallyCorrectLights | physically correct} mode, the units of intensity depend on the type of light.
41
+ * When {@link THREE.WebGLRenderer.useLegacyLights | legacy lighting mode} is disabled, the units of intensity depend on the type of light.
42
42
  * @remarks Expects a `Float`
43
43
  * @defaultValue `1`
44
44
  */
@@ -37,7 +37,7 @@ export class PointLight extends Light<PointLightShadow> {
37
37
  /**
38
38
  * The light's intensity.
39
39
  *
40
- * When **{@link WebGLRenderer.physicallyCorrectLights | physically correct} mode** — intensity is the luminous intensity of the light measured in candela (cd).
40
+ * When **{@link WebGLRenderer.useLegacyLights | legacy lighting mode} is disabled** — intensity is the luminous intensity of the light measured in candela (cd).
41
41
  * @remarks Changing the intensity will also change the light's power.
42
42
  * @remarks Expects a `Float`
43
43
  * @defaultValue `1`
@@ -48,7 +48,7 @@ export class PointLight extends Light<PointLightShadow> {
48
48
  * When **Default mode** — When distance is zero, light does not attenuate. When distance is non-zero,
49
49
  * light will attenuate linearly from maximum intensity at the light's position down to zero at this distance from the light.
50
50
  *
51
- * When **{@link WebGLRenderer.physicallyCorrectLights | Physically correct} rendering mode** — When distance is zero,
51
+ * When **{@link WebGLRenderer.useLegacyLights | legacy lighting mode} is disabled** — When distance is zero,
52
52
  * light will attenuate according to inverse-square law to infinite distance.
53
53
  * When distance is non-zero, light will attenuate according to inverse-square law until near the distance cutoff,
54
54
  * where it will then attenuate quickly and smoothly to 0. Inherently, cutoffs are not physically correct.
@@ -68,7 +68,7 @@ export class PointLight extends Light<PointLightShadow> {
68
68
 
69
69
  /**
70
70
  * The amount the light dims along the distance of the light.
71
- * In **{@link WebGLRenderer.physicallyCorrectLights | physically correct} rendering mode** — the default value **should not** be changed.
71
+ * In context of physically-correct rendering the default value should not be changed.
72
72
  * @remarks Expects a `Float`
73
73
  * @defaultValue `2`
74
74
  */
@@ -87,7 +87,7 @@ export class PointLight extends Light<PointLightShadow> {
87
87
 
88
88
  /**
89
89
  * The light's power.
90
- * When **{@link WebGLRenderer.physicallyCorrectLights | physically correct} rendering mode** — power is the luminous power of the light measured in lumens (lm).
90
+ * When **{@link WebGLRenderer.useLegacyLights | legacy lighting mode} is disabled** — power is the luminous power of the light measured in lumens (lm).
91
91
  * @remarks Changing the power will also change the light's intensity.
92
92
  * @remarks Expects a `Float`
93
93
  */
@@ -66,7 +66,7 @@ export class RectAreaLight extends Light<undefined> {
66
66
  /**
67
67
  * The light's intensity.
68
68
  * @remarks Changing the intensity will also change the light's power.
69
- * In **{@link WebGLRenderer.physicallyCorrectLights | physically correct} rendering mode** — intensity is the luminance (brightness) of the light measured in nits (cd/m^2).
69
+ * When **{@link WebGLRenderer.useLegacyLights | legacy lighting mode} is disabled** — intensity is the luminance (brightness) of the light measured in nits (cd/m^2).
70
70
  * @remarks Expects a `Float`
71
71
  * @defaultValue `1`
72
72
  */
@@ -75,7 +75,7 @@ export class RectAreaLight extends Light<undefined> {
75
75
  /**
76
76
  * The light's power.
77
77
  * @remarks Changing the power will also change the light's intensity.
78
- * In **{@link WebGLRenderer.physicallyCorrectLights | physically correct} rendering mode** — power is the luminous power of the light measured in lumens (lm).
78
+ * When **{@link WebGLRenderer.useLegacyLights | legacy lighting mode} is disabled** — power is the luminous power of the light measured in lumens (lm).
79
79
  * @remarks Expects a `Float`
80
80
  */
81
81
  power: number;
@@ -63,7 +63,7 @@ export class SpotLight extends Light<SpotLightShadow> {
63
63
  * This is set equal to {@link THREE.Object3D.DEFAULT_UP | Object3D.DEFAULT_UP} (0, 1, 0), so that the light shines from the top down.
64
64
  * @defaultValue `{@link Object3D.DEFAULT_UP}`
65
65
  */
66
- position: Vector3;
66
+ readonly position: Vector3;
67
67
 
68
68
  /**
69
69
  * The {@link SpotLight} points from its {@link SpotLight.position | position} to target.position.
@@ -97,7 +97,7 @@ export class SpotLight extends Light<SpotLightShadow> {
97
97
  /**
98
98
  * The light's intensity.
99
99
  * @remarks Changing the intensity will also change the light's power.
100
- * When **{@link WebGLRenderer.physicallyCorrectLights | Physically correct} rendering mode** — intensity is the luminous intensity of the light measured in candela (cd).
100
+ * When **{@link WebGLRenderer.useLegacyLights | legacy lighting mode} is disabled** — intensity is the luminous intensity of the light measured in candela (cd).
101
101
  * @remarks Expects a `Float`
102
102
  * @defaultValue `1`
103
103
  */
@@ -107,7 +107,7 @@ export class SpotLight extends Light<SpotLightShadow> {
107
107
  * When **Default mode** — When distance is zero, light does not attenuate. When distance is non-zero,
108
108
  * light will attenuate linearly from maximum intensity at the light's position down to zero at this distance from the light.
109
109
  *
110
- * When **{@link WebGLRenderer.physicallyCorrectLights | Physically correct} rendering mode** — When distance is zero,
110
+ * When **{@link WebGLRenderer.useLegacyLights | legacy lighting mode} is disabled** — When distance is zero,
111
111
  * light will attenuate according to inverse-square law to infinite distance.
112
112
  * When distance is non-zero, light will attenuate according to inverse-square law until near the distance cutoff,
113
113
  * where it will then attenuate quickly and smoothly to `0`. Inherently, cutoffs are not physically correct.
@@ -126,7 +126,7 @@ export class SpotLight extends Light<SpotLightShadow> {
126
126
 
127
127
  /**
128
128
  * The amount the light dims along the distance of the light.
129
- * In **{@link WebGLRenderer.physicallyCorrectLights | physically correct} rendering mode** — the default value should not be changed.
129
+ * In context of physically-correct rendering the default value should not be changed.
130
130
  * @remarks Expects a `Float`
131
131
  * @defaultValue `2`
132
132
  */
@@ -141,7 +141,7 @@ export class SpotLight extends Light<SpotLightShadow> {
141
141
  /**
142
142
  * The light's power.
143
143
  * @remarks Changing the power will also change the light's intensity.
144
- * In **{@link WebGLRenderer.physicallyCorrectLights | physically correct} rendering mode** — power is the luminous power of the light measured in lumens (lm).
144
+ * When **{@link WebGLRenderer.useLegacyLights | legacy lighting mode} is disabled** — power is the luminous power of the light measured in lumens (lm).
145
145
  * @remarks Expects a `Float`
146
146
  */
147
147
  power: number;
@@ -39,6 +39,10 @@ export interface MeshPhysicalMaterialParameters extends MeshStandardMaterialPara
39
39
  iridescence?: number | undefined;
40
40
  iridescenceThicknessRange?: [number, number] | undefined;
41
41
  iridescenceThicknessMap?: Texture | null | undefined;
42
+
43
+ anisotropy?: number | undefined;
44
+ anisotropyRotation?: number | undefined;
45
+ anisotropyMap?: Texture | null | undefined;
42
46
  }
43
47
 
44
48
  export class MeshPhysicalMaterial extends MeshStandardMaterial {
@@ -193,4 +197,19 @@ export class MeshPhysicalMaterial extends MeshStandardMaterial {
193
197
  * @default null
194
198
  */
195
199
  iridescenceThicknessMap: Texture | null;
200
+
201
+ /**
202
+ * @default 0
203
+ */
204
+ anisotropy?: number;
205
+
206
+ /**
207
+ * @default 0
208
+ */
209
+ anisotropyRotation?: number;
210
+
211
+ /**
212
+ * @default null
213
+ */
214
+ anisotropyMap?: Texture | null;
196
215
  }
three/src/math/Color.d.ts CHANGED
@@ -204,7 +204,8 @@ export class Color {
204
204
  */
205
205
  b: number;
206
206
 
207
- set(color: ColorRepresentation): Color;
207
+ set(color: ColorRepresentation): this;
208
+ set(r: number, g: number, b: number): this;
208
209
 
209
210
  /**
210
211
  * Sets this color's {@link r}, {@link g} and {@link b} components from the x, y, and z components of the specified
@@ -5,6 +5,7 @@ import { Sprite } from './../objects/Sprite';
5
5
  import { Sphere } from './Sphere';
6
6
  import { Box3 } from './Box3';
7
7
  import { Vector3 } from './Vector3';
8
+ import { CoordinateSystem } from '../constants';
8
9
 
9
10
  /**
10
11
  * Frustums are used to determine what is inside the camera's field of view. They help speed up the rendering process.
@@ -20,7 +21,7 @@ export class Frustum {
20
21
  set(p0: Plane, p1: Plane, p2: Plane, p3: Plane, p4: Plane, p5: Plane): Frustum;
21
22
  clone(): this;
22
23
  copy(frustum: Frustum): this;
23
- setFromProjectionMatrix(m: Matrix4): this;
24
+ setFromProjectionMatrix(m: Matrix4, coordinateSystem?: CoordinateSystem): this;
24
25
  intersectsObject(object: Object3D): boolean;
25
26
  intersectsSprite(sprite: Sprite): boolean;
26
27
  intersectsSphere(sphere: Sphere): boolean;
@@ -5,6 +5,7 @@ import { Quaternion } from './Quaternion';
5
5
  */
6
6
 
7
7
  export const DEG2RAD: number;
8
+
8
9
  export const RAD2DEG: number;
9
10
 
10
11
  export function generateUUID(): string;
@@ -13,10 +14,11 @@ export function generateUUID(): string;
13
14
  * Clamps the x to be between a and b.
14
15
  *
15
16
  * @param value Value to be clamped.
16
- * @param min Minimum value
17
+ * @param min Minimum value.
17
18
  * @param max Maximum value.
18
19
  */
19
20
  export function clamp(value: number, min: number, max: number): number;
21
+
20
22
  export function euclideanModulo(n: number, m: number): number;
21
23
 
22
24
  /**
@@ -30,44 +32,6 @@ export function euclideanModulo(n: number, m: number): number;
30
32
  */
31
33
  export function mapLinear(x: number, a1: number, a2: number, b1: number, b2: number): number;
32
34
 
33
- export function smoothstep(x: number, min: number, max: number): number;
34
-
35
- export function smootherstep(x: number, min: number, max: number): number;
36
-
37
- /**
38
- * Random float from 0 to 1 with 16 bits of randomness.
39
- * Standard Math.random() creates repetitive patterns when applied over larger space.
40
- *
41
- * @deprecated Use {@link Math#random Math.random()}
42
- */
43
- export function random16(): number;
44
-
45
- /**
46
- * Random integer from low to high interval.
47
- */
48
- export function randInt(low: number, high: number): number;
49
-
50
- /**
51
- * Random float from low to high interval.
52
- */
53
- export function randFloat(low: number, high: number): number;
54
-
55
- /**
56
- * Random float from - range / 2 to range / 2 interval.
57
- */
58
- export function randFloatSpread(range: number): number;
59
-
60
- /**
61
- * Deterministic pseudo-random float in the interval [ 0, 1 ].
62
- */
63
- export function seededRandom(seed?: number): number;
64
-
65
- export function degToRad(degrees: number): number;
66
-
67
- export function radToDeg(radians: number): number;
68
-
69
- export function isPowerOfTwo(value: number): boolean;
70
-
71
35
  export function inverseLerp(x: number, y: number, t: number): number;
72
36
 
73
37
  /**
@@ -99,18 +63,75 @@ export function damp(x: number, y: number, lambda: number, dt: number): number;
99
63
  */
100
64
  export function pingpong(x: number, length?: number): number;
101
65
 
66
+ export function smoothstep(x: number, min: number, max: number): number;
67
+
68
+ export function smootherstep(x: number, min: number, max: number): number;
69
+
102
70
  /**
103
- * @deprecated Use {@link Math#floorPowerOfTwo .floorPowerOfTwo()}
71
+ * Random integer from low to high interval.
104
72
  */
105
- export function nearestPowerOfTwo(value: number): number;
73
+ export function randInt(low: number, high: number): number;
106
74
 
107
75
  /**
108
- * @deprecated Use {@link Math#ceilPowerOfTwo .ceilPowerOfTwo()}
76
+ * Random float from low to high interval.
109
77
  */
110
- export function nextPowerOfTwo(value: number): number;
78
+ export function randFloat(low: number, high: number): number;
111
79
 
112
- export function floorPowerOfTwo(value: number): number;
80
+ /**
81
+ * Random float from - range / 2 to range / 2 interval.
82
+ */
83
+ export function randFloatSpread(range: number): number;
84
+
85
+ /**
86
+ * Deterministic pseudo-random float in the interval [ 0, 1 ].
87
+ */
88
+ export function seededRandom(seed?: number): number;
89
+
90
+ export function degToRad(degrees: number): number;
91
+
92
+ export function radToDeg(radians: number): number;
93
+
94
+ export function isPowerOfTwo(value: number): boolean;
113
95
 
114
96
  export function ceilPowerOfTwo(value: number): number;
115
97
 
98
+ export function floorPowerOfTwo(value: number): number;
99
+
116
100
  export function setQuaternionFromProperEuler(q: Quaternion, a: number, b: number, c: number, order: string): void;
101
+
102
+ export function denormalize(
103
+ value: number,
104
+ array: Float32Array | Uint32Array | Uint16Array | Uint8Array | Int32Array | Int16Array | Int8Array,
105
+ ): number;
106
+
107
+ export function normalize(
108
+ value: number,
109
+ array: Float32Array | Uint32Array | Uint16Array | Uint8Array | Int32Array | Int16Array | Int8Array,
110
+ ): number;
111
+
112
+ export const MathUtils: {
113
+ DEG2RAD: typeof DEG2RAD;
114
+ RAD2DEG: typeof RAD2DEG;
115
+ generateUUID: typeof generateUUID;
116
+ clamp: typeof clamp;
117
+ euclideanModulo: typeof euclideanModulo;
118
+ mapLinear: typeof mapLinear;
119
+ inverseLerp: typeof inverseLerp;
120
+ lerp: typeof lerp;
121
+ damp: typeof damp;
122
+ pingpong: typeof pingpong;
123
+ smoothstep: typeof smoothstep;
124
+ smootherstep: typeof smootherstep;
125
+ randInt: typeof randInt;
126
+ randFloat: typeof randFloat;
127
+ randFloatSpread: typeof randFloatSpread;
128
+ seededRandom: typeof seededRandom;
129
+ degToRad: typeof degToRad;
130
+ radToDeg: typeof radToDeg;
131
+ isPowerOfTwo: typeof isPowerOfTwo;
132
+ ceilPowerOfTwo: typeof ceilPowerOfTwo;
133
+ floorPowerOfTwo: typeof floorPowerOfTwo;
134
+ setQuaternionFromProperEuler: typeof setQuaternionFromProperEuler;
135
+ normalize: typeof normalize;
136
+ denormalize: typeof denormalize;
137
+ };
@@ -1,6 +1,7 @@
1
1
  // https://threejs.org/docs/#api/en/math/Matrix3
2
2
 
3
3
  import { Matrix4 } from './Matrix4';
4
+ import { Vector2 } from './Vector2';
4
5
  import { Vector3 } from './Vector3';
5
6
 
6
7
  export type Matrix3Tuple = [number, number, number, number, number, number, number, number, number];
@@ -55,6 +56,20 @@ export class Matrix3 implements Matrix {
55
56
  * Creates an identity matrix.
56
57
  */
57
58
  constructor();
59
+ /**
60
+ * Creates a 3x3 matrix with the given arguments in row-major order.
61
+ */
62
+ constructor(
63
+ n11: number,
64
+ n12: number,
65
+ n13: number,
66
+ n21: number,
67
+ n22: number,
68
+ n23: number,
69
+ n31: number,
70
+ n32: number,
71
+ n33: number,
72
+ );
58
73
 
59
74
  /**
60
75
  * Array with matrix values.
@@ -113,8 +128,8 @@ export class Matrix3 implements Matrix {
113
128
  * @param x the amount to translate in the X axis.
114
129
  * @param y the amount to translate in the Y axis.
115
130
  */
131
+ makeTranslation(v: Vector2): this;
116
132
  makeTranslation(x: number, y: number): this;
117
- makeTranslation(x: number, y: number): Matrix3;
118
133
 
119
134
  /**
120
135
  * Sets this matrix as a 2D rotational transformation by theta radians. The resulting matrix will be:
@@ -2,6 +2,7 @@ import { Vector3 } from './Vector3';
2
2
  import { Euler } from './Euler';
3
3
  import { Quaternion } from './Quaternion';
4
4
  import { Matrix, Matrix3 } from './Matrix3';
5
+ import { CoordinateSystem } from '../constants';
5
6
 
6
7
  export type Matrix4Tuple = [
7
8
  number,
@@ -41,7 +42,31 @@ export type Matrix4Tuple = [
41
42
  * m.multiply( m3 );
42
43
  */
43
44
  export class Matrix4 implements Matrix {
45
+ /**
46
+ * Creates an identity matrix.
47
+ */
44
48
  constructor();
49
+ /**
50
+ * Creates a 4x4 matrix with the given arguments in row-major order.
51
+ */
52
+ constructor(
53
+ n11: number,
54
+ n12: number,
55
+ n13: number,
56
+ n14: number,
57
+ n21: number,
58
+ n22: number,
59
+ n23: number,
60
+ n24: number,
61
+ n31: number,
62
+ n32: number,
63
+ n33: number,
64
+ n34: number,
65
+ n41: number,
66
+ n42: number,
67
+ n43: number,
68
+ n44: number,
69
+ );
45
70
 
46
71
  /**
47
72
  * Array with matrix values.
@@ -147,7 +172,8 @@ export class Matrix4 implements Matrix {
147
172
  /**
148
173
  * Sets this matrix as translation transform.
149
174
  */
150
- makeTranslation(x: number, y: number, z: number): Matrix4;
175
+ makeTranslation(v: Vector3): this;
176
+ makeTranslation(x: number, y: number, z: number): this;
151
177
 
152
178
  /**
153
179
  * Sets this matrix as rotation transform around x axis by theta radians.
@@ -199,20 +225,31 @@ export class Matrix4 implements Matrix {
199
225
  */
200
226
  decompose(translation: Vector3, rotation: Quaternion, scale: Vector3): Matrix4;
201
227
 
202
- /**
203
- * Creates a frustum matrix.
204
- */
205
- makePerspective(left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix4;
206
-
207
228
  /**
208
229
  * Creates a perspective projection matrix.
209
230
  */
210
- makePerspective(fov: number, aspect: number, near: number, far: number): Matrix4;
231
+ makePerspective(
232
+ left: number,
233
+ right: number,
234
+ top: number,
235
+ bottom: number,
236
+ near: number,
237
+ far: number,
238
+ coordinateSystem?: CoordinateSystem,
239
+ ): Matrix4;
211
240
 
212
241
  /**
213
242
  * Creates an orthographic projection matrix.
214
243
  */
215
- makeOrthographic(left: number, right: number, top: number, bottom: number, near: number, far: number): Matrix4;
244
+ makeOrthographic(
245
+ left: number,
246
+ right: number,
247
+ top: number,
248
+ bottom: number,
249
+ near: number,
250
+ far: number,
251
+ coordinateSystem?: CoordinateSystem,
252
+ ): Matrix4;
216
253
  equals(matrix: Matrix4): boolean;
217
254
 
218
255
  /**
@@ -448,4 +448,9 @@ export class Vector2 implements Vector {
448
448
  * Sets this vector's x and y from Math.random
449
449
  */
450
450
  random(): this;
451
+
452
+ /**
453
+ * Iterating through a Vector2 instance will yield its components (x, y) in the corresponding order.
454
+ */
455
+ [Symbol.iterator](): Iterator<number>;
451
456
  }
@@ -301,4 +301,9 @@ export class Vector3 implements Vector {
301
301
  random(): this;
302
302
 
303
303
  randomDirection(): this;
304
+
305
+ /**
306
+ * Iterating through a Vector3 instance will yield its components (x, y, z) in the corresponding order.
307
+ */
308
+ [Symbol.iterator](): Iterator<number>;
304
309
  }
@@ -220,4 +220,9 @@ export class Vector4 implements Vector {
220
220
  * Sets this vector's x, y, z and w from Math.random
221
221
  */
222
222
  random(): this;
223
+
224
+ /**
225
+ * Iterating through a Vector4 instance will yield its components (x, y, z, w) in the corresponding order.
226
+ */
227
+ [Symbol.iterator](): Iterator<number>;
223
228
  }
@@ -14,7 +14,7 @@ import { WebGLRenderTarget } from './WebGLRenderTarget';
14
14
  import { WebGLMultipleRenderTargets } from './WebGLMultipleRenderTargets';
15
15
  import { Object3D } from './../core/Object3D';
16
16
  import { Material } from './../materials/Material';
17
- import { ToneMapping, ShadowMapType, CullFace, TextureEncoding, ColorSpace } from '../constants';
17
+ import { ToneMapping, ShadowMapType, CullFace, TextureEncoding, ColorSpace, WebGLCoordinateSystem } from '../constants';
18
18
  import { WebXRManager } from '../renderers/webxr/WebXRManager';
19
19
  import { BufferGeometry } from './../core/BufferGeometry';
20
20
  import { OffscreenCanvas, Texture } from '../textures/Texture';
@@ -200,6 +200,8 @@ export class WebGLRenderer implements Renderer {
200
200
  */
201
201
  outputColorSpace: ColorSpace;
202
202
 
203
+ get coordinateSystem(): typeof WebGLCoordinateSystem;
204
+
203
205
  /**
204
206
  * @default true
205
207
  */
@@ -26,31 +26,48 @@ export class WebXRManager extends EventDispatcher {
26
26
 
27
27
  /**
28
28
  * @default true
29
+ * @deprecated
29
30
  */
30
31
  cameraAutoUpdate: boolean;
31
32
 
32
33
  getController(index: number): XRTargetRaySpace;
34
+
33
35
  getControllerGrip(index: number): XRGripSpace;
36
+
34
37
  getHand(index: number): XRHandSpace;
38
+
35
39
  setFramebufferScaleFactor(value: number): void;
40
+
36
41
  setReferenceSpaceType(value: XRReferenceSpaceType): void;
42
+
37
43
  getReferenceSpace(): XRReferenceSpace | null;
44
+
38
45
  setReferenceSpace(value: XRReferenceSpace): void;
46
+
39
47
  getBaseLayer(): XRWebGLLayer | XRProjectionLayer;
48
+
40
49
  getBinding(): XRWebGLBinding;
50
+
41
51
  getFrame(): XRFrame;
52
+
42
53
  getSession(): XRSession | null;
54
+
43
55
  setSession(value: XRSession | null): Promise<void>;
56
+
57
+ /**
58
+ * @deprecated
59
+ */
44
60
  getCamera(): WebXRArrayCamera;
45
- updateCamera(camera: PerspectiveCamera): void;
61
+
62
+ setUserCamera(camera: PerspectiveCamera): void;
63
+
64
+ updateCameraXR(camera: PerspectiveCamera): void;
65
+
46
66
  setAnimationLoop(callback: XRFrameRequestCallback | null): void;
67
+
47
68
  getFoveation(): number | undefined;
48
- setFoveation(value: number): void;
49
69
 
50
- /**
51
- * Returns the set of planes detected by WebXR's plane detection API.
52
- */
53
- getPlanes(): Set<XRPlane>;
70
+ setFoveation(value: number): void;
54
71
 
55
72
  dispose(): void;
56
73
  }
@@ -6,6 +6,7 @@ import {
6
6
  DeepTexturePixelFormat,
7
7
  MagnificationTextureFilter,
8
8
  MinificationTextureFilter,
9
+ TextureComparisonFunction,
9
10
  } from '../constants';
10
11
 
11
12
  /**
@@ -95,4 +96,12 @@ export class DepthTexture extends Texture {
95
96
  * @defaultValue {@link THREE.UnsignedInt248Type} when {@link format | .format} === {@link THREE.DepthStencilFormat}
96
97
  */
97
98
  type: TextureDataType;
99
+
100
+ /**
101
+ * This is used to define the comparison function used when comparing texels in the depth texture to the value in
102
+ * the depth buffer. Default is `null` which means comparison is disabled.
103
+ *
104
+ * See {@link THREE.TextureComparisonFunction} for functions.
105
+ */
106
+ compareFunction: TextureComparisonFunction | null;
98
107
  }
@@ -1,5 +1,5 @@
1
1
  import { Texture } from './Texture';
2
- import { MagnificationTextureFilter, MinificationTextureFilter, PixelFormat } from '../constants';
2
+ import { MagnificationTextureFilter, MinificationTextureFilter } from '../constants';
3
3
 
4
4
  /**
5
5
  * This class can only be used in combination with {@link THREE.WebGLRenderer.copyFramebufferToTexture | WebGLRenderer.copyFramebufferToTexture()}.
@@ -32,9 +32,8 @@ export class FramebufferTexture extends Texture {
32
32
  * Create a new instance of {@link FramebufferTexture}
33
33
  * @param width The width of the texture.
34
34
  * @param height The height of the texture.
35
- * @param format See {@link Texture.format | .format}. Default {@link THREE.RGBAFormat}.
36
35
  */
37
- constructor(width: number, height: number, format: PixelFormat);
36
+ constructor(width: number, height: number);
38
37
 
39
38
  /**
40
39
  * Read-only flag to check if a given object is of type {@link FramebufferTexture}.
@@ -17,6 +17,8 @@ export class Source {
17
17
  */
18
18
  readonly isSource: true;
19
19
 
20
+ readonly id: number;
21
+
20
22
  /**
21
23
  * The actual data of a texture.
22
24
  * @remarks The type of this property depends on the texture that uses this instance.
@@ -1,22 +0,0 @@
1
- import { Object3D } from '../../../src/Three';
2
-
3
- export interface ColladaExporterOptions {
4
- author?: string;
5
- textureDirectory?: string;
6
- version?: string;
7
- }
8
-
9
- export interface ColladaExporterResult {
10
- data: string;
11
- textures: object[];
12
- }
13
-
14
- export class ColladaExporter {
15
- constructor();
16
-
17
- parse(
18
- object: Object3D,
19
- onDone: (res: ColladaExporterResult) => void,
20
- options: ColladaExporterOptions,
21
- ): ColladaExporterResult | null;
22
- }
@@ -1,108 +0,0 @@
1
- import { BufferGeometry, Vector3 } from '../../../src/Three';
2
-
3
- export interface RandomGenerator {
4
- random(): number;
5
- getSeed(): number;
6
- setSeed(seed: number): void;
7
- }
8
-
9
- export interface LightningSegment {
10
- iteration: number;
11
- pos0: Vector3;
12
- pos1: Vector3;
13
- linPos0: Vector3;
14
- linPos1: Vector3;
15
- up0: Vector3;
16
- up1: Vector3;
17
- radius0: number;
18
- radius1: number;
19
- fraction0: number;
20
- fraction1: number;
21
- positionVariationFactor: number;
22
- }
23
-
24
- export interface LightningSubray {
25
- seed: number;
26
- maxIterations: number;
27
- recursion: number;
28
- pos0: Vector3;
29
- pos1: Vector3;
30
- linPos0: Vector3;
31
- linPos1: Vector3;
32
- up0: Vector3;
33
- up1: Vector3;
34
- radius0: number;
35
- radius1: number;
36
- birthTime: number;
37
- deathTime: number;
38
- timeScale: number;
39
- roughness: number;
40
- straightness: number;
41
- propagationTimeFactor: number;
42
- vanishingTimeFactor: number;
43
- endPropagationTime: number;
44
- beginVanishingTime: number;
45
- }
46
-
47
- export interface RayParameters {
48
- sourceOffset?: Vector3;
49
- destOffset?: Vector3;
50
-
51
- timeScale?: number;
52
- roughness?: number;
53
- straightness?: number;
54
-
55
- up0?: Vector3;
56
- up1?: Vector3;
57
- radius0?: number;
58
- radius1?: number;
59
- radius0Factor?: number;
60
- radius1Factor?: number;
61
- minRadius?: number;
62
-
63
- isEternal?: boolean;
64
- birthTime?: number;
65
- deathTime?: number;
66
- propagationTimeFactor?: number;
67
- vanishingTimeFactor?: number;
68
- subrayPeriod?: number;
69
- subrayDutyCycle?: number;
70
-
71
- maxIterations?: number;
72
- isStatic?: boolean;
73
- ramification?: number;
74
- maxSubrayRecursion?: number;
75
- recursionProbability?: number;
76
- generateUVs?: boolean;
77
-
78
- randomGenerator?: RandomGenerator;
79
- noiseSeed?: number;
80
-
81
- onDecideSubrayCreation?: (segment: LightningSegment, lightningStrike: LightningStrike) => void;
82
- onSubrayCreation?: (
83
- segment: LightningSegment,
84
- parentSubray: LightningSubray,
85
- childSubray: LightningSubray,
86
- lightningStrike: LightningStrike,
87
- ) => void;
88
- }
89
-
90
- export class LightningStrike extends BufferGeometry {
91
- constructor(rayParameters?: RayParameters);
92
- copyParameters(dest?: RayParameters, source?: RayParameters): RayParameters;
93
-
94
- // Ray states
95
- static readonly RAY_INITIALIZED: number;
96
- static readonly RAY_UNBORN: number;
97
- static readonly RAY_PROPAGATING: number;
98
- static readonly RAY_STEADY: number;
99
- static readonly RAY_VANISHING: number;
100
- static readonly RAY_EXTINGUISHED: number;
101
-
102
- state: number;
103
-
104
- update(time: number): void;
105
-
106
- copy(source: LightningStrike): this;
107
- clone(): this;
108
- }
@@ -1,16 +0,0 @@
1
- import { BufferGeometry, Loader, LoadingManager } from '../../../src/Three';
2
-
3
- export class PRWMLoader extends Loader {
4
- constructor(manager?: LoadingManager);
5
-
6
- load(
7
- url: string,
8
- onLoad: (geometry: BufferGeometry) => void,
9
- onProgress?: (event: ProgressEvent) => void,
10
- onError?: (event: ErrorEvent) => void,
11
- ): void;
12
- loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise<BufferGeometry>;
13
- parse(data: ArrayBuffer): BufferGeometry;
14
-
15
- static isBigEndianPlatform(): boolean;
16
- }
@@ -1,32 +0,0 @@
1
- import { Material, Object3D, Vector3 } from '../../../src/Three';
2
-
3
- import { LightningStrike, RayParameters } from '../geometries/LightningStrike';
4
-
5
- export interface StormParams {
6
- size?: number;
7
- minHeight?: number;
8
- maxHeight?: number;
9
- maxSlope?: number;
10
-
11
- maxLightnings?: number;
12
-
13
- lightningMinPeriod?: number;
14
- lightningMaxPeriod?: number;
15
- lightningMinDuration?: number;
16
- lightningMaxDuration?: number;
17
-
18
- lightningParameters?: RayParameters;
19
- lightningMaterial?: Material;
20
-
21
- isEternal?: boolean;
22
-
23
- onRayPosition?: (source: Vector3, dest: Vector3) => void;
24
- onLightningDown?: (lightning: LightningStrike) => void;
25
- }
26
-
27
- export class LightningStorm extends Object3D {
28
- constructor(stormParams?: StormParams);
29
- update(time: number): void;
30
- copy(source: LightningStorm, recursive?: boolean): this;
31
- clone(): this;
32
- }
@@ -1,29 +0,0 @@
1
- import { WebGLRenderTarget, ShaderMaterial } from '../../../src/Three';
2
-
3
- import { Pass, FullScreenQuad } from './Pass';
4
-
5
- export class AdaptiveToneMappingPass extends Pass {
6
- constructor(adaptive?: boolean, resolution?: number);
7
- adaptive: boolean;
8
- resolution: number;
9
- needsInit: number;
10
- luminanceRT: WebGLRenderTarget;
11
- previousLuminanceRT: WebGLRenderTarget;
12
- currentLuminanceRT: WebGLRenderTarget;
13
- copyUniforms: object;
14
- materialCopy: ShaderMaterial;
15
- materialLuminance: ShaderMaterial;
16
- adaptLuminanceShader: object;
17
- materialAdaptiveLum: ShaderMaterial;
18
- materialToneMap: ShaderMaterial;
19
- fsQuad: FullScreenQuad;
20
-
21
- reset(): void;
22
- setAdaptive(adaptive: boolean): void;
23
- setAdaptionRate(rate: number): void;
24
- setMinLuminance(minLum: number): void;
25
- setMaxLuminance(maxLum: number): void;
26
- setAverageLuminance(avgLum: number): void;
27
- setMiddleGrey(middleGrey: number): void;
28
- dispose(): void;
29
- }
@@ -1,14 +0,0 @@
1
- import { IUniform } from '../../../src/Three';
2
-
3
- export const ToneMapShader: {
4
- uniforms: {
5
- tDiffuse: IUniform;
6
- averageLuminance: IUniform;
7
- luminanceMap: IUniform;
8
- maxLuminance: IUniform;
9
- minLuminance: IUniform;
10
- middleGrey: IUniform;
11
- };
12
- vertexShader: string;
13
- fragmentShader: string;
14
- };