@types/three 0.150.0 → 0.150.2

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 (104) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/controls/OrbitControls.d.ts +3 -3
  3. three/examples/jsm/controls/TrackballControls.d.ts +2 -2
  4. three/examples/jsm/controls/TransformControls.d.ts +2 -6
  5. three/examples/jsm/geometries/TextGeometry.d.ts +92 -15
  6. three/examples/jsm/loaders/EXRLoader.d.ts +3 -2
  7. three/examples/jsm/misc/GPUComputationRenderer.d.ts +4 -2
  8. three/package.json +2 -2
  9. three/src/Three.d.ts +0 -1
  10. three/src/audio/Audio.d.ts +184 -20
  11. three/src/audio/AudioAnalyser.d.ts +42 -4
  12. three/src/audio/AudioContext.d.ts +12 -1
  13. three/src/audio/AudioListener.d.ts +76 -8
  14. three/src/audio/PositionalAudio.d.ts +86 -5
  15. three/src/cameras/ArrayCamera.d.ts +23 -2
  16. three/src/cameras/Camera.d.ts +42 -13
  17. three/src/cameras/CubeCamera.d.ts +49 -1
  18. three/src/cameras/OrthographicCamera.d.ts +77 -25
  19. three/src/cameras/PerspectiveCamera.d.ts +132 -56
  20. three/src/cameras/StereoCamera.d.ts +29 -2
  21. three/src/constants.d.ts +431 -26
  22. three/src/core/BufferGeometry.d.ts +5 -3
  23. three/src/core/Object3D.d.ts +17 -13
  24. three/src/core/Raycaster.d.ts +1 -0
  25. three/src/geometries/BoxGeometry.d.ts +39 -16
  26. three/src/geometries/CapsuleGeometry.d.ts +35 -12
  27. three/src/geometries/CircleGeometry.d.ts +38 -12
  28. three/src/geometries/ConeGeometry.d.ts +45 -10
  29. three/src/geometries/CylinderGeometry.d.ts +41 -19
  30. three/src/geometries/DodecahedronGeometry.d.ts +14 -5
  31. three/src/geometries/EdgesGeometry.d.ts +30 -8
  32. three/src/geometries/ExtrudeGeometry.d.ts +93 -12
  33. three/src/geometries/IcosahedronGeometry.d.ts +15 -5
  34. three/src/geometries/LatheGeometry.d.ts +41 -12
  35. three/src/geometries/OctahedronGeometry.d.ts +14 -5
  36. three/src/geometries/PlaneGeometry.d.ts +35 -12
  37. three/src/geometries/PolyhedronGeometry.d.ts +41 -12
  38. three/src/geometries/RingGeometry.d.ts +39 -16
  39. three/src/geometries/ShapeGeometry.d.ts +44 -4
  40. three/src/geometries/SphereGeometry.d.ts +43 -21
  41. three/src/geometries/TetrahedronGeometry.d.ts +14 -5
  42. three/src/geometries/TorusGeometry.d.ts +35 -13
  43. three/src/geometries/TorusKnotGeometry.d.ts +39 -16
  44. three/src/geometries/TubeGeometry.d.ts +63 -15
  45. three/src/geometries/WireframeGeometry.d.ts +30 -4
  46. three/src/helpers/ArrowHelper.d.ts +1 -1
  47. three/src/helpers/BoxHelper.d.ts +1 -1
  48. three/src/helpers/DirectionalLightHelper.d.ts +1 -1
  49. three/src/helpers/GridHelper.d.ts +1 -1
  50. three/src/helpers/HemisphereLightHelper.d.ts +1 -2
  51. three/src/helpers/PointLightHelper.d.ts +1 -1
  52. three/src/helpers/PolarGridHelper.d.ts +1 -1
  53. three/src/helpers/SpotLightHelper.d.ts +1 -1
  54. three/src/lights/AmbientLight.d.ts +1 -1
  55. three/src/lights/AmbientLightProbe.d.ts +1 -1
  56. three/src/lights/DirectionalLight.d.ts +1 -1
  57. three/src/lights/HemisphereLight.d.ts +1 -2
  58. three/src/lights/HemisphereLightProbe.d.ts +1 -1
  59. three/src/lights/PointLight.d.ts +1 -1
  60. three/src/lights/RectAreaLight.d.ts +1 -1
  61. three/src/lights/SpotLight.d.ts +1 -2
  62. three/src/materials/LineBasicMaterial.d.ts +1 -2
  63. three/src/materials/MeshBasicMaterial.d.ts +1 -2
  64. three/src/materials/MeshLambertMaterial.d.ts +1 -2
  65. three/src/materials/MeshMatcapMaterial.d.ts +1 -2
  66. three/src/materials/MeshPhongMaterial.d.ts +1 -2
  67. three/src/materials/MeshStandardMaterial.d.ts +1 -2
  68. three/src/materials/MeshToonMaterial.d.ts +1 -2
  69. three/src/materials/PointsMaterial.d.ts +1 -2
  70. three/src/materials/ShadowMaterial.d.ts +1 -2
  71. three/src/materials/SpriteMaterial.d.ts +1 -2
  72. three/src/math/Color.d.ts +2 -3
  73. three/src/math/ColorManagement.d.ts +2 -2
  74. three/src/objects/Bone.d.ts +30 -3
  75. three/src/objects/Group.d.ts +37 -1
  76. three/src/objects/InstancedMesh.d.ts +122 -3
  77. three/src/objects/LOD.d.ts +62 -18
  78. three/src/objects/Line.d.ts +67 -4
  79. three/src/objects/LineLoop.d.ts +26 -1
  80. three/src/objects/LineSegments.d.ts +21 -9
  81. three/src/objects/Mesh.d.ts +60 -4
  82. three/src/objects/Points.d.ts +39 -8
  83. three/src/objects/Skeleton.d.ts +89 -3
  84. three/src/objects/SkinnedMesh.d.ts +122 -3
  85. three/src/objects/Sprite.d.ts +51 -4
  86. three/src/renderers/WebGLRenderTarget.d.ts +9 -3
  87. three/src/renderers/WebGLRenderer.d.ts +1 -2
  88. three/src/scenes/Fog.d.ts +60 -9
  89. three/src/scenes/FogExp2.d.ts +41 -7
  90. three/src/scenes/Scene.d.ts +45 -22
  91. three/src/textures/CanvasTexture.d.ts +35 -13
  92. three/src/textures/CompressedArrayTexture.d.ts +39 -5
  93. three/src/textures/CompressedTexture.d.ts +49 -20
  94. three/src/textures/CubeTexture.d.ts +71 -18
  95. three/src/textures/Data3DTexture.d.ts +74 -10
  96. three/src/textures/DataArrayTexture.d.ts +83 -9
  97. three/src/textures/DataTexture.d.ts +81 -26
  98. three/src/textures/DepthTexture.d.ts +71 -15
  99. three/src/textures/FramebufferTexture.d.ts +57 -2
  100. three/src/textures/Source.d.ts +23 -13
  101. three/src/textures/Texture.d.ts +289 -73
  102. three/src/textures/VideoTexture.d.ts +69 -13
  103. three/src/textures/types.d.ts +9 -0
  104. three/src/utils.d.ts +0 -6
@@ -5,21 +5,140 @@ import { InstancedBufferAttribute } from '../core/InstancedBufferAttribute';
5
5
  import { Mesh } from './Mesh';
6
6
  import { Matrix4 } from './../math/Matrix4';
7
7
  import { Color } from './../math/Color';
8
+ import { Box3, Sphere } from '../Three';
8
9
 
10
+ /**
11
+ * A special version of {@link THREE.Mesh | Mesh} with instanced rendering support
12
+ * @remarks
13
+ * Use {@link InstancedMesh} if you have to render a large number of objects with the same geometry and material but with different world transformations
14
+ * @remarks
15
+ * The usage of {@link InstancedMesh} will help you to reduce the number of draw calls and thus improve the overall rendering performance in your application.
16
+ * @see Example: {@link https://threejs.org/examples/#webgl_instancing_dynamic | WebGL / instancing / dynamic}
17
+ * @see Example: {@link https://threejs.org/examples/#webgl_instancing_performance | WebGL / instancing / performance}
18
+ * @see Example: {@link https://threejs.org/examples/#webgl_instancing_scatter | WebGL / instancing / scatter}
19
+ * @see Example: {@link https://threejs.org/examples/#webgl_instancing_raycast | WebGL / instancing / raycast}
20
+ * @see {@link https://threejs.org/docs/index.html#api/en/objects/InstancedMesh | Official Documentation}
21
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/objects/InstancedMesh.js | Source}
22
+ */
9
23
  export class InstancedMesh<
10
24
  TGeometry extends BufferGeometry = BufferGeometry,
11
25
  TMaterial extends Material | Material[] = Material | Material[],
12
26
  > extends Mesh<TGeometry, TMaterial> {
27
+ /**
28
+ * Create a new instance of {@link InstancedMesh}
29
+ * @param geometry An instance of {@link THREE.BufferGeometry | BufferGeometry}.
30
+ * @param material A single or an array of {@link THREE.Material | Material}. Default {@link THREE.MeshBasicMaterial | `new THREE.MeshBasicMaterial()`}.
31
+ * @param count The **maximum** number of instances of this Mesh. Expects a `Integer`
32
+ */
13
33
  constructor(geometry: TGeometry | undefined, material: TMaterial | undefined, count: number);
14
34
 
35
+ /**
36
+ * Read-only flag to check if a given object is of type {@link InstancedMesh}.
37
+ * @remarks This is a _constant_ value
38
+ * @defaultValue `true`
39
+ */
40
+ readonly isInstancedMesh: true;
41
+
42
+ /////////////////////////////////////////////////
43
+ // FUTURE - r151
44
+ /////////////////////////////////////////////////
45
+ // /**
46
+ // * This bounding box encloses all instances of the {@link InstancedMesh},, which can be calculated with {@link computeBoundingBox | .computeBoundingBox()}.
47
+ // * @remarks Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are `null`.
48
+ // * @defaultValue `null`
49
+ // */
50
+ // boundingBox: Box3 | null;
51
+
52
+ // /**
53
+ // * This bounding sphere encloses all instances of the {@link InstancedMesh}, which can be calculated with {@link computeBoundingSphere | .computeBoundingSphere()}.
54
+ // * @remarks bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are `null`.
55
+ // * @defaultValue `null`
56
+ // */
57
+ // boundingSphere: Sphere | null;
58
+ /////////////////////////////////////////////////
59
+
60
+ /**
61
+ * The number of instances.
62
+ * @remarks
63
+ * The `count` value passed into the {@link InstancedMesh | constructor} represents the **maximum** number of instances of this mesh.
64
+ * You can change the number of instances at runtime to an integer value in the range `[0, count]`.
65
+ * @remarks If you need more instances than the original `count` value, you have to create a new InstancedMesh.
66
+ * @remarks Expects a `Integer`
67
+ */
15
68
  count: number;
16
- instanceColor: null | InstancedBufferAttribute;
69
+
70
+ /**
71
+ * Represents the colors of all instances.
72
+ * You have to set {@link InstancedBufferAttribute.needsUpdate | .instanceColor.needsUpdate()} flag to `true` if you modify instanced data via {@link setColorAt | .setColorAt()}.
73
+ * @defaultValue `null`
74
+ */
75
+ instanceColor: InstancedBufferAttribute | null;
76
+
77
+ /**
78
+ * Represents the local transformation of all instances.
79
+ * You have to set {@link InstancedBufferAttribute.needsUpdate | .instanceMatrix.needsUpdate()} flag to `true` if you modify instanced data via {@link setMatrixAt | .setMatrixAt()}.
80
+ */
17
81
  instanceMatrix: InstancedBufferAttribute;
18
- readonly isInstancedMesh: true;
19
82
 
83
+ /////////////////////////////////////////////////
84
+ // FUTURE - r151
85
+ /////////////////////////////////////////////////
86
+ // /**
87
+ // * Computes bounding box of the all instances, updating {@link boundingBox | .boundingBox} attribute.
88
+ // * @remarks Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are `null`.
89
+ // */
90
+ // computeBoundingBox(): void;
91
+
92
+ // /**
93
+ // * Computes bounding sphere of the all instances, updating {@link boundingSphere | .boundingSphere} attribute.
94
+ // * @remarks bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are `null`.
95
+ // */
96
+ // computeBoundingSphere(): void;
97
+ /////////////////////////////////////////////////
98
+
99
+ /**
100
+ * Get the color of the defined instance.
101
+ * @param index The index of an instance. Values have to be in the range `[0, count]`. Expects a `Integer`
102
+ * @param color This color object will be set to the color of the defined instance.
103
+ */
20
104
  getColorAt(index: number, color: Color): void;
21
- getMatrixAt(index: number, matrix: Matrix4): void;
105
+
106
+ /**
107
+ * Sets the given color to the defined instance
108
+ * @remarks
109
+ * Make sure you set {@link InstancedBufferAttribute.needsUpdate | .instanceColor.needsUpdate()} to `true` after updating all the colors.
110
+ * @param index The index of an instance. Values have to be in the range `[0, count]`. Expects a `Integer`
111
+ * @param color The color of a single instance.
112
+ */
22
113
  setColorAt(index: number, color: Color): void;
114
+
115
+ /**
116
+ * Get the local transformation matrix of the defined instance.
117
+ * @param index The index of an instance Values have to be in the range `[0, count]`. Expects a `Integer`
118
+ * @param matrix This 4x4 matrix will be set to the local transformation matrix of the defined instance.
119
+ */
120
+ getMatrixAt(index: number, matrix: Matrix4): void;
121
+
122
+ /**
123
+ * Sets the given local transformation matrix to the defined instance.
124
+ * @remarks
125
+ * Make sure you set {@link InstancedBufferAttribute.needsUpdate | .instanceMatrix.needsUpdate()} flag to `true` after updating all the matrices.
126
+ * @param index The index of an instance. Values have to be in the range `[0, count]`. Expects a `Integer`
127
+ * @param matrix A 4x4 matrix representing the local transformation of a single instance.
128
+ */
23
129
  setMatrixAt(index: number, matrix: Matrix4): void;
130
+
131
+ /**
132
+ * No effect in {@link InstancedMesh}.
133
+ * @ignore
134
+ * @hidden
135
+ */
136
+ override updateMorphTargets(): void;
137
+
138
+ /**
139
+ * Frees the GPU-related resources allocated by this instance
140
+ * @remarks
141
+ * Call this method whenever this instance is no longer used in your app.
142
+ */
24
143
  dispose(): void;
25
144
  }
@@ -3,44 +3,88 @@ import { Raycaster } from './../core/Raycaster';
3
3
  import { Camera } from './../cameras/Camera';
4
4
  import { Intersection } from '../core/Raycaster';
5
5
 
6
+ /**
7
+ * Every level is associated with an object, and rendering can be switched between them at the distances specified
8
+ * @remarks
9
+ * Typically you would create, say, three meshes, one for far away (low detail), one for mid range (medium detail) and one for close up (high detail).
10
+ * @example
11
+ * ```typescript
12
+ * const {@link LOD} = new THREE.LOD();
13
+ * //Create spheres with 3 levels of detail and create new {@link LOD} levels for them
14
+ * for (let i = 0; i & lt; 3; i++) {
15
+ * const geometry = new THREE.IcosahedronGeometry(10, 3 - i)
16
+ * const mesh = new THREE.Mesh(geometry, material);
17
+ * lod.addLevel(mesh, i * 75);
18
+ * }
19
+ * scene.add(lod);
20
+ * ```
21
+ * @see Example: {@link https://threejs.org/examples/#webgl_lod | webgl / {@link LOD} }
22
+ * @see {@link https://threejs.org/docs/index.html#api/en/objects/LOD | Official Documentation}
23
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/objects/LOD.js | Source}
24
+ */
6
25
  export class LOD extends Object3D {
26
+ /**
27
+ * Creates a new {@link LOD}.
28
+ */
7
29
  constructor();
8
30
 
9
- type: 'LOD';
31
+ /**
32
+ * Read-only flag to check if a given object is of type {@link LOD}.
33
+ * @remarks This is a _constant_ value
34
+ * @defaultValue `true`
35
+ */
36
+ readonly isLOD: true;
37
+
38
+ /**
39
+ * @override
40
+ * @defaultValue `LOD`
41
+ */
42
+ override readonly type: string | 'LOD';
10
43
 
11
44
  /**
12
- *
13
45
  * An array of level objects
14
- *
15
- * Each level is an object with the following properties:
16
- *
17
- * - object - The Object3D to display at this level.
18
- * - distance - The distance at which to display this level of detail.
19
- * - hysteresis - Threshold used to avoid flickering at LOD boundaries, as a fraction of distance.
20
46
  */
21
- levels: Array<{ distance: number; hysteresis: number; object: Object3D }>;
47
+ levels: Array<{
48
+ /** The Object3D to display at this level. */
49
+ object: Object3D;
50
+ /** The distance at which to display this level of detail. Expects a `Float`. */
51
+ distance: number;
52
+ /** Threshold used to avoid flickering at LOD boundaries, as a fraction of distance. Expects a `Float`. */
53
+ hysteresis: number;
54
+ }>;
22
55
 
56
+ /**
57
+ * Whether the {@link LOD} object is updated automatically by the renderer per frame or not.
58
+ * If set to `false`, you have to call {@link update | .update()} in the render loop by yourself.
59
+ * @defaultValue `true`
60
+ */
23
61
  autoUpdate: boolean;
24
- readonly isLOD: true;
25
62
 
26
63
  /**
27
64
  * Adds a mesh that will display at a certain distance and greater. Typically the further away the distance, the lower the detail on the mesh.
28
65
  *
29
66
  * @param object The Object3D to display at this level.
30
- * @param distance The distance at which to display this level of detail. Default 0.0.
31
- * @param hysteresis Threshold used to avoid flickering at LOD boundaries, as a fraction of distance. Default 0.0.
67
+ * @param distance The distance at which to display this level of detail. Expects a `Float`. Default `0.0`.
68
+ * @param hysteresis Threshold used to avoid flickering at LOD boundaries, as a fraction of distance. Expects a `Float`. Default `0.0`.
32
69
  */
33
70
  addLevel(object: Object3D, distance?: number, hysteresis?: number): this;
34
71
 
72
+ /**
73
+ * Get the currently active {@link LOD} level
74
+ * @remarks
75
+ * As index of the levels array.
76
+ */
35
77
  getCurrentLevel(): number;
78
+
79
+ /**
80
+ * Get a reference to the first {@link THREE.Object3D | Object3D} (mesh) that is greater than {@link distance}.
81
+ * @param distance Expects a `Float`
82
+ */
36
83
  getObjectForDistance(distance: number): Object3D | null;
37
- raycast(raycaster: Raycaster, intersects: Intersection[]): void;
38
- update(camera: Camera): void;
39
- toJSON(meta: any): any;
40
84
 
41
- // TODO: Remove this
42
85
  /**
43
- * @deprecated Use {@link LOD#levels .levels} instead.
86
+ * Set the visibility of each {@link levels | level}'s {@link THREE.Object3D | object} based on distance from the {@link THREE.Camera | camera}.
87
+ * @param camera
44
88
  */
45
- objects: any[];
89
+ update(camera: Camera): void;
46
90
  }
@@ -4,22 +4,85 @@ import { Object3D } from './../core/Object3D';
4
4
  import { BufferGeometry } from '../core/BufferGeometry';
5
5
  import { Intersection } from '../core/Raycaster';
6
6
 
7
+ /**
8
+ * A continuous line.
9
+ * @remarks
10
+ * This is nearly the same as {@link THREE.LineSegments | LineSegments},
11
+ * the only difference is that it is rendered using {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements | gl.LINE_STRIP}
12
+ * instead of {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements | gl.LINES}
13
+ * @example
14
+ * ```typescript
15
+ * const material = new THREE.LineBasicMaterial({
16
+ * color: 0x0000ff
17
+ * });
18
+ * const points = [];
19
+ * points.push(new THREE.Vector3(-10, 0, 0));
20
+ * points.push(new THREE.Vector3(0, 10, 0));
21
+ * points.push(new THREE.Vector3(10, 0, 0));
22
+ * const geometry = new THREE.BufferGeometry().setFromPoints(points);
23
+ * const {@link Line} = new THREE.Line(geometry, material);
24
+ * scene.add(line);
25
+ * ```
26
+ * @see {@link https://threejs.org/docs/index.html#api/en/objects/Line | Official Documentation}
27
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/objects/Line.js | Source}
28
+ */
7
29
  export class Line<
8
30
  TGeometry extends BufferGeometry = BufferGeometry,
9
31
  TMaterial extends Material | Material[] = Material | Material[],
10
32
  > extends Object3D {
33
+ /**
34
+ * Create a new instance of {@link Line}
35
+ * @param geometry Vertices representing the {@link Line} segment(s). Default {@link THREE.BufferGeometry | `new THREE.BufferGeometry()`}.
36
+ * @param material Material for the line. Default {@link THREE.LineBasicMaterial | `new THREE.LineBasicMaterial()`}.
37
+ */
11
38
  constructor(geometry?: TGeometry, material?: TMaterial);
12
39
 
40
+ /**
41
+ * Read-only flag to check if a given object is of type {@link Line}.
42
+ * @remarks This is a _constant_ value
43
+ * @defaultValue `true`
44
+ */
45
+ readonly isLine: true;
46
+
47
+ /**
48
+ * @override
49
+ * @defaultValue `Line`
50
+ */
51
+ override readonly type: string | 'Line';
52
+
53
+ /**
54
+ * Vertices representing the {@link Line} segment(s).
55
+ */
13
56
  geometry: TGeometry;
14
- material: TMaterial;
15
57
 
16
- type: 'Line' | 'LineLoop' | 'LineSegments' | string;
17
- readonly isLine: true;
58
+ /**
59
+ * Material for the line.
60
+ */
61
+ material: TMaterial;
18
62
 
63
+ /**
64
+ * An array of weights typically from `0-1` that specify how much of the morph is applied.
65
+ * @defaultValue `undefined`, but reset to a blank array by {@link updateMorphTargets | .updateMorphTargets()}.
66
+ */
19
67
  morphTargetInfluences?: number[] | undefined;
68
+
69
+ /**
70
+ * A dictionary of morphTargets based on the `morphTarget.name` property.
71
+ * @defaultValue `undefined`, but reset to a blank array by {@link updateMorphTargets | .updateMorphTargets()}.
72
+ */
20
73
  morphTargetDictionary?: { [key: string]: number } | undefined;
21
74
 
75
+ /**
76
+ * Computes an array of distance values which are necessary for {@link THREE.LineDashedMaterial | LineDashedMaterial}
77
+ * @remarks
78
+ * For each vertex in the geometry, the method calculates the cumulative length from the current point to the very beginning of the line.
79
+ */
22
80
  computeLineDistances(): this;
23
- raycast(raycaster: Raycaster, intersects: Intersection[]): void;
81
+
82
+ /**
83
+ * Updates the morphTargets to have no influence on the object
84
+ * @remarks
85
+ * Resets the {@link morphTargetInfluences | .morphTargetInfluences} and {@link morphTargetDictionary | .morphTargetDictionary} properties.
86
+ */
24
87
  updateMorphTargets(): void;
25
88
  }
@@ -2,12 +2,37 @@ import { Line } from './Line';
2
2
  import { Material } from './../materials/Material';
3
3
  import { BufferGeometry } from '../core/BufferGeometry';
4
4
 
5
+ /**
6
+ * A continuous line that connects back to the start.
7
+ * @remarks
8
+ * This is nearly the same as {@link THREE.Line | Line},
9
+ * the only difference is that it is rendered using {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements | gl.LINE_LOOP}
10
+ * instead of {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements | gl.LINE_STRIP},
11
+ * which draws a straight line to the next vertex, and connects the last vertex back to the first.
12
+ * @see {@link https://threejs.org/docs/index.html#api/en/objects/LineLoop | Official Documentation}
13
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/objects/LineLoop.js | Source}
14
+ */
5
15
  export class LineLoop<
6
16
  TGeometry extends BufferGeometry = BufferGeometry,
7
17
  TMaterial extends Material | Material[] = Material | Material[],
8
18
  > extends Line<TGeometry, TMaterial> {
19
+ /**
20
+ * Create a new instance of {@link LineLoop}
21
+ * @param geometry List of vertices representing points on the line loop. Default {@link THREE.BufferGeometry | `new THREE.BufferGeometry()`}.
22
+ * @param material Material for the line. Default {@link THREE.LineBasicMaterial | `new THREE.LineBasicMaterial()`}.
23
+ */
9
24
  constructor(geometry?: TGeometry, material?: TMaterial);
10
25
 
11
- type: 'LineLoop';
26
+ /**
27
+ * Read-only flag to check if a given object is of type {@link LineLoop}.
28
+ * @remarks This is a _constant_ value
29
+ * @defaultValue `true`
30
+ */
12
31
  readonly isLineLoop: true;
32
+
33
+ /**
34
+ * @override
35
+ * @defaultValue `LineLoop`
36
+ */
37
+ override readonly type: string | 'LineLoop';
13
38
  }
@@ -3,23 +3,35 @@ import { Line } from './Line';
3
3
  import { BufferGeometry } from '../core/BufferGeometry';
4
4
 
5
5
  /**
6
- * @deprecated
6
+ * A series of lines drawn between pairs of vertices.
7
+ * @remarks
8
+ * This is nearly the same as {@link THREE.Line | Line},
9
+ * the only difference is that it is rendered using {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements | gl.LINES}
10
+ * instead of {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements | gl.LINE_STRIP}.
11
+ * @see {@link https://threejs.org/docs/index.html#api/en/objects/LineSegments | Official Documentation}
12
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/objects/LineSegments.js | Source}
7
13
  */
8
- export const LineStrip: number;
9
- /**
10
- * @deprecated
11
- */
12
- export const LinePieces: number;
13
-
14
14
  export class LineSegments<
15
15
  TGeometry extends BufferGeometry = BufferGeometry,
16
16
  TMaterial extends Material | Material[] = Material | Material[],
17
17
  > extends Line<TGeometry, TMaterial> {
18
+ /**
19
+ * Create a new instance of {@link LineSegments}
20
+ * @param geometry Pair(s) of vertices representing each line segment(s). Default {@link THREE.BufferGeometry | `new THREE.BufferGeometry()`}.
21
+ * @param material Material for the line. Default {@link THREE.LineBasicMaterial | `new THREE.LineBasicMaterial()`}.
22
+ */
18
23
  constructor(geometry?: TGeometry, material?: TMaterial);
19
24
 
20
25
  /**
21
- * @default 'LineSegments'
26
+ * Read-only flag to check if a given object is of type {@link LineSegments}.
27
+ * @remarks This is a _constant_ value
28
+ * @defaultValue `true`
22
29
  */
23
- type: 'LineSegments' | string;
24
30
  readonly isLineSegments: true;
31
+
32
+ /**
33
+ * @override
34
+ * @defaultValue `LineSegments`
35
+ */
36
+ override readonly type: string | 'LineSegments';
25
37
  }
@@ -5,26 +5,82 @@ import { BufferGeometry } from '../core/BufferGeometry';
5
5
  import { Intersection } from '../core/Raycaster';
6
6
  import { Vector3 } from '../math/Vector3';
7
7
 
8
+ /**
9
+ * Class representing triangular {@link https://en.wikipedia.org/wiki/Polygon_mesh | polygon mesh} based objects.
10
+ * @remarks
11
+ * Also serves as a base for other classes such as {@link THREE.SkinnedMesh | SkinnedMesh}, {@link THREE.InstancedMesh | InstancedMesh}.
12
+ * @example
13
+ * ```typescript
14
+ * const geometry = new THREE.BoxGeometry(1, 1, 1);
15
+ * const material = new THREE.MeshBasicMaterial({
16
+ * color: 0xffff00
17
+ * });
18
+ * const {@link Mesh} = new THREE.Mesh(geometry, material);
19
+ * scene.add(mesh);
20
+ * ```
21
+ * @see {@link https://threejs.org/docs/index.html#api/en/objects/Mesh | Official Documentation}
22
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/objects/Mesh.js | Source}
23
+ */
8
24
  export class Mesh<
9
25
  TGeometry extends BufferGeometry = BufferGeometry,
10
26
  TMaterial extends Material | Material[] = Material | Material[],
11
27
  > extends Object3D {
28
+ /**
29
+ * Create a new instance of {@link Mesh}
30
+ * @param geometry An instance of {@link THREE.BufferGeometry | BufferGeometry}. Default {@link THREE.BufferGeometry | `new THREE.BufferGeometry()`}.
31
+ * @param material A single or an array of {@link THREE.Material | Material}. Default {@link THREE.MeshBasicMaterial | `new THREE.MeshBasicMaterial()`}.
32
+ */
12
33
  constructor(geometry?: TGeometry, material?: TMaterial);
13
34
 
35
+ /**
36
+ * Read-only flag to check if a given object is of type {@link Mesh}.
37
+ * @remarks This is a _constant_ value
38
+ * @defaultValue `true`
39
+ */
40
+ readonly isMesh: true;
41
+
42
+ /**
43
+ * @override
44
+ * @defaultValue `Mesh`
45
+ */
46
+ override readonly type: string | 'Mesh';
47
+
48
+ /**
49
+ * An instance of {@link THREE.BufferGeometry | BufferGeometry} (or derived classes), defining the object's structure.
50
+ * @defaultValue {@link THREE.BufferGeometry | `new THREE.BufferGeometry()`}.
51
+ */
14
52
  geometry: TGeometry;
53
+
54
+ /**
55
+ * An instance of material derived from the {@link THREE.Material | Material} base class or an array of materials, defining the object's appearance.
56
+ * @defaultValue {@link THREE.MeshBasicMaterial | `new THREE.MeshBasicMaterial()`}.
57
+ */
15
58
  material: TMaterial;
59
+
60
+ /**
61
+ * An array of weights typically from `0-1` that specify how much of the morph is applied.
62
+ * @defaultValue `undefined`, _but reset to a blank array by {@link updateMorphTargets | .updateMorphTargets()}._
63
+ */
16
64
  morphTargetInfluences?: number[] | undefined;
65
+
66
+ /**
67
+ * A dictionary of morphTargets based on the `morphTarget.name` property.
68
+ * @defaultValue `undefined`, _but rebuilt by {@link updateMorphTargets | .updateMorphTargets()}._
69
+ *
70
+ */
17
71
  morphTargetDictionary?: { [key: string]: number } | undefined;
18
- readonly isMesh: true;
19
- type: string;
20
72
 
73
+ /**
74
+ * Updates the morphTargets to have no influence on the object
75
+ * @remarks Resets the {@link morphTargetInfluences} and {@link morphTargetDictionary} properties.
76
+ */
21
77
  updateMorphTargets(): void;
22
78
 
23
79
  /**
24
80
  * Get the local-space position of the vertex at the given index,
25
81
  * taking into account the current animation state of both morph targets and skinning.
82
+ * @param index Expects a `Integer`
83
+ * @param target
26
84
  */
27
85
  getVertexPosition(index: number, target: Vector3): Vector3;
28
-
29
- raycast(raycaster: Raycaster, intersects: Intersection[]): void;
30
86
  }
@@ -5,33 +5,64 @@ import { BufferGeometry } from '../core/BufferGeometry';
5
5
  import { Intersection } from '../core/Raycaster';
6
6
 
7
7
  /**
8
- * A class for displaying points. The points are rendered by the WebGLRenderer using gl.POINTS.
8
+ * A class for displaying {@link Points}
9
+ * @remarks
10
+ * The {@link Points} are rendered by the {@link THREE.WebGLRenderer | WebGLRenderer} using {@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/drawElements | gl.POINTS}.
11
+ * @see {@link https://threejs.org/docs/index.html#api/en/objects/Points | Official Documentation}
12
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/objects/Points.js | Source}
9
13
  */
10
14
  export class Points<
11
15
  TGeometry extends BufferGeometry = BufferGeometry,
12
16
  TMaterial extends Material | Material[] = Material | Material[],
13
17
  > extends Object3D {
14
18
  /**
15
- * @param geometry An instance of BufferGeometry.
16
- * @param material An instance of Material (optional).
19
+ * Create a new instance of {@link Points}
20
+ * @param geometry An instance of {@link THREE.BufferGeometry | BufferGeometry}. Default {@link THREE.BufferGeometry | `new THREE.BufferGeometry()`}.
21
+ * @param material A single or an array of {@link THREE.Material | Material}. Default {@link THREE.PointsMaterial | `new THREE.PointsMaterial()`}.
17
22
  */
18
23
  constructor(geometry?: TGeometry, material?: TMaterial);
19
24
 
20
- type: 'Points';
25
+ /**
26
+ * Read-only flag to check if a given object is of type {@link Points}.
27
+ * @remarks This is a _constant_ value
28
+ * @defaultValue `true`
29
+ */
30
+ readonly isPoints: true;
31
+
32
+ /**
33
+ * @override
34
+ * @defaultValue `Points`
35
+ */
36
+ override readonly type: string | 'Points';
37
+
38
+ /**
39
+ * An array of weights typically from `0-1` that specify how much of the morph is applied.
40
+ * @defaultValue `undefined`, _but reset to a blank array by {@link updateMorphTargets | .updateMorphTargets()}._
41
+ */
21
42
  morphTargetInfluences?: number[] | undefined;
43
+
44
+ /**
45
+ * A dictionary of morphTargets based on the `morphTarget.name` property.
46
+ * @defaultValue `undefined`, _but rebuilt by {@link updateMorphTargets | .updateMorphTargets()}._
47
+ *
48
+ */
22
49
  morphTargetDictionary?: { [key: string]: number } | undefined;
23
- readonly isPoints: true;
24
50
 
25
51
  /**
26
- * An instance of BufferGeometry, where each vertex designates the position of a particle in the system.
52
+ * An instance of {@link THREE.BufferGeometry | BufferGeometry} (or derived classes), defining the object's structure.
53
+ * @remarks each vertex designates the position of a particle in the system.
27
54
  */
28
55
  geometry: TGeometry;
29
56
 
30
57
  /**
31
- * An instance of Material, defining the object's appearance. Default is a PointsMaterial with randomised colour.
58
+ * An instance of {@link THREE.Material | Material}, defining the object's appearance.
59
+ * @defaultValue {@link THREE.PointsMaterial | `new THREE.PointsMaterial()`}, _with randomised colour_.
32
60
  */
33
61
  material: TMaterial;
34
62
 
35
- raycast(raycaster: Raycaster, intersects: Intersection[]): void;
63
+ /**
64
+ * Updates the morphTargets to have no influence on the object
65
+ * @remarks Resets the {@link morphTargetInfluences} and {@link morphTargetDictionary} properties.
66
+ */
36
67
  updateMorphTargets(): void;
37
68
  }