@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
@@ -4,29 +4,76 @@ import { Matrix4 } from './../math/Matrix4';
4
4
  import { Object3D } from './../core/Object3D';
5
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
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
  }
@@ -4,16 +4,69 @@ import { MeshBasicMaterial } from './../materials/MeshBasicMaterial';
4
4
  import { Object3D } from './../core/Object3D';
5
5
  import { ColorRepresentation } from '../math/Color';
6
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
+ */
7
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
+ */
8
25
  constructor(light: HemisphereLight, size: number, color?: ColorRepresentation);
9
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
+ */
10
38
  light: HemisphereLight;
39
+
40
+ /**
41
+ * Reference to the {@link THREE.HemisphereLight.matrixWorld | light.matrixWorld}.
42
+ */
11
43
  matrix: Matrix4;
12
- matrixAutoUpdate: boolean;
13
- material: MeshBasicMaterial;
14
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
+ */
15
59
  color: ColorRepresentation | undefined;
16
60
 
17
- dispose(): void;
61
+ /**
62
+ * Updates the helper to match the position and direction of the {@link .light | HemisphereLight}.
63
+ */
18
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;
19
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
  }
@@ -3,23 +3,71 @@ import { Matrix4 } from './../math/Matrix4';
3
3
  import { Object3D } from './../core/Object3D';
4
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
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
  }
@@ -1,30 +1,78 @@
1
+ import { SkinnedMesh } from '../Three';
1
2
  import { Object3D } from './../core/Object3D';
2
3
  import { Matrix4 } from './../math/Matrix4';
3
4
  import { Bone } from './../objects/Bone';
4
5
  import { LineSegments } from './../objects/LineSegments';
5
6
 
7
+ /**
8
+ * A helper object to assist with visualizing a {@link Skeleton | Skeleton}
9
+ * @remarks
10
+ * The helper is rendered using a {@link LineBasicMaterial | LineBasicMaterial}.
11
+ * @example
12
+ * ```typescript
13
+ * const helper = new THREE.SkeletonHelper(skinnedMesh);
14
+ * scene.add(helper);
15
+ * ```
16
+ * @see Example: {@link https://threejs.org/examples/#webgl_animation_skinning_blending | WebGL / animation / skinning / blending}
17
+ * @see Example: {@link https://threejs.org/examples/#webgl_animation_skinning_morph | WebGL / animation / skinning / morph}
18
+ * @see Example: {@link https://threejs.org/examples/#webgl_loader_bvh | WebGL / loader / bvh }
19
+ * @see {@link https://threejs.org/docs/index.html#api/en/helpers/SkeletonHelper | Official Documentation}
20
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/SkeletonHelper.js | Source}
21
+ */
6
22
  export class SkeletonHelper extends LineSegments {
7
- constructor(object: Object3D);
23
+ /**
24
+ * Create a new instance of {@link SkeletonHelper}
25
+ * @param object Usually an instance of {@link THREE.SkinnedMesh | SkinnedMesh}.
26
+ * However, any instance of {@link THREE.Object3D | Object3D} can be used if it represents a hierarchy of {@link Bone | Bone}s (via {@link THREE.Object3D.children | Object3D.children}).
27
+ */
28
+ constructor(object: SkinnedMesh | Object3D);
29
+
30
+ /**
31
+ * Read-only flag to check if a given object is of type {@link SkeletonHelper}.
32
+ * @remarks This is a _constant_ value
33
+ * @defaultValue `true`
34
+ */
35
+ readonly isSkeletonHelper = true;
8
36
 
9
37
  /**
10
- * @default 'SkeletonHelper'
38
+ * A Read-only _string_ to check if `this` object type.
39
+ * @remarks Sub-classes will update this value.
40
+ * @override
41
+ * @defaultValue `SkeletonHelper`
11
42
  */
12
- type: string;
43
+ override readonly type: string | 'SkeletonHelper';
13
44
 
45
+ /**
46
+ * The list of bones that the helper renders as {@link Line | Lines}.
47
+ */
14
48
  bones: Bone[];
15
- root: Object3D;
16
49
 
17
- readonly isSkeletonHelper: true;
50
+ /**
51
+ * The object passed in the constructor.
52
+ */
53
+ root: SkinnedMesh | Object3D;
18
54
 
55
+ /**
56
+ * Reference to the {@link THREE.Object3D.matrixWorld | root.matrixWorld}.
57
+ */
19
58
  matrix: Matrix4;
20
59
 
21
60
  /**
22
- * @default false
61
+ * Is set to `false`, as the helper is using the {@link THREE.Object3D.matrixWorld | root.matrixWorld}.
62
+ * @see {@link THREE.Object3D.matrixAutoUpdate | Object3D.matrixAutoUpdate}.
63
+ * @defaultValue `false`.
23
64
  */
24
- matrixAutoUpdate: boolean;
65
+ override matrixAutoUpdate: boolean;
25
66
 
26
- getBoneList(object: Object3D): Bone[];
67
+ /**
68
+ * Updates the helper.
69
+ */
27
70
  update(): void;
28
71
 
72
+ /**
73
+ * Frees the GPU-related resources allocated by this instance
74
+ * @remarks
75
+ * Call this method whenever this instance is no longer used in your app.
76
+ */
29
77
  dispose(): void;
30
78
  }
@@ -4,19 +4,74 @@ import { Object3D } from './../core/Object3D';
4
4
  import { LineSegments } from '../objects/LineSegments';
5
5
  import { ColorRepresentation } from '../math/Color';
6
6
 
7
+ /**
8
+ * This displays a cone shaped helper object for a {@link THREE.SpotLight | SpotLight}.
9
+ * @example
10
+ * ```typescript
11
+ * const spotLight = new THREE.SpotLight(0xffffff);
12
+ * spotLight.position.set(10, 10, 10);
13
+ * scene.add(spotLight);
14
+ * const {@link SpotLightHelper} = new THREE.SpotLightHelper(spotLight);
15
+ * scene.add(spotLightHelper);
16
+ * ```
17
+ * @see Example: {@link https://threejs.org/examples/#webgl_lights_spotlights | WebGL/ lights / spotlights }
18
+ * @see {@link https://threejs.org/docs/index.html#api/en/helpers/SpotLightHelper | Official Documentation}
19
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/SpotLightHelper.js | Source}
20
+ */
7
21
  export class SpotLightHelper extends Object3D {
22
+ /**
23
+ * Create a new instance of {@link SpotLightHelper}
24
+ * @param light The {@link THREE.SpotLight | SpotLight} to be visualized.
25
+ * @param color If this is not the set the helper will take the color of the light. Default `light.color`
26
+ */
8
27
  constructor(light: Light, color?: ColorRepresentation);
9
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 `SpotLightHelper`
34
+ */
35
+ override readonly type: string | 'SpotLightHelper';
36
+
37
+ /**
38
+ * {@link THREE.LineSegments | LineSegments} used to visualize the light.
39
+ */
40
+ cone: LineSegments;
41
+
42
+ /**
43
+ * Reference to the {@link THREE.SpotLight | SpotLight} being visualized.
44
+ */
10
45
  light: Light;
46
+
47
+ /**
48
+ * Reference to the spotLight's {@link Object3D.matrixWorld | matrixWorld}.
49
+ */
11
50
  matrix: Matrix4;
12
51
 
13
52
  /**
14
- * @default false
53
+ * The color parameter passed in the constructor.
54
+ * If this is changed, the helper's color will update the next time {@link SpotLightHelper.update | update} is called.
55
+ * @defaultValue `undefined`
15
56
  */
16
- matrixAutoUpdate: boolean;
17
57
  color: ColorRepresentation | undefined;
18
- cone: LineSegments;
19
58
 
20
- dispose(): void;
59
+ /**
60
+ * Is set to `false`, as the helper is using the {@link THREE.Light.matrixWorld | light.matrixWorld}.
61
+ * @see {@link THREE.Object3D.matrixAutoUpdate | Object3D.matrixAutoUpdate}.
62
+ * @defaultValue `false`.
63
+ */
64
+ override matrixAutoUpdate: boolean;
65
+
66
+ /**
67
+ * Updates the light helper.
68
+ */
21
69
  update(): void;
70
+
71
+ /**
72
+ * Frees the GPU-related resources allocated by this instance
73
+ * @remarks
74
+ * Call this method whenever this instance is no longer used in your app.
75
+ */
76
+ dispose(): void;
22
77
  }
@@ -2,22 +2,35 @@ import { ColorRepresentation } from '../math/Color';
2
2
  import { Light } from './Light';
3
3
 
4
4
  /**
5
- * This light's color gets applied to all the objects in the scene globally.
6
- *
7
- * @source https://github.com/mrdoob/three.js/blob/master/src/lights/AmbientLight.js
5
+ * This light globally illuminates all objects in the scene equally.
6
+ * @remarks This light cannot be used to cast shadows as it does not have a direction.
7
+ * @example
8
+ * ```typescript
9
+ * const light = new THREE.AmbientLight(0x404040); // soft white light
10
+ * scene.add(light);
11
+ * ```
12
+ * @see {@link https://threejs.org/docs/index.html#api/en/lights/AmbientLight | Official Documentation}
13
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/lights/AmbientLight.js | Source}
8
14
  */
9
- export class AmbientLight extends Light {
15
+ export class AmbientLight extends Light<undefined> {
10
16
  /**
11
- * This creates a Ambientlight with a color.
12
- * @param color Numeric value of the RGB component of the color or a Color instance.
13
- * @param [intensity=1]
17
+ * Creates a new {@link AmbientLight}.
18
+ * @param color Numeric value of the RGB component of the color. Default `0xffffff`
19
+ * @param intensity Numeric value of the light's strength/intensity. Expects a `Float`. Default `1`
14
20
  */
15
21
  constructor(color?: ColorRepresentation, intensity?: number);
16
22
 
17
23
  /**
18
- * @default 'AmbientLight'
24
+ * Read-only flag to check if a given object is of type {@link AmbientLight}.
25
+ * @remarks This is a _constant_ value
26
+ * @defaultValue `true`
19
27
  */
20
- type: string;
21
-
22
28
  readonly isAmbientLight: true;
29
+
30
+ /**
31
+ * A Read-only _string_ to check if `this` object type.
32
+ * @remarks Sub-classes will update this value.
33
+ * @defaultValue `AmbientLight`
34
+ */
35
+ override readonly type: string | 'AmbientLight';
23
36
  }
@@ -1,8 +1,26 @@
1
1
  import { ColorRepresentation } from '../math/Color';
2
2
  import { LightProbe } from './LightProbe';
3
3
 
4
+ /**
5
+ * Light probes are an alternative way of adding light to a 3D scene
6
+ * @remarks
7
+ * {@link AmbientLightProbe} is the light estimation data of a single ambient light in the scene
8
+ * For more information about light probes, go to {@link THREE.LightProbe | LightProbe}.
9
+ * @see {@link https://threejs.org/docs/index.html#api/en/lights/AmbientLightProbe | Official Documentation}
10
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/lights/AmbientLightProbe.js | Source}
11
+ */
4
12
  export class AmbientLightProbe extends LightProbe {
13
+ /**
14
+ * Creates a new {@link AmbientLightProbe}.
15
+ * @param color An instance of Color, string representing a color or a number representing a color.
16
+ * @param intensity Numeric value of the light probe's intensity. Expects a `Float`. Default `1`
17
+ */
5
18
  constructor(color?: ColorRepresentation, intensity?: number);
6
19
 
20
+ /**
21
+ * Read-only flag to check if a given object is of type {@link AmbientLightProbe}.
22
+ * @remarks This is a _constant_ value
23
+ * @defaultValue `true`
24
+ */
7
25
  readonly isAmbientLightProbe: true;
8
26
  }