@types/three 0.150.2 → 0.152.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 (118) hide show
  1. three/README.md +2 -2
  2. three/build/three.min.d.ts +2 -0
  3. three/build/three.module.min.d.ts +2 -0
  4. three/examples/jsm/controls/MapControls.d.ts +21 -0
  5. three/examples/jsm/controls/OrbitControls.d.ts +1 -5
  6. three/examples/jsm/controls/PointerLockControls.d.ts +3 -0
  7. three/examples/jsm/controls/TrackballControls.d.ts +2 -0
  8. three/examples/jsm/helpers/ViewHelper.d.ts +3 -4
  9. three/examples/jsm/libs/tween.module.d.ts +2 -0
  10. three/examples/jsm/loaders/GLTFLoader.d.ts +2 -4
  11. three/examples/jsm/loaders/SVGLoader.d.ts +15 -3
  12. three/examples/jsm/nodes/Nodes.d.ts +131 -226
  13. three/examples/jsm/nodes/{core → code}/CodeNode.d.ts +2 -3
  14. three/examples/jsm/nodes/{core → code}/ExpressionNode.d.ts +2 -2
  15. three/examples/jsm/nodes/{core → code}/FunctionCallNode.d.ts +2 -2
  16. three/examples/jsm/nodes/{core → code}/FunctionNode.d.ts +4 -4
  17. three/examples/jsm/nodes/core/InputNode.d.ts +4 -0
  18. three/examples/jsm/nodes/core/NodeBuilder.d.ts +1 -11
  19. three/examples/jsm/nodes/core/NodeUtils.d.ts +8 -2
  20. three/examples/jsm/nodes/core/{VaryNode.d.ts → VaryingNode.d.ts} +1 -1
  21. three/examples/jsm/nodes/core/constants.d.ts +1 -0
  22. three/examples/jsm/nodes/fog/FogNode.d.ts +1 -1
  23. three/examples/jsm/nodes/geometry/RangeNode.d.ts +2 -1
  24. three/examples/jsm/nodes/lighting/LightUtils.d.ts +4 -0
  25. three/examples/jsm/nodes/lighting/PointLightNode.d.ts +10 -0
  26. three/examples/jsm/nodes/lighting/SpotLightNode.d.ts +15 -0
  27. three/examples/jsm/nodes/materials/LineBasicNodeMaterial.d.ts +0 -7
  28. three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.d.ts +0 -9
  29. three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +0 -9
  30. three/examples/jsm/nodes/materials/NodeMaterial.d.ts +17 -1
  31. three/examples/jsm/nodes/math/MathNode.d.ts +2 -2
  32. three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +2 -2
  33. three/examples/jsm/nodes/shadernode/ShaderNodeElements.d.ts +0 -2
  34. three/examples/jsm/objects/{GroundProjectedEnv.d.ts → GroundProjectedSkybox.d.ts} +1 -1
  35. three/examples/jsm/postprocessing/Pass.d.ts +2 -0
  36. three/examples/jsm/renderers/CSS2DRenderer.d.ts +2 -1
  37. three/examples/jsm/renderers/CSS3DRenderer.d.ts +2 -2
  38. three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +1 -21
  39. three/examples/jsm/utils/BufferGeometryUtils.d.ts +12 -2
  40. three/examples/jsm/utils/SkeletonUtils.d.ts +3 -19
  41. three/index.d.ts +1 -1
  42. three/package.json +3 -2
  43. three/src/Three.d.ts +1 -0
  44. three/src/constants.d.ts +3 -23
  45. three/src/core/BufferGeometry.d.ts +60 -33
  46. three/src/core/Raycaster.d.ts +2 -1
  47. three/src/extras/DataUtils.d.ts +13 -0
  48. three/src/extras/Earcut.d.ts +12 -0
  49. three/src/extras/ImageUtils.d.ts +20 -20
  50. three/src/extras/PMREMGenerator.d.ts +66 -0
  51. three/src/extras/ShapeUtils.d.ts +19 -1
  52. three/src/extras/core/Curve.d.ts +86 -31
  53. three/src/extras/core/CurvePath.d.ts +46 -4
  54. three/src/extras/core/Interpolations.d.ts +36 -0
  55. three/src/extras/core/Path.d.ts +122 -15
  56. three/src/extras/core/Shape.d.ts +56 -6
  57. three/src/extras/core/ShapePath.d.ts +73 -8
  58. three/src/extras/curves/ArcCurve.d.ts +35 -3
  59. three/src/extras/curves/CatmullRomCurve3.d.ts +62 -15
  60. three/src/extras/curves/CubicBezierCurve.d.ts +48 -7
  61. three/src/extras/curves/CubicBezierCurve3.d.ts +48 -7
  62. three/src/extras/curves/EllipseCurve.d.ts +73 -18
  63. three/src/extras/curves/LineCurve.d.ts +26 -5
  64. three/src/extras/curves/LineCurve3.d.ts +26 -5
  65. three/src/extras/curves/QuadraticBezierCurve.d.ts +44 -6
  66. three/src/extras/curves/QuadraticBezierCurve3.d.ts +44 -6
  67. three/src/extras/curves/SplineCurve.d.ts +39 -3
  68. three/src/helpers/ArrowHelper.d.ts +47 -16
  69. three/src/helpers/AxesHelper.d.ts +35 -3
  70. three/src/helpers/Box3Helper.d.ts +28 -4
  71. three/src/helpers/BoxHelper.d.ts +44 -4
  72. three/src/helpers/CameraHelper.d.ts +38 -19
  73. three/src/helpers/DirectionalLightHelper.d.ts +57 -10
  74. three/src/helpers/GridHelper.d.ts +32 -6
  75. three/src/helpers/HemisphereLightHelper.d.ts +56 -3
  76. three/src/helpers/PlaneHelper.d.ts +31 -8
  77. three/src/helpers/PointLightHelper.d.ts +54 -6
  78. three/src/helpers/PolarGridHelper.d.ts +35 -8
  79. three/src/helpers/SkeletonHelper.d.ts +56 -8
  80. three/src/helpers/SpotLightHelper.d.ts +59 -4
  81. three/src/lights/AmbientLight.d.ts +23 -10
  82. three/src/lights/AmbientLightProbe.d.ts +18 -0
  83. three/src/lights/DirectionalLight.d.ts +75 -20
  84. three/src/lights/DirectionalLightShadow.d.ts +68 -2
  85. three/src/lights/HemisphereLight.d.ts +45 -12
  86. three/src/lights/HemisphereLightProbe.d.ts +19 -0
  87. three/src/lights/Light.d.ts +40 -43
  88. three/src/lights/LightProbe.d.ts +32 -5
  89. three/src/lights/LightShadow.d.ts +100 -18
  90. three/src/lights/PointLight.d.ts +57 -12
  91. three/src/lights/PointLightShadow.d.ts +18 -2
  92. three/src/lights/RectAreaLight.d.ts +60 -8
  93. three/src/lights/SpotLight.d.ts +105 -20
  94. three/src/lights/SpotLightShadow.d.ts +63 -3
  95. three/src/materials/LineBasicMaterial.d.ts +7 -1
  96. three/src/materials/MeshDistanceMaterial.d.ts +0 -15
  97. three/src/materials/ShaderMaterial.d.ts +1 -1
  98. three/src/math/Color.d.ts +23 -2
  99. three/src/math/Quaternion.d.ts +6 -0
  100. three/src/math/Triangle.d.ts +40 -0
  101. three/src/math/Vector2.d.ts +5 -0
  102. three/src/math/Vector3.d.ts +10 -3
  103. three/src/objects/InstancedMesh.d.ts +22 -30
  104. three/src/objects/LineSegments.d.ts +2 -0
  105. three/src/objects/Points.d.ts +7 -6
  106. three/src/objects/Skeleton.d.ts +5 -1
  107. three/src/objects/SkinnedMesh.d.ts +37 -25
  108. three/src/renderers/WebGLRenderTarget.d.ts +3 -0
  109. three/src/renderers/WebGLRenderer.d.ts +25 -1
  110. three/src/renderers/shaders/ShaderChunk.d.ts +58 -37
  111. three/src/renderers/shaders/UniformsLib.d.ts +88 -57
  112. three/src/textures/CanvasTexture.d.ts +0 -1
  113. three/src/textures/CompressedTexture.d.ts +3 -2
  114. three/src/textures/CubeTexture.d.ts +3 -4
  115. three/src/textures/DataTexture.d.ts +3 -3
  116. three/src/textures/Texture.d.ts +37 -24
  117. three/examples/jsm/nodes/functions/light/getDistanceAttenuation.d.ts +0 -5
  118. three/examples/jsm/nodes/lighting/PunctualLightNode.d.ts +0 -12
@@ -1,21 +1,42 @@
1
1
  import { Vector3 } from './../../math/Vector3';
2
2
  import { Curve } from './../core/Curve';
3
3
 
4
+ /**
5
+ * A curve representing a **3D** line segment.
6
+ * @see {@link https://threejs.org/docs/index.html#api/en/extras/curves/LineCurve3 | Official Documentation}
7
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/curves/LineCurve3.js | Source}
8
+ */
4
9
  export class LineCurve3 extends Curve<Vector3> {
5
- constructor(v1: Vector3, v2: Vector3);
10
+ /**
11
+ * This constructor creates a new {@link LineCurve3}.
12
+ * @param v1 The start point. Default is `new THREE.Vector3()`.
13
+ * @param v2 The end point. Default is `new THREE.Vector3()`.
14
+ */
15
+ constructor(v1?: Vector3, v2?: Vector3);
16
+
17
+ /**
18
+ * Read-only flag to check if a given object is of type {@link LineCurve3}.
19
+ * @remarks This is a _constant_ value
20
+ * @defaultValue `true`
21
+ */
22
+ readonly isLineCurve3 = true;
6
23
 
7
24
  /**
8
- * @default 'LineCurve3'
25
+ * A Read-only _string_ to check if `this` object type.
26
+ * @remarks Sub-classes will update this value.
27
+ * @defaultValue `LineCurve3`
9
28
  */
10
- type: string;
29
+ override readonly type: string | 'LineCurve3';
11
30
 
12
31
  /**
13
- * @default new THREE.Vector3()
32
+ * The start point.
33
+ * @defaultValue `new THREE.Vector3()`.
14
34
  */
15
35
  v1: Vector3;
16
36
 
17
37
  /**
18
- * @default new THREE.Vector3()
38
+ * The end point.
39
+ * @defaultValue `new THREE.Vector3()`.
19
40
  */
20
41
  v2: Vector3;
21
42
  }
@@ -1,26 +1,64 @@
1
1
  import { Vector2 } from './../../math/Vector2';
2
2
  import { Curve } from './../core/Curve';
3
3
 
4
+ /**
5
+ * Create a smooth **2D** {@link http://en.wikipedia.org/wiki/B%C3%A9zier_curve#mediaviewer/File:B%C3%A9zier_2_big.gif | quadratic bezier curve},
6
+ * defined by a start point, end point and a single control point.
7
+ * @example
8
+ * ```typescript
9
+ * const curve = new THREE.QuadraticBezierCurve(
10
+ * new THREE.Vector2(-10, 0),
11
+ * new THREE.Vector2(20, 15),
12
+ * new THREE.Vector2(10, 0));
13
+ * const points = curve.getPoints(50);
14
+ * const geometry = new THREE.BufferGeometry().setFromPoints(points);
15
+ * const material = new THREE.LineBasicMaterial({
16
+ * color: 0xff0000
17
+ * });
18
+ * // Create the final object to add to the scene
19
+ * const curveObject = new THREE.Line(geometry, material);
20
+ * ```
21
+ * @see {@link https://threejs.org/docs/index.html#api/en/extras/curves/QuadraticBezierCurve | Official Documentation}
22
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/curves/QuadraticBezierCurve.js | Source}
23
+ */
4
24
  export class QuadraticBezierCurve extends Curve<Vector2> {
5
- constructor(v0: Vector2, v1: Vector2, v2: Vector2);
25
+ /**
26
+ * This constructor creates a new {@link QuadraticBezierCurve}.
27
+ * @param v0 The start point. Default is `new THREE.Vector2()`.
28
+ * @param v1 The control point. Default is `new THREE.Vector2()`.
29
+ * @param v2 The end point. Default is `new THREE.Vector2()`.
30
+ */
31
+ constructor(v0?: Vector2, v1?: Vector2, v2?: Vector2);
32
+
33
+ /**
34
+ * Read-only flag to check if a given object is of type {@link LineCurve3}.
35
+ * @remarks This is a _constant_ value
36
+ * @defaultValue `true`
37
+ */
38
+ readonly isQuadraticBezierCurve = true;
6
39
 
7
40
  /**
8
- * @default 'QuadraticBezierCurve'
41
+ * A Read-only _string_ to check if `this` object type.
42
+ * @remarks Sub-classes will update this value.
43
+ * @defaultValue `QuadraticBezierCurve`
9
44
  */
10
- type: string;
45
+ override readonly type: string | 'QuadraticBezierCurve';
11
46
 
12
47
  /**
13
- * @default new THREE.Vector2()
48
+ * The start point.
49
+ * @defaultValue `new THREE.Vector2()`
14
50
  */
15
51
  v0: Vector2;
16
52
 
17
53
  /**
18
- * @default new THREE.Vector2()
54
+ * The control point.
55
+ * @defaultValue `new THREE.Vector2()`
19
56
  */
20
57
  v1: Vector2;
21
58
 
22
59
  /**
23
- * @default new THREE.Vector2()
60
+ * The end point.
61
+ * @defaultValue `new THREE.Vector2()`
24
62
  */
25
63
  v2: Vector2;
26
64
  }
@@ -1,26 +1,64 @@
1
1
  import { Vector3 } from './../../math/Vector3';
2
2
  import { Curve } from './../core/Curve';
3
3
 
4
+ /**
5
+ * Create a smooth **3D** {@link http://en.wikipedia.org/wiki/B%C3%A9zier_curve#mediaviewer/File:B%C3%A9zier_2_big.gif | quadratic bezier curve},
6
+ * defined by a start point, end point and a single control point.
7
+ * @example
8
+ * ```typescript
9
+ * const curve = new THREE.QuadraticBezierCurve3(
10
+ * new THREE.Vector3(-10, 0, 0),
11
+ * new THREE.Vector3(20, 15, 0),
12
+ * new THREE.Vector3(10, 0, 0));
13
+ * const points = curve.getPoints(50);
14
+ * const geometry = new THREE.BufferGeometry().setFromPoints(points);
15
+ * const material = new THREE.LineBasicMaterial({
16
+ * color: 0xff0000
17
+ * });
18
+ * // Create the final object to add to the scene
19
+ * const curveObject = new THREE.Line(geometry, material);
20
+ * ```
21
+ * @see {@link https://threejs.org/docs/index.html#api/en/extras/curves/QuadraticBezierCurve3 | Official Documentation}
22
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/curves/QuadraticBezierCurve3.js | Source}
23
+ */
4
24
  export class QuadraticBezierCurve3 extends Curve<Vector3> {
5
- constructor(v0: Vector3, v1: Vector3, v2: Vector3);
25
+ /**
26
+ * This constructor creates a new {@link QuadraticBezierCurve}.
27
+ * @param v0 The start point. Default is `new THREE.Vector3()`.
28
+ * @param v1 The control point. Default is `new THREE.Vector3()`.
29
+ * @param v2 The end point. Default is `new THREE.Vector3()`.
30
+ */
31
+ constructor(v0?: Vector3, v1?: Vector3, v2?: Vector3);
32
+
33
+ /**
34
+ * Read-only flag to check if a given object is of type {@link QuadraticBezierCurve3}.
35
+ * @remarks This is a _constant_ value
36
+ * @defaultValue `true`
37
+ */
38
+ readonly isQuadraticBezierCurve3 = true;
6
39
 
7
40
  /**
8
- * @default 'QuadraticBezierCurve3'
41
+ * A Read-only _string_ to check if `this` object type.
42
+ * @remarks Sub-classes will update this value.
43
+ * @defaultValue `QuadraticBezierCurve3`
9
44
  */
10
- type: string;
45
+ override readonly type: string | 'QuadraticBezierCurve3';
11
46
 
12
47
  /**
13
- * @default new THREE.Vector3()
48
+ * The start point.
49
+ * @defaultValue `new THREE.Vector3()`
14
50
  */
15
51
  v0: Vector3;
16
52
 
17
53
  /**
18
- * @default new THREE.Vector3()
54
+ * The control point.
55
+ * @defaultValue `new THREE.Vector3()`
19
56
  */
20
57
  v1: Vector3;
21
58
 
22
59
  /**
23
- * @default new THREE.Vector3()
60
+ * The end point.
61
+ * @defaultValue `new THREE.Vector3()`
24
62
  */
25
63
  v2: Vector3;
26
64
  }
@@ -1,16 +1,52 @@
1
1
  import { Vector2 } from './../../math/Vector2';
2
2
  import { Curve } from './../core/Curve';
3
3
 
4
+ /**
5
+ * Create a smooth **2D** spline curve from a series of points.
6
+ * @example
7
+ * ```typescript
8
+ * // Create a sine-like wave
9
+ * const curve = new THREE.SplineCurve([
10
+ * new THREE.Vector2(-10, 0),
11
+ * new THREE.Vector2(-5, 5),
12
+ * new THREE.Vector2(0, 0),
13
+ * new THREE.Vector2(5, -5),
14
+ * new THREE.Vector2(10, 0)]);
15
+ * const points = curve.getPoints(50);
16
+ * const geometry = new THREE.BufferGeometry().setFromPoints(points);
17
+ * const material = new THREE.LineBasicMaterial({
18
+ * color: 0xff0000
19
+ * });
20
+ * // Create the final object to add to the scene
21
+ * const splineObject = new THREE.Line(geometry, material);
22
+ * ```
23
+ * @see {@link https://threejs.org/docs/index.html#api/en/extras/curves/SplineCurve | Official Documentation}
24
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/curves/SplineCurve.js | Source}
25
+ */
4
26
  export class SplineCurve extends Curve<Vector2> {
27
+ /**
28
+ * This constructor creates a new {@link SplineCurve}.
29
+ * @param points An array of {@link THREE.Vector2 | Vector2} points that define the curve. Default `[]`
30
+ */
5
31
  constructor(points?: Vector2[]);
6
32
 
7
33
  /**
8
- * @default 'SplineCurve'
34
+ * Read-only flag to check if a given object is of type {@link SplineCurve}.
35
+ * @remarks This is a _constant_ value
36
+ * @defaultValue `true`
37
+ */
38
+ readonly isSplineCurve = true;
39
+
40
+ /**
41
+ * A Read-only _string_ to check if `this` object type.
42
+ * @remarks Sub-classes will update this value.
43
+ * @defaultValue `SplineCurve`
9
44
  */
10
- type: string;
45
+ override readonly type: string | 'SplineCurve';
11
46
 
12
47
  /**
13
- * @default []
48
+ * The array of {@link THREE.Vector2 | Vector2} points that define the curve.
49
+ * @defaultValue `[]`
14
50
  */
15
51
  points: Vector2[];
16
52
  }
@@ -4,16 +4,32 @@ import { Mesh } from './../objects/Mesh';
4
4
  import { Object3D } from './../core/Object3D';
5
5
  import { ColorRepresentation } from '../math/Color';
6
6
 
7
- // Extras / Helpers /////////////////////////////////////////////////////////////////////
8
-
7
+ /**
8
+ * An 3D arrow object for visualizing directions.
9
+ * @example
10
+ * ```typescript
11
+ * const dir = new THREE.Vector3(1, 2, 0);
12
+ * //normalize the direction vector (convert to vector of length 1)
13
+ * dir.normalize();
14
+ * const origin = new THREE.Vector3(0, 0, 0);
15
+ * const length = 1;
16
+ * const hex = 0xffff00;
17
+ * const {@link ArrowHelper} = new THREE.ArrowHelper(dir, origin, length, hex);
18
+ * scene.add(arrowHelper);
19
+ * ```
20
+ * @see Example: {@link https://threejs.org/examples/#webgl_shadowmesh | WebGL / shadowmesh}
21
+ * @see {@link https://threejs.org/docs/index.html#api/en/helpers/ArrowHelper | Official Documentation}
22
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/ArrowHelper.js | Source}
23
+ */
9
24
  export class ArrowHelper extends Object3D {
10
25
  /**
11
- * @param [dir] Direction from origin. Must be a unit vector.
12
- * @param [origin] Point at which the arrow starts.
13
- * @param [length] Length of the arrow.
14
- * @param [color] Hexadecimal value to define color.
15
- * @param [headLength] The length of the head of the arrow.
16
- * @param [headWidth] The width of the head of the arrow.
26
+ * Create a new instance of {@link ArrowHelper}
27
+ * @param dir Direction from origin. Must be a unit vector. Default `new THREE.Vector3(0, 0, 1)`
28
+ * @param origin Point at which the arrow starts. Default `new THREE.Vector3(0, 0, 0)`
29
+ * @param length Length of the arrow. Default `1`
30
+ * @param hex Hexadecimal value to define color. Default `0xffff00`
31
+ * @param headLength The length of the head of the arrow. Default `0.2 * length`
32
+ * @param headWidth The width of the head of the arrow. Default `0.2 * headLength`
17
33
  */
18
34
  constructor(
19
35
  dir?: Vector3,
@@ -25,9 +41,12 @@ export class ArrowHelper extends Object3D {
25
41
  );
26
42
 
27
43
  /**
28
- * @default 'ArrowHelper'
44
+ * A Read-only _string_ to check if `this` object type.
45
+ * @remarks Sub-classes will update this value.
46
+ * @override
47
+ * @defaultValue `ArrowHelper`
29
48
  */
30
- type: string;
49
+ override readonly type: string | 'ArrowHelper';
31
50
 
32
51
  /**
33
52
  * Contains the line part of the arrowHelper.
@@ -39,24 +58,36 @@ export class ArrowHelper extends Object3D {
39
58
  */
40
59
  cone: Mesh;
41
60
 
61
+ /**
62
+ * Sets the color of the arrowHelper.
63
+ * @param color The desired color.
64
+ */
65
+ setColor(color: ColorRepresentation): void;
66
+
42
67
  /**
43
68
  * @param dir The desired direction. Must be a unit vector.
44
69
  */
45
70
  setDirection(dir: Vector3): void;
46
71
 
47
72
  /**
73
+ * Sets the length of the arrowhelper.
48
74
  * @param length The desired length.
49
- * @param [headLength] The length of the head of the arrow.
50
- * @param [headWidth] The width of the head of the arrow.
75
+ * @param headLength The length of the head of the arrow. Default `0.2 * length`
76
+ * @param headWidth The width of the head of the arrow. Default `0.2 * headLength`
51
77
  */
52
78
  setLength(length: number, headLength?: number, headWidth?: number): void;
53
79
 
54
80
  /**
55
- * @param color The desired color.
81
+ * Copy the given object into this object
82
+ * @remarks Note: event listeners and user-defined callbacks ({@link onAfterRender | .onAfterRender} and {@link onBeforeRender | .onBeforeRender}) are not copied.
83
+ * @param source
56
84
  */
57
- setColor(color: ColorRepresentation): void;
58
-
59
- copy(source: this): this;
85
+ override copy(source: this): this;
60
86
 
87
+ /**
88
+ * Frees the GPU-related resources allocated by this instance
89
+ * @remarks
90
+ * Call this method whenever this instance is no longer used in your app.
91
+ */
61
92
  dispose(): void;
62
93
  }
@@ -1,18 +1,50 @@
1
1
  import { Color } from '../math/Color';
2
2
  import { LineSegments } from './../objects/LineSegments';
3
3
 
4
+ /**
5
+ * An axis object to visualize the 3 axes in a simple way.
6
+ * @remarks
7
+ * The X axis is red
8
+ * The Y axis is green
9
+ * The Z axis is blue.
10
+ * @example
11
+ * ```typescript
12
+ * const {@link AxesHelper} = new THREE.AxesHelper(5);
13
+ * scene.add(axesHelper);
14
+ * ```
15
+ * @see Example: {@link https://threejs.org/examples/#webgl_buffergeometry_compression | WebGL / buffergeometry / compression}
16
+ * @see Example: {@link https://threejs.org/examples/#webgl_geometry_convex | WebGL / geometry / convex}
17
+ * @see Example: {@link https://threejs.org/examples/#webgl_loader_nrrd | WebGL / loader / nrrd}
18
+ * @see {@link https://threejs.org/docs/index.html#api/en/helpers/AxesHelper | Official Documentation}
19
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/AxesHelper.js | Source}
20
+ */
4
21
  export class AxesHelper extends LineSegments {
5
22
  /**
6
- * @param [size=1]
23
+ * Create a new instance of {@link AxesHelper}
24
+ * @param size Size of the lines representing the axes. Default `1`
7
25
  */
8
26
  constructor(size?: number);
9
27
 
10
28
  /**
11
- * @default 'AxesHelper'
29
+ * A Read-only _string_ to check if `this` object type.
30
+ * @remarks Sub-classes will update this value.
31
+ * @override
32
+ * @defaultValue `AxesHelper`
12
33
  */
13
- type: string;
34
+ override readonly type: string | 'AxesHelper';
14
35
 
36
+ /**
37
+ * Sets the axes colors to {@link Color | xAxisColor}, {@link Color | yAxisColor}, {@link Color | zAxisColor}.
38
+ * @param xAxisColor
39
+ * @param yAxisColor
40
+ * @param zAxisColor
41
+ */
15
42
  setColors(xAxisColor: Color, yAxisColor: Color, zAxisColor: Color): this;
16
43
 
44
+ /**
45
+ * Frees the GPU-related resources allocated by this instance
46
+ * @remarks
47
+ * Call this method whenever this instance is no longer used in your app.
48
+ */
17
49
  dispose(): void;
18
50
  }
@@ -2,19 +2,43 @@ import { Box3 } from './../math/Box3';
2
2
  import { Color } from './../math/Color';
3
3
  import { LineSegments } from './../objects/LineSegments';
4
4
 
5
+ /**
6
+ * Helper object to visualize a {@link THREE.Box3 | Box3}.
7
+ * @example
8
+ * ```typescript
9
+ * const box = new THREE.Box3();
10
+ * box.setFromCenterAndSize(new THREE.Vector3(1, 1, 1), new THREE.Vector3(2, 1, 3));
11
+ * const helper = new THREE.Box3Helper(box, 0xffff00);
12
+ * scene.add(helper);
13
+ * ```
14
+ * @see {@link https://threejs.org/docs/index.html#api/en/helpers/Box3Helper | Official Documentation}
15
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/Box3Helper.js | Source}
16
+ */
5
17
  export class Box3Helper extends LineSegments {
6
18
  /**
7
- * @param box
8
- * @param [color=0xffff00]
19
+ * Creates a new wireframe box that represents the passed Box3.
20
+ * @param box The Box3 to show.
21
+ * @param color The box's color. Default `0xffff00`
9
22
  */
10
23
  constructor(box: Box3, color?: Color);
11
24
 
12
25
  /**
13
- * @default 'Box3Helper'
26
+ * A Read-only _string_ to check if `this` object type.
27
+ * @remarks Sub-classes will update this value.
28
+ * @override
29
+ * @defaultValue `Box3Helper`
14
30
  */
15
- type: string;
31
+ override readonly type: string | 'Box3Helper';
16
32
 
33
+ /**
34
+ * The Box3 being visualized.
35
+ */
17
36
  box: Box3;
18
37
 
38
+ /**
39
+ * Frees the GPU-related resources allocated by this instance
40
+ * @remarks
41
+ * Call this method whenever this instance is no longer used in your app.
42
+ */
19
43
  dispose(): void;
20
44
  }
@@ -2,21 +2,61 @@ import { ColorRepresentation } from '../math/Color';
2
2
  import { Object3D } from './../core/Object3D';
3
3
  import { LineSegments } from './../objects/LineSegments';
4
4
 
5
+ /**
6
+ * Helper object to graphically show the world-axis-aligned bounding box around an object
7
+ * @remarks
8
+ * The actual bounding box is handled with {@link THREE.Box3 | Box3}, this is just a visual helper for debugging
9
+ * It can be automatically resized with the {@link THREE.BoxHelper.update | BoxHelper.update} method when the object it's created from is transformed
10
+ * Note that the object must have a {@link THREE.BufferGeometry | BufferGeometry} for this to work, so it won't work with {@link Sprite | Sprites}.
11
+ * @example
12
+ * ```typescript
13
+ * const sphere = new THREE.SphereGeometry();
14
+ * const object = new THREE.Mesh(sphere, new THREE.MeshBasicMaterial(0xff0000));
15
+ * const box = new THREE.BoxHelper(object, 0xffff00);
16
+ * scene.add(box);
17
+ * ```
18
+ * @see Example: {@link https://threejs.org/examples/#webgl_helpers | WebGL / helpers}
19
+ * @see Example: {@link https://threejs.org/examples/#webgl_loader_nrrd | WebGL / loader / nrrd}
20
+ * @see Example: {@link https://threejs.org/examples/#webgl_buffergeometry_drawrange | WebGL / buffergeometry / drawrange}
21
+ * @see {@link https://threejs.org/docs/index.html#api/en/helpers/BoxHelper | Official Documentation}
22
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/BoxHelper.js | Source}
23
+ */
5
24
  export class BoxHelper extends LineSegments {
6
25
  /**
7
- * @param object
8
- * @param [color=0xffff00]
26
+ * Creates a new wireframe box that bounds the passed object
27
+ * @remarks
28
+ * Internally this uses {@link THREE.Box3.setFromObject | Box3.setFromObject} to calculate the dimensions
29
+ * Note that this includes any children.
30
+ * @param object The object3D to show the world-axis-aligned bounding box.
31
+ * @param color Hexadecimal value that defines the box's color. Default `0xffff00`
9
32
  */
10
33
  constructor(object: Object3D, color?: ColorRepresentation);
11
34
 
12
35
  /**
13
- * @default 'BoxHelper'
36
+ * A Read-only _string_ to check if `this` object type.
37
+ * @remarks Sub-classes will update this value.
38
+ * @override
39
+ * @defaultValue `BoxHelper`
14
40
  */
15
- type: string;
41
+ override readonly type: string | 'BoxHelper';
16
42
 
43
+ /**
44
+ * Updates the helper's geometry to match the dimensions of the object, including any children
45
+ * @remarks
46
+ * See {@link THREE.Box3.setFromObject | Box3.setFromObject}.
47
+ */
17
48
  update(object?: Object3D): void;
18
49
 
50
+ /**
51
+ * Updates the wireframe box for the passed object.
52
+ * @param object {@link THREE.Object3D | Object3D} to create the helper of.
53
+ */
19
54
  setFromObject(object: Object3D): this;
20
55
 
56
+ /**
57
+ * Frees the GPU-related resources allocated by this instance
58
+ * @remarks
59
+ * Call this method whenever this instance is no longer used in your app.
60
+ */
21
61
  dispose(): void;
22
62
  }
@@ -4,19 +4,36 @@ import { Camera } from './../cameras/Camera';
4
4
  import { LineSegments } from './../objects/LineSegments';
5
5
 
6
6
  /**
7
- * This helps with visualizing what a camera contains in its frustum.
8
- * It visualizes the frustum of a camera using a {@link LineSegments}.
9
- *
10
- * CameraHelper must be a child of the scene.
7
+ * This helps with visualizing what a camera contains in its frustum
8
+ * @remarks
9
+ * It visualizes the frustum of a camera using a {@link THREE.LineSegments | LineSegments}.
10
+ * @remarks {@link CameraHelper} must be a child of the scene.
11
+ * @example
12
+ * ```typescript
13
+ * const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
14
+ * const helper = new THREE.CameraHelper(camera);
15
+ * scene.add(helper);
16
+ * ```
17
+ * @see Example: {@link https://threejs.org/examples/#webgl_camera | WebGL / camera}
18
+ * @see Example: {@link https://threejs.org/examples/#webgl_geometry_extrude_splines | WebGL / extrude / splines}
19
+ * @see {@link https://threejs.org/docs/index.html#api/en/helpers/CameraHelper | Official Documentation}
20
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/CameraHelper.js | Source}
11
21
  */
12
22
  export class CameraHelper extends LineSegments {
13
23
  /**
14
- * This create a new CameraHelper for the specified camera.
15
- *
16
- * @param camera - The camera to visualize.
24
+ * This create a new {@link CameraHelper} for the specified camera.
25
+ * @param camera The camera to visualize.
17
26
  */
18
27
  constructor(camera: Camera);
19
28
 
29
+ /**
30
+ * A Read-only _string_ to check if `this` object type.
31
+ * @remarks Sub-classes will update this value.
32
+ * @override
33
+ * @defaultValue `CameraHelper`
34
+ */
35
+ override readonly type: string | 'CameraHelper';
36
+
20
37
  /**
21
38
  * The camera being visualized.
22
39
  */
@@ -28,20 +45,26 @@ export class CameraHelper extends LineSegments {
28
45
  pointMap: { [id: string]: number[] };
29
46
 
30
47
  /**
31
- * Reference to the {@link Camera.matrixWorld}.
48
+ * Reference to the {@link THREE.Camera.matrixWorld | camera.matrixWorld}.
32
49
  */
33
50
  matrix: Matrix4;
34
51
 
35
52
  /**
36
- * See {@link Object3D.matrixAutoUpdate}.
37
- * Set to `false` here as the helper is using the camera's {@link Camera.matrixWorld}.
53
+ * Is set to `false`, as the helper is using the {@link THREE.Camera.matrixWorld | camera.matrixWorld}.
54
+ * @see {@link THREE.Object3D.matrixAutoUpdate | Object3D.matrixAutoUpdate}.
55
+ * @defaultValue `false`.
38
56
  */
39
- matrixAutoUpdate: boolean;
57
+ override matrixAutoUpdate: boolean;
40
58
 
41
59
  /**
42
- * @default 'CameraHelper'
60
+ * Defines the colors of the helper.
61
+ * @param frustum
62
+ * @param cone
63
+ * @param up
64
+ * @param target
65
+ * @param cross
43
66
  */
44
- type: string;
67
+ setColors(frustum: Color, cone: Color, up: Color, target: Color, cross: Color): this;
45
68
 
46
69
  /**
47
70
  * Updates the helper based on the projectionMatrix of the camera.
@@ -49,13 +72,9 @@ export class CameraHelper extends LineSegments {
49
72
  update(): void;
50
73
 
51
74
  /**
52
- * Frees the GPU-related resources allocated by this instance.
75
+ * Frees the GPU-related resources allocated by this instance
76
+ * @remarks
53
77
  * Call this method whenever this instance is no longer used in your app.
54
78
  */
55
79
  dispose(): void;
56
-
57
- /**
58
- * Defines the colors of the helper.
59
- */
60
- setColors(frustum: Color, cone: Color, up: Color, target: Color, cross: Color): this;
61
80
  }