@types/three 0.150.1 → 0.151.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 (108) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/controls/MapControls.d.ts +21 -0
  3. three/examples/jsm/controls/OrbitControls.d.ts +1 -5
  4. three/examples/jsm/controls/PointerLockControls.d.ts +3 -0
  5. three/examples/jsm/controls/TrackballControls.d.ts +2 -0
  6. three/examples/jsm/helpers/ViewHelper.d.ts +3 -4
  7. three/examples/jsm/loaders/GLTFLoader.d.ts +2 -4
  8. three/examples/jsm/loaders/SVGLoader.d.ts +15 -3
  9. three/examples/jsm/nodes/Nodes.d.ts +130 -226
  10. three/examples/jsm/nodes/{core → code}/CodeNode.d.ts +2 -3
  11. three/examples/jsm/nodes/{core → code}/ExpressionNode.d.ts +2 -2
  12. three/examples/jsm/nodes/{core → code}/FunctionCallNode.d.ts +2 -2
  13. three/examples/jsm/nodes/{core → code}/FunctionNode.d.ts +4 -4
  14. three/examples/jsm/nodes/core/InputNode.d.ts +4 -0
  15. three/examples/jsm/nodes/core/NodeBuilder.d.ts +1 -3
  16. three/examples/jsm/nodes/core/NodeUtils.d.ts +8 -2
  17. three/examples/jsm/nodes/core/{VaryNode.d.ts → VaryingNode.d.ts} +1 -1
  18. three/examples/jsm/nodes/fog/FogNode.d.ts +1 -1
  19. three/examples/jsm/nodes/geometry/RangeNode.d.ts +2 -1
  20. three/examples/jsm/nodes/lighting/PointLightNode.d.ts +10 -0
  21. three/examples/jsm/nodes/lighting/SpotLightNode.d.ts +15 -0
  22. three/examples/jsm/nodes/math/MathNode.d.ts +2 -2
  23. three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +2 -2
  24. three/examples/jsm/objects/{GroundProjectedEnv.d.ts → GroundProjectedSkybox.d.ts} +1 -1
  25. three/examples/jsm/postprocessing/Pass.d.ts +2 -0
  26. three/examples/jsm/renderers/CSS2DRenderer.d.ts +2 -1
  27. three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +0 -1
  28. three/examples/jsm/utils/BufferGeometryUtils.d.ts +12 -2
  29. three/index.d.ts +1 -1
  30. three/package.json +2 -2
  31. three/src/Three.d.ts +1 -1
  32. three/src/core/Raycaster.d.ts +1 -0
  33. three/src/extras/DataUtils.d.ts +13 -0
  34. three/src/extras/Earcut.d.ts +12 -0
  35. three/src/extras/ImageUtils.d.ts +20 -20
  36. three/src/extras/PMREMGenerator.d.ts +66 -0
  37. three/src/extras/ShapeUtils.d.ts +19 -1
  38. three/src/extras/core/Curve.d.ts +86 -31
  39. three/src/extras/core/CurvePath.d.ts +46 -4
  40. three/src/extras/core/Interpolations.d.ts +36 -0
  41. three/src/extras/core/Path.d.ts +122 -15
  42. three/src/extras/core/Shape.d.ts +56 -6
  43. three/src/extras/core/ShapePath.d.ts +73 -8
  44. three/src/extras/curves/ArcCurve.d.ts +35 -3
  45. three/src/extras/curves/CatmullRomCurve3.d.ts +62 -15
  46. three/src/extras/curves/CubicBezierCurve.d.ts +48 -7
  47. three/src/extras/curves/CubicBezierCurve3.d.ts +48 -7
  48. three/src/extras/curves/EllipseCurve.d.ts +73 -18
  49. three/src/extras/curves/LineCurve.d.ts +26 -5
  50. three/src/extras/curves/LineCurve3.d.ts +26 -5
  51. three/src/extras/curves/QuadraticBezierCurve.d.ts +44 -6
  52. three/src/extras/curves/QuadraticBezierCurve3.d.ts +44 -6
  53. three/src/extras/curves/SplineCurve.d.ts +39 -3
  54. three/src/helpers/ArrowHelper.d.ts +48 -17
  55. three/src/helpers/AxesHelper.d.ts +35 -3
  56. three/src/helpers/Box3Helper.d.ts +28 -4
  57. three/src/helpers/BoxHelper.d.ts +45 -5
  58. three/src/helpers/CameraHelper.d.ts +38 -19
  59. three/src/helpers/DirectionalLightHelper.d.ts +58 -11
  60. three/src/helpers/GridHelper.d.ts +33 -7
  61. three/src/helpers/HemisphereLightHelper.d.ts +57 -5
  62. three/src/helpers/PlaneHelper.d.ts +31 -8
  63. three/src/helpers/PointLightHelper.d.ts +55 -7
  64. three/src/helpers/PolarGridHelper.d.ts +36 -9
  65. three/src/helpers/SkeletonHelper.d.ts +56 -8
  66. three/src/helpers/SpotLightHelper.d.ts +60 -5
  67. three/src/lights/AmbientLight.d.ts +24 -11
  68. three/src/lights/AmbientLightProbe.d.ts +19 -1
  69. three/src/lights/DirectionalLight.d.ts +76 -21
  70. three/src/lights/DirectionalLightShadow.d.ts +68 -2
  71. three/src/lights/HemisphereLight.d.ts +46 -14
  72. three/src/lights/HemisphereLightProbe.d.ts +20 -1
  73. three/src/lights/Light.d.ts +40 -43
  74. three/src/lights/LightProbe.d.ts +32 -5
  75. three/src/lights/LightShadow.d.ts +100 -18
  76. three/src/lights/PointLight.d.ts +58 -13
  77. three/src/lights/PointLightShadow.d.ts +18 -2
  78. three/src/lights/RectAreaLight.d.ts +61 -9
  79. three/src/lights/SpotLight.d.ts +106 -22
  80. three/src/lights/SpotLightShadow.d.ts +63 -3
  81. three/src/materials/LineBasicMaterial.d.ts +7 -2
  82. three/src/materials/MeshBasicMaterial.d.ts +1 -2
  83. three/src/materials/MeshDistanceMaterial.d.ts +0 -15
  84. three/src/materials/MeshLambertMaterial.d.ts +1 -2
  85. three/src/materials/MeshMatcapMaterial.d.ts +1 -2
  86. three/src/materials/MeshPhongMaterial.d.ts +1 -2
  87. three/src/materials/MeshStandardMaterial.d.ts +1 -2
  88. three/src/materials/MeshToonMaterial.d.ts +1 -2
  89. three/src/materials/PointsMaterial.d.ts +1 -2
  90. three/src/materials/ShadowMaterial.d.ts +1 -2
  91. three/src/materials/SpriteMaterial.d.ts +1 -2
  92. three/src/math/Color.d.ts +25 -5
  93. three/src/math/Quaternion.d.ts +6 -0
  94. three/src/math/Triangle.d.ts +40 -0
  95. three/src/math/Vector2.d.ts +5 -0
  96. three/src/math/Vector3.d.ts +10 -3
  97. three/src/objects/InstancedMesh.d.ts +22 -30
  98. three/src/objects/LineSegments.d.ts +2 -0
  99. three/src/objects/Skeleton.d.ts +5 -1
  100. three/src/objects/SkinnedMesh.d.ts +37 -25
  101. three/src/renderers/WebGLRenderer.d.ts +17 -2
  102. three/src/renderers/shaders/ShaderChunk.d.ts +58 -37
  103. three/src/renderers/shaders/UniformsLib.d.ts +88 -57
  104. three/src/scenes/Fog.d.ts +1 -2
  105. three/src/scenes/FogExp2.d.ts +1 -2
  106. three/src/textures/Texture.d.ts +5 -22
  107. three/examples/jsm/nodes/lighting/PunctualLightNode.d.ts +0 -12
  108. three/src/utils.d.ts +0 -6
@@ -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
  }
@@ -1,22 +1,62 @@
1
- import { ColorRepresentation } from '../utils';
1
+ 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
  }
@@ -2,31 +2,78 @@ import { DirectionalLight } from './../lights/DirectionalLight';
2
2
  import { Line } from './../objects/Line';
3
3
  import { Matrix4 } from './../math/Matrix4';
4
4
  import { Object3D } from './../core/Object3D';
5
- import { ColorRepresentation } from '../utils';
5
+ import { ColorRepresentation } from '../math/Color';
6
6
 
7
+ /**
8
+ * Helper object to assist with visualizing a {@link THREE.DirectionalLight | DirectionalLight}'s effect on the scene
9
+ * @remarks
10
+ * This consists of plane and a line representing the light's position and direction.
11
+ * @example
12
+ * ```typescript
13
+ * const light = new THREE.DirectionalLight(0xFFFFFF);
14
+ * const helper = new THREE.DirectionalLightHelper(light, 5);
15
+ * scene.add(helper);
16
+ * ```
17
+ * @see {@link https://threejs.org/docs/index.html#api/en/helpers/DirectionalLightHelper | Official Documentation}
18
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/DirectionalLightHelper.js | Source}
19
+ */
7
20
  export class DirectionalLightHelper extends Object3D {
8
21
  /**
9
- * @param light
10
- * @param [size=1]
11
- * @param color
22
+ * Create a new instance of {@link DirectionalLightHelper}
23
+ * @param light The light to be visualized.
24
+ * @param size Dimensions of the plane. Default `1`
25
+ * @param color If this is not the set the helper will take the color of the light. Default `light.color`
12
26
  */
13
27
  constructor(light: DirectionalLight, size?: number, color?: ColorRepresentation);
14
28
 
15
- light: DirectionalLight;
29
+ /**
30
+ * A Read-only _string_ to check if `this` object type.
31
+ * @remarks Sub-classes will update this value.
32
+ * @override
33
+ * @defaultValue `DirectionalLightHelper`
34
+ */
35
+ override readonly type: string | 'DirectionalLightHelper';
36
+
37
+ /**
38
+ * Contains the line mesh showing the location of the directional light.
39
+ */
16
40
  lightPlane: Line;
17
- targetLine: Line;
18
41
 
19
42
  /**
20
- * @default undefined
43
+ * Reference to the {@link THREE.DirectionalLight | directionalLight} being visualized.
44
+ */
45
+ light: DirectionalLight;
46
+
47
+ /**
48
+ * Reference to the {@link THREE.DirectionalLight.matrixWorld | light.matrixWorld}.
21
49
  */
22
- color: ColorRepresentation | undefined;
23
50
  matrix: Matrix4;
24
51
 
25
52
  /**
26
- * @default false
53
+ * Is set to `false`, as the helper is using the {@link THREE.DirectionalLight.matrixWorld | light.matrixWorld}.
54
+ * @see {@link THREE.Object3D.matrixAutoUpdate | Object3D.matrixAutoUpdate}.
55
+ * @defaultValue `false`.
27
56
  */
28
- matrixAutoUpdate: boolean;
57
+ override matrixAutoUpdate: boolean;
29
58
 
30
- dispose(): void;
59
+ /**
60
+ * The color parameter passed in the constructor.
61
+ * @remarks If this is changed, the helper's color will update the next time {@link update} is called.
62
+ * @defaultValue `undefined`
63
+ */
64
+ color: ColorRepresentation | undefined;
65
+
66
+ targetLine: Line; // TODO: Double check if this need to be exposed or not.
67
+
68
+ /**
69
+ * Updates the helper to match the position and direction of the {@link light | DirectionalLight} being visualized.
70
+ */
31
71
  update(): void;
72
+
73
+ /**
74
+ * Frees the GPU-related resources allocated by this instance
75
+ * @remarks
76
+ * Call this method whenever this instance is no longer used in your app.
77
+ */
78
+ dispose(): void;
32
79
  }
@@ -1,19 +1,45 @@
1
- import { ColorRepresentation } from '../utils';
1
+ import { ColorRepresentation } from '../math/Color';
2
2
  import { LineSegments } from './../objects/LineSegments';
3
3
 
4
+ /**
5
+ * The {@link GridHelper} is an object to define grids
6
+ * @remarks
7
+ * Grids are two-dimensional arrays of lines.
8
+ * @example
9
+ * ```typescript
10
+ * const size = 10;
11
+ * const divisions = 10;
12
+ * const {@link GridHelper} = new THREE.GridHelper(size, divisions);
13
+ * scene.add(gridHelper);
14
+ * ```
15
+ * @see Example: {@link https://threejs.org/examples/#webgl_helpers | WebGL / helpers}
16
+ * @see {@link https://threejs.org/docs/index.html#api/en/helpers/GridHelper | Official Documentation}
17
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/GridHelper.js | Source}
18
+ */
4
19
  export class GridHelper extends LineSegments {
5
20
  /**
6
- * @param [size=10]
7
- * @param [divisions=10]
8
- * @param [color1=0x444444]
9
- * @param [color2=0x888888]
21
+ * Creates a new {@link GridHelper} of size 'size' and divided into 'divisions' segments per side
22
+ * @remarks
23
+ * Colors are optional.
24
+ * @param size The size of the grid. Default `10`
25
+ * @param divisions The number of divisions across the grid. Default `10`
26
+ * @param colorCenterLine The color of the centerline. This can be a {@link THREE.Color | Color}, a hexadecimal value and an CSS-Color name. Default `0x444444`
27
+ * @param colorGrid The color of the lines of the grid. This can be a {@link THREE.Color | Color}, a hexadecimal value and an CSS-Color name. Default `0x888888`
10
28
  */
11
29
  constructor(size?: number, divisions?: number, color1?: ColorRepresentation, color2?: ColorRepresentation);
12
30
 
13
31
  /**
14
- * @default 'GridHelper'
32
+ * A Read-only _string_ to check if `this` object type.
33
+ * @remarks Sub-classes will update this value.
34
+ * @override
35
+ * @defaultValue `GridHelper`
15
36
  */
16
- type: string;
37
+ override readonly type: string | 'GridHelper';
17
38
 
39
+ /**
40
+ * Frees the GPU-related resources allocated by this instance
41
+ * @remarks
42
+ * Call this method whenever this instance is no longer used in your app.
43
+ */
18
44
  dispose(): void;
19
45
  }
@@ -1,20 +1,72 @@
1
1
  import { HemisphereLight } from './../lights/HemisphereLight';
2
- import { Color } from './../math/Color';
3
2
  import { Matrix4 } from './../math/Matrix4';
4
3
  import { MeshBasicMaterial } from './../materials/MeshBasicMaterial';
5
4
  import { Object3D } from './../core/Object3D';
6
- import { ColorRepresentation } from '../utils';
5
+ import { ColorRepresentation } from '../math/Color';
7
6
 
7
+ /**
8
+ * Creates a visual aid consisting of a spherical {@link THREE.Mesh | Mesh} for a {@link THREE.HemisphereLight | HemisphereLight}.
9
+ * @example
10
+ * ```typescript
11
+ * const light = new THREE.HemisphereLight(0xffffbb, 0x080820, 1);
12
+ * const helper = new THREE.HemisphereLightHelper(light, 5);
13
+ * scene.add(helper);
14
+ * ```
15
+ * @see {@link https://threejs.org/docs/index.html#api/en/helpers/HemisphereLightHelper | Official Documentation}
16
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/HemisphereLightHelper.js | Source}
17
+ */
8
18
  export class HemisphereLightHelper extends Object3D {
19
+ /**
20
+ * Create a new instance of {@link HemisphereLightHelper}
21
+ * @param light The light being visualized.
22
+ * @param size Thr sphere size
23
+ * @param color If this is not the set the helper will take the color of the light.
24
+ */
9
25
  constructor(light: HemisphereLight, size: number, color?: ColorRepresentation);
10
26
 
27
+ /**
28
+ * A Read-only _string_ to check if `this` object type.
29
+ * @remarks Sub-classes will update this value.
30
+ * @override
31
+ * @defaultValue `HemisphereLightHelper`
32
+ */
33
+ override readonly type: string | 'HemisphereLightHelper';
34
+
35
+ /**
36
+ * Reference to the HemisphereLight being visualized.
37
+ */
11
38
  light: HemisphereLight;
39
+
40
+ /**
41
+ * Reference to the {@link THREE.HemisphereLight.matrixWorld | light.matrixWorld}.
42
+ */
12
43
  matrix: Matrix4;
13
- matrixAutoUpdate: boolean;
14
- material: MeshBasicMaterial;
15
44
 
45
+ /**
46
+ * Is set to `false`, as the helper is using the {@link THREE.HemisphereLight.matrixWorld | light.matrixWorld}.
47
+ * @see {@link THREE.Object3D.matrixAutoUpdate | Object3D.matrixAutoUpdate}.
48
+ * @defaultValue `false`.
49
+ */
50
+ override matrixAutoUpdate: boolean;
51
+
52
+ material: MeshBasicMaterial; // TODO: Double check if this need to be exposed or not.
53
+
54
+ /**
55
+ * The color parameter passed in the constructor.
56
+ * @remarks If this is changed, the helper's color will update the next time {@link update} is called.
57
+ * @defaultValue `undefined`
58
+ */
16
59
  color: ColorRepresentation | undefined;
17
60
 
18
- dispose(): void;
61
+ /**
62
+ * Updates the helper to match the position and direction of the {@link .light | HemisphereLight}.
63
+ */
19
64
  update(): void;
65
+
66
+ /**
67
+ * Frees the GPU-related resources allocated by this instance
68
+ * @remarks
69
+ * Call this method whenever this instance is no longer used in your app.
70
+ */
71
+ dispose(): void;
20
72
  }
@@ -1,27 +1,50 @@
1
1
  import { Plane } from './../math/Plane';
2
2
  import { LineSegments } from './../objects/LineSegments';
3
3
 
4
+ /**
5
+ * Helper object to visualize a {@link THREE.Plane | Plane}.
6
+ * @example
7
+ * ```typescript
8
+ * const plane = new THREE.Plane(new THREE.Vector3(1, 1, 0.2), 3);
9
+ * const helper = new THREE.PlaneHelper(plane, 1, 0xffff00);
10
+ * scene.add(helper);
11
+ * ```
12
+ * @see {@link https://threejs.org/docs/index.html#api/en/helpers/PlaneHelper | Official Documentation}
13
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/PlaneHelper.js | Source}
14
+ */
4
15
  export class PlaneHelper extends LineSegments {
5
16
  /**
6
- * @param plane
7
- * @param [size=1]
8
- * @param [hex=0xffff00]
17
+ * Creates a new wireframe representation of the passed plane.
18
+ * @param plane The plane to visualize.
19
+ * @param size Side length of plane helper. Expects a `Float`. Default `1`
20
+ * @param hex Color. Default `0xffff00`
9
21
  */
10
22
  constructor(plane: Plane, size?: number, hex?: number);
11
23
 
12
24
  /**
13
- * @default 'PlaneHelper'
25
+ * A Read-only _string_ to check if `this` object type.
26
+ * @remarks Sub-classes will update this value.
27
+ * @override
28
+ * @defaultValue `PlaneHelper`
14
29
  */
15
- type: string;
30
+ override readonly type: string | 'PlaneHelper';
16
31
 
32
+ /**
33
+ * The {@link Plane | plane} being visualized.
34
+ */
17
35
  plane: Plane;
18
36
 
19
37
  /**
20
- * @default 1
38
+ * The side lengths of plane helper.
39
+ * @remarks Expects a `Float`
40
+ * @defaultValue `1`
21
41
  */
22
42
  size: number;
23
43
 
24
- updateMatrixWorld(force?: boolean): void;
25
-
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
+ */
26
49
  dispose(): void;
27
50
  }
@@ -1,25 +1,73 @@
1
1
  import { PointLight } from './../lights/PointLight';
2
2
  import { Matrix4 } from './../math/Matrix4';
3
3
  import { Object3D } from './../core/Object3D';
4
- import { ColorRepresentation } from '../utils';
4
+ import { ColorRepresentation } from '../math/Color';
5
5
 
6
+ /**
7
+ * This displays a helper object consisting of a spherical {@link THREE.Mesh | Mesh} for visualizing a {@link THREE.PointLight | PointLight}.
8
+ * @example
9
+ * ```typescript
10
+ * const pointLight = new THREE.PointLight(0xff0000, 1, 100);
11
+ * pointLight.position.set(10, 10, 10);
12
+ * scene.add(pointLight);
13
+ * const sphereSize = 1;
14
+ * const {@link PointLightHelper} = new THREE.PointLightHelper(pointLight, sphereSize);
15
+ * scene.add(pointLightHelper);
16
+ * ```
17
+ * @see Example: {@link https://threejs.org/examples/#webgl_helpers | WebGL / helpers}
18
+ * @see {@link https://threejs.org/docs/index.html#api/en/helpers/PointLightHelper | Official Documentation}
19
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/PointLightHelper.js | Source}
20
+ */
6
21
  export class PointLightHelper extends Object3D {
22
+ /**
23
+ * Create a new instance of {@link PointLightHelper}
24
+ * @param light The light to be visualized.
25
+ * @param sphereSize The size of the sphere helper. Expects a `Float`. Default `1`
26
+ * @param color If this is not the set the helper will take the color of the light.
27
+ */
7
28
  constructor(light: PointLight, sphereSize?: number, color?: ColorRepresentation);
8
29
 
9
30
  /**
10
- * @default 'PointLightHelper'
31
+ * A Read-only _string_ to check if `this` object type.
32
+ * @remarks Sub-classes will update this value.
33
+ * @override
34
+ * @defaultValue `PointLightHelper`
11
35
  */
12
- type: string;
36
+ override readonly type: string | 'PointLightHelper';
13
37
 
38
+ /**
39
+ * The {@link THREE.PointLight | PointLight} that is being visualized.
40
+ */
14
41
  light: PointLight;
15
- color: ColorRepresentation | undefined;
42
+
43
+ /**
44
+ * Reference to the {@link THREE.PointLight.matrixWorld | light.matrixWorld}.
45
+ */
16
46
  matrix: Matrix4;
17
47
 
18
48
  /**
19
- * @default false
49
+ * The color parameter passed in the constructor.
50
+ * @remarks If this is changed, the helper's color will update the next time {@link update} is called.
51
+ * @defaultValue `undefined`
20
52
  */
21
- matrixAutoUpdate: boolean;
53
+ color: ColorRepresentation | undefined;
22
54
 
23
- dispose(): void;
55
+ /**
56
+ * Is set to `false`, as the helper is using the {@link THREE.PointLight.matrixWorld | light.matrixWorld}.
57
+ * @see {@link THREE.Object3D.matrixAutoUpdate | Object3D.matrixAutoUpdate}.
58
+ * @defaultValue `false`.
59
+ */
60
+ override matrixAutoUpdate: boolean;
61
+
62
+ /**
63
+ * Updates the helper to match the position of the {@link THREE..light | .light}.
64
+ */
24
65
  update(): void;
66
+
67
+ /**
68
+ * Frees the GPU-related resources allocated by this instance
69
+ * @remarks
70
+ * Call this method whenever this instance is no longer used in your app.
71
+ */
72
+ dispose(): void;
25
73
  }
@@ -1,14 +1,33 @@
1
1
  import { LineSegments } from '../objects/LineSegments';
2
- import { ColorRepresentation } from '../utils';
2
+ import { ColorRepresentation } from '../math/Color';
3
3
 
4
+ /**
5
+ * The {@link PolarGridHelper} is an object to define polar grids
6
+ * @remarks
7
+ * Grids are two-dimensional arrays of lines.
8
+ * @example
9
+ * ```typescript
10
+ * const radius = 10;
11
+ * const sectors = 16;
12
+ * const rings = 8;
13
+ * const divisions = 64;
14
+ * const helper = new THREE.PolarGridHelper(radius, sectors, rings, divisions);
15
+ * scene.add(helper);
16
+ * ```
17
+ * @see Example: {@link https://threejs.org/examples/#webgl_helpers | WebGL / helpers}
18
+ * @see {@link https://threejs.org/docs/index.html#api/en/helpers/PolarGridHelper | Official Documentation}
19
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/PolarGridHelper.js | Source}
20
+ */
4
21
  export class PolarGridHelper extends LineSegments {
5
22
  /**
6
- * @param [radius=10]
7
- * @param [radials=16]
8
- * @param [circles=8]
9
- * @param [divisions=64]
10
- * @param [color1=0x444444]
11
- * @param [color2=0x888888]
23
+ * Creates a new {@link PolarGridHelper} of radius 'radius' with 'sectors' number of sectors and 'rings' number of rings, where each circle is smoothed into 'divisions' number of line segments.
24
+ * @remarks Colors are optional.
25
+ * @param radius The radius of the polar grid. This can be any positive number. Default `10`.
26
+ * @param sectors The number of sectors the grid will be divided into. This can be any positive integer. Default `16`.
27
+ * @param rings The number of rings. This can be any positive integer. Default `8`.
28
+ * @param divisions The number of line segments used for each circle. This can be any positive integer that is 3 or greater. Default `64`.
29
+ * @param color1 The first color used for grid elements. This can be a {@link THREE.Color | Color}, a hexadecimal value and an CSS-Color name. Default `0x444444`.
30
+ * @param color2 The second color used for grid elements. This can be a {@link THREE.Color | Color}, a hexadecimal value and an CSS-Color name. Default `0x888888`.
12
31
  */
13
32
  constructor(
14
33
  radius?: number,
@@ -20,9 +39,17 @@ export class PolarGridHelper extends LineSegments {
20
39
  );
21
40
 
22
41
  /**
23
- * @default 'PolarGridHelper'
42
+ * A Read-only _string_ to check if `this` object type.
43
+ * @remarks Sub-classes will update this value.
44
+ * @override
45
+ * @defaultValue `PolarGridHelper`
24
46
  */
25
- type: string;
47
+ override readonly type: string | 'PolarGridHelper';
26
48
 
49
+ /**
50
+ * Frees the GPU-related resources allocated by this instance
51
+ * @remarks
52
+ * Call this method whenever this instance is no longer used in your app.
53
+ */
27
54
  dispose(): void;
28
55
  }