@types/three 0.150.0 → 0.150.1

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 (74) 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/audio/Audio.d.ts +184 -20
  10. three/src/audio/AudioAnalyser.d.ts +42 -4
  11. three/src/audio/AudioContext.d.ts +12 -1
  12. three/src/audio/AudioListener.d.ts +76 -8
  13. three/src/audio/PositionalAudio.d.ts +86 -5
  14. three/src/cameras/ArrayCamera.d.ts +23 -2
  15. three/src/cameras/Camera.d.ts +42 -13
  16. three/src/cameras/CubeCamera.d.ts +49 -1
  17. three/src/cameras/OrthographicCamera.d.ts +77 -25
  18. three/src/cameras/PerspectiveCamera.d.ts +132 -56
  19. three/src/cameras/StereoCamera.d.ts +29 -2
  20. three/src/constants.d.ts +431 -26
  21. three/src/core/BufferGeometry.d.ts +5 -3
  22. three/src/core/Object3D.d.ts +17 -13
  23. three/src/core/Raycaster.d.ts +1 -0
  24. three/src/geometries/BoxGeometry.d.ts +39 -16
  25. three/src/geometries/CapsuleGeometry.d.ts +35 -12
  26. three/src/geometries/CircleGeometry.d.ts +38 -12
  27. three/src/geometries/ConeGeometry.d.ts +45 -10
  28. three/src/geometries/CylinderGeometry.d.ts +41 -19
  29. three/src/geometries/DodecahedronGeometry.d.ts +14 -5
  30. three/src/geometries/EdgesGeometry.d.ts +30 -8
  31. three/src/geometries/ExtrudeGeometry.d.ts +93 -12
  32. three/src/geometries/IcosahedronGeometry.d.ts +15 -5
  33. three/src/geometries/LatheGeometry.d.ts +41 -12
  34. three/src/geometries/OctahedronGeometry.d.ts +14 -5
  35. three/src/geometries/PlaneGeometry.d.ts +35 -12
  36. three/src/geometries/PolyhedronGeometry.d.ts +41 -12
  37. three/src/geometries/RingGeometry.d.ts +39 -16
  38. three/src/geometries/ShapeGeometry.d.ts +44 -4
  39. three/src/geometries/SphereGeometry.d.ts +43 -21
  40. three/src/geometries/TetrahedronGeometry.d.ts +14 -5
  41. three/src/geometries/TorusGeometry.d.ts +35 -13
  42. three/src/geometries/TorusKnotGeometry.d.ts +39 -16
  43. three/src/geometries/TubeGeometry.d.ts +63 -15
  44. three/src/geometries/WireframeGeometry.d.ts +30 -4
  45. three/src/math/ColorManagement.d.ts +2 -2
  46. three/src/objects/Bone.d.ts +30 -3
  47. three/src/objects/Group.d.ts +37 -1
  48. three/src/objects/InstancedMesh.d.ts +122 -3
  49. three/src/objects/LOD.d.ts +62 -18
  50. three/src/objects/Line.d.ts +67 -4
  51. three/src/objects/LineLoop.d.ts +26 -1
  52. three/src/objects/LineSegments.d.ts +21 -9
  53. three/src/objects/Mesh.d.ts +60 -4
  54. three/src/objects/Points.d.ts +39 -8
  55. three/src/objects/Skeleton.d.ts +89 -3
  56. three/src/objects/SkinnedMesh.d.ts +122 -3
  57. three/src/objects/Sprite.d.ts +51 -4
  58. three/src/renderers/WebGLRenderTarget.d.ts +9 -3
  59. three/src/scenes/Fog.d.ts +59 -7
  60. three/src/scenes/FogExp2.d.ts +41 -6
  61. three/src/scenes/Scene.d.ts +45 -22
  62. three/src/textures/CanvasTexture.d.ts +35 -13
  63. three/src/textures/CompressedArrayTexture.d.ts +39 -5
  64. three/src/textures/CompressedTexture.d.ts +49 -20
  65. three/src/textures/CubeTexture.d.ts +71 -18
  66. three/src/textures/Data3DTexture.d.ts +74 -10
  67. three/src/textures/DataArrayTexture.d.ts +83 -9
  68. three/src/textures/DataTexture.d.ts +81 -26
  69. three/src/textures/DepthTexture.d.ts +71 -15
  70. three/src/textures/FramebufferTexture.d.ts +57 -2
  71. three/src/textures/Source.d.ts +23 -13
  72. three/src/textures/Texture.d.ts +289 -73
  73. three/src/textures/VideoTexture.d.ts +69 -13
  74. three/src/textures/types.d.ts +9 -0
@@ -1,16 +1,26 @@
1
1
  import { PolyhedronGeometry } from './PolyhedronGeometry';
2
2
 
3
+ /**
4
+ * A class for generating an icosahedron geometry.
5
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/IcosahedronGeometry | Official Documentation}
6
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/IcosahedronGeometry.js | Source}
7
+ */
3
8
  export class IcosahedronGeometry extends PolyhedronGeometry {
4
9
  /**
5
- * @param [radius=1]
6
- * @param [detail=0]
10
+ * Create a new instance of {@link IcosahedronGeometry}
11
+ * @param radius Expects a `Float`. Default `1`
12
+ * @param detail Setting this to a value greater than 0 adds more vertices making it no longer an icosahedron.
13
+ * When detail is greater than 1, it's effectively a sphere. Expects a `Integer`. Default `0`
7
14
  */
8
15
  constructor(radius?: number, detail?: number);
9
16
 
10
17
  /**
11
- * @default 'IcosahedronGeometry'
18
+ * A Read-only _string_ to check if `this` object type.
19
+ * @remarks Sub-classes will update this value.
20
+ * @defaultValue `IcosahedronGeometry`
12
21
  */
13
- type: string;
22
+ override readonly type: string | 'IcosahedronGeometry';
14
23
 
15
- static fromJSON(data: any): IcosahedronGeometry;
24
+ /** @internal */
25
+ static fromJSON(data: {}): IcosahedronGeometry;
16
26
  }
@@ -1,26 +1,55 @@
1
1
  import { Vector2 } from './../math/Vector2';
2
2
  import { BufferGeometry } from './../core/BufferGeometry';
3
3
 
4
+ /**
5
+ * Creates meshes with axial symmetry like vases
6
+ * @remarks
7
+ * The lathe rotates around the Y axis.
8
+ * @example
9
+ * ```typescript
10
+ * const points = [];
11
+ * for (let i = 0; i & lt; 10; i++) {
12
+ * points.push(new THREE.Vector2(Math.sin(i * 0.2) * 10 + 5, (i - 5) * 2));
13
+ * }
14
+ * const geometry = new THREE.LatheGeometry(points);
15
+ * const material = new THREE.MeshBasicMaterial({
16
+ * color: 0xffff00
17
+ * });
18
+ * const lathe = new THREE.Mesh(geometry, material);
19
+ * scene.add(lathe);
20
+ * ```
21
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/LatheGeometry | Official Documentation}
22
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/LatheGeometry.js | Source}
23
+ */
4
24
  export class LatheGeometry extends BufferGeometry {
5
25
  /**
6
- * @param points
7
- * @param [segments=12]
8
- * @param [phiStart=0]
9
- * @param [phiLength=Math.PI * 2]
26
+ * This creates a {@link LatheGeometry} based on the parameters.
27
+ * @param points Array of Vector2s. The x-coordinate of each point must be greater than zero.
28
+ * Default `[new Vector2(0, -0.5), new Vector2(0.5, 0), new Vector2(0, 0.5)]` _which creates a simple diamond shape_.
29
+ * @param segments The number of circumference segments to generate. Expects a `Integer`. Default `12`.
30
+ * @param phiStart The starting angle in radians. Expects a `Float`. Default `0`.
31
+ * @param phiLength The radian (0 to 2*PI) range of the lathed section 2*PI is a closed lathe, less than 2PI is a portion. Expects a `Float`. Default `Math.PI * 2`.
10
32
  */
11
33
  constructor(points?: Vector2[], segments?: number, phiStart?: number, phiLength?: number);
12
34
 
13
35
  /**
14
- * @default 'LatheGeometry'
36
+ * A Read-only _string_ to check if `this` object type.
37
+ * @remarks Sub-classes will update this value.
38
+ * @defaultValue `LatheGeometry`
15
39
  */
16
- type: string;
40
+ override readonly type: string | 'LatheGeometry';
17
41
 
18
- parameters: {
19
- points: Vector2[];
20
- segments: number;
21
- phiStart: number;
22
- phiLength: number;
42
+ /**
43
+ * An object with a property for each of the constructor parameters.
44
+ * @remarks Any modification after instantiation does not change the geometry.
45
+ */
46
+ readonly parameters: {
47
+ readonly points: Vector2[];
48
+ readonly segments: number;
49
+ readonly phiStart: number;
50
+ readonly phiLength: number;
23
51
  };
24
52
 
25
- static fromJSON(data: any): LatheGeometry;
53
+ /** @internal */
54
+ static fromJSON(data: {}): LatheGeometry;
26
55
  }
@@ -1,16 +1,25 @@
1
1
  import { PolyhedronGeometry } from './PolyhedronGeometry';
2
2
 
3
+ /**
4
+ * A class for generating an octahedron geometry.
5
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/OctahedronGeometry | Official Documentation}
6
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/OctahedronGeometry.js | Source}
7
+ */
3
8
  export class OctahedronGeometry extends PolyhedronGeometry {
4
9
  /**
5
- * @param [radius=1]
6
- * @param [detail=0]
10
+ * Create a new instance of {@link OctahedronGeometry}
11
+ * @param radius Radius of the octahedron. Expects a `Float`. Default `1`
12
+ * @param detail Setting this to a value greater than zero add vertices making it no longer an octahedron. Expects a `Integer`. Default `0`
7
13
  */
8
14
  constructor(radius?: number, detail?: number);
9
15
 
10
16
  /**
11
- * @default 'OctahedronGeometry'
17
+ * A Read-only _string_ to check if `this` object type.
18
+ * @remarks Sub-classes will update this value.
19
+ * @defaultValue `OctahedronGeometry`
12
20
  */
13
- type: string;
21
+ override readonly type: string | 'OctahedronGeometry';
14
22
 
15
- static fromJSON(data: any): OctahedronGeometry;
23
+ /** @internal */
24
+ static fromJSON(data: {}): OctahedronGeometry;
16
25
  }
@@ -1,25 +1,48 @@
1
1
  import { BufferGeometry } from './../core/BufferGeometry';
2
2
 
3
+ /**
4
+ * A class for generating plane geometries.
5
+ * @example
6
+ * ```typescript
7
+ * const geometry = new THREE.PlaneGeometry(1, 1);
8
+ * const material = new THREE.MeshBasicMaterial({
9
+ * color: 0xffff00,
10
+ * side: THREE.DoubleSide
11
+ * });
12
+ * const plane = new THREE.Mesh(geometry, material);
13
+ * scene.add(plane);
14
+ * ```
15
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/PlaneGeometry | Official Documentation}
16
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/PlaneGeometry.js | Source}
17
+ */
3
18
  export class PlaneGeometry extends BufferGeometry {
4
19
  /**
5
- * @param [width=1] Width of the sides on the X axis.
6
- * @param [height=1] Height of the sides on the Y axis.
7
- * @param [widthSegments=1] Number of segmented faces along the width of the sides.
8
- * @param [heightSegments=1] Number of segmented faces along the height of the sides.
20
+ * Create a new instance of {@link PlaneGeometry}
21
+ * @param width Width along the X axis. Expects a `Float`. Default `1`
22
+ * @param height Height along the Y axis. Expects a `Float`. Default `1`
23
+ * @param widthSegments Number of segmented faces along the width of the sides. Expects a `Integer`. Default `1`
24
+ * @param heightSegments Number of segmented faces along the height of the sides. Expects a `Integer`. Default `1`
9
25
  */
10
26
  constructor(width?: number, height?: number, widthSegments?: number, heightSegments?: number);
11
27
 
12
28
  /**
13
- * @default 'PlaneGeometry'
29
+ * A Read-only _string_ to check if `this` object type.
30
+ * @remarks Sub-classes will update this value.
31
+ * @defaultValue `PlaneGeometry`
14
32
  */
15
- type: string;
33
+ override readonly type: string | 'PlaneGeometry';
16
34
 
17
- parameters: {
18
- width: number;
19
- height: number;
20
- widthSegments: number;
21
- heightSegments: number;
35
+ /**
36
+ * An object with a property for each of the constructor parameters.
37
+ * @remarks Any modification after instantiation does not change the geometry.
38
+ */
39
+ readonly parameters: {
40
+ readonly width: number;
41
+ readonly height: number;
42
+ readonly widthSegments: number;
43
+ readonly heightSegments: number;
22
44
  };
23
45
 
24
- static fromJSON(data: any): PlaneGeometry;
46
+ /** @internal */
47
+ static fromJSON(data: {}): PlaneGeometry;
25
48
  }
@@ -1,25 +1,54 @@
1
1
  import { BufferGeometry } from './../core/BufferGeometry';
2
2
 
3
+ /**
4
+ * A polyhedron is a solid in three dimensions with flat faces
5
+ * @remarks
6
+ * This class will take an array of vertices, project them onto a sphere, and then divide them up to the desired level of detail
7
+ * This class is used by {@link THREE.DodecahedronGeometry | DodecahedronGeometry}, {@link THREE.IcosahedronGeometry | IcosahedronGeometry},
8
+ * {@link THREE.OctahedronGeometry | OctahedronGeometry}, and {@link THREE.TetrahedronGeometry | TetrahedronGeometry} to generate their respective geometries.
9
+ * @example
10
+ * ```typescript
11
+ * const verticesOfCube = [-1, -1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, ];
12
+ * const indicesOfFaces = [
13
+ * 2, 1, 0, 0, 3, 2,
14
+ * 0, 4, 7, 7, 3, 0,
15
+ * 0, 1, 5, 5, 4, 0,
16
+ * 1, 2, 6, 6, 5, 1,
17
+ * 2, 3, 7, 7, 6, 2,
18
+ * 4, 5, 6, 6, 7, 4];
19
+ * const geometry = new THREE.PolyhedronGeometry(verticesOfCube, indicesOfFaces, 6, 2);
20
+ * ```
21
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/PolyhedronGeometry | Official Documentation}
22
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/PolyhedronGeometry.js | Source}
23
+ */
3
24
  export class PolyhedronGeometry extends BufferGeometry {
4
25
  /**
5
- * @param vertices
6
- * @param indices
7
- * @param [radius=1]
8
- * @param [detail=0]
26
+ * Create a new instance of {@link PolyhedronGeometry}
27
+ * @param vertices Array of points of the form [1,1,1, -1,-1,-1, ... ]. Default `[]`.
28
+ * @param indices Array of indices that make up the faces of the form [0,1,2, 2,3,0, ... ]. Default `[]`.
29
+ * @param radius [page:The radius of the final shape Expects a `Float`. Default `1`
30
+ * @param detail [page:How many levels to subdivide the geometry. The more detail, the smoother the shape. Expects a `Integer`. Default `0`
9
31
  */
10
32
  constructor(vertices?: number[], indices?: number[], radius?: number, detail?: number);
11
33
 
12
34
  /**
13
- * @default 'PolyhedronGeometry'
35
+ * A Read-only _string_ to check if `this` object type.
36
+ * @remarks Sub-classes will update this value.
37
+ * @defaultValue `PolyhedronGeometry`
14
38
  */
15
- type: string;
39
+ override readonly type: string | 'PolyhedronGeometry';
16
40
 
17
- parameters: {
18
- vertices: number[];
19
- indices: number[];
20
- radius: number;
21
- detail: number;
41
+ /**
42
+ * An object with a property for each of the constructor parameters.
43
+ * @remarks Any modification after instantiation does not change the geometry.
44
+ */
45
+ readonly parameters: {
46
+ readonly vertices: number[];
47
+ readonly indices: number[];
48
+ readonly radius: number;
49
+ readonly detail: number;
22
50
  };
23
51
 
24
- static fromJSON(data: any): PolyhedronGeometry;
52
+ /** @internal */
53
+ static fromJSON(data: {}): PolyhedronGeometry;
25
54
  }
@@ -1,13 +1,29 @@
1
1
  import { BufferGeometry } from './../core/BufferGeometry';
2
2
 
3
+ /**
4
+ * A class for generating a two-dimensional ring geometry.
5
+ * @example
6
+ * ```typescript
7
+ * const geometry = new THREE.RingGeometry(1, 5, 32);
8
+ * const material = new THREE.MeshBasicMaterial({
9
+ * color: 0xffff00,
10
+ * side: THREE.DoubleSide
11
+ * });
12
+ * const mesh = new THREE.Mesh(geometry, material);
13
+ * scene.add(mesh);
14
+ * ```
15
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/RingGeometry | Official Documentation}
16
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/RingGeometry.js | Source}
17
+ */
3
18
  export class RingGeometry extends BufferGeometry {
4
19
  /**
5
- * @param innerRadius - Default is 0.5.
6
- * @param outerRadius - Default is 1.
7
- * @param thetaSegments - Number of segments. A higher number means the ring will be more round. Minimum is 3. Default is 32.
8
- * @param phiSegments - Minimum is 1. Default is 1.
9
- * @param thetaStart - Starting angle. Default is 0.
10
- * @param thetaLength - Central angle. Default is Math.PI * 2.
20
+ * Create a new instance of {@link RingGeometry}
21
+ * @param innerRadius Expects a `Float`. Default `0.5`.
22
+ * @param outerRadius Expects a `Float`. Default `1`.
23
+ * @param thetaSegments Number of segments. A higher number means the ring will be more round. Minimum is 3. Expects a `Integer`. Default `32`.
24
+ * @param phiSegments Minimum is 1. Expects a `Integer`. Default `1`.
25
+ * @param thetaStart Starting angle. Expects a `Float`. Default `0`.
26
+ * @param thetaLength Central angle. Expects a `Float`. Default `Math.PI * 2`.
11
27
  */
12
28
  constructor(
13
29
  innerRadius?: number,
@@ -19,18 +35,25 @@ export class RingGeometry extends BufferGeometry {
19
35
  );
20
36
 
21
37
  /**
22
- * @default 'RingGeometry'
38
+ * A Read-only _string_ to check if `this` object type.
39
+ * @remarks Sub-classes will update this value.
40
+ * @defaultValue `RingGeometry`
23
41
  */
24
- type: string;
42
+ override readonly type: string | 'RingGeometry';
25
43
 
26
- parameters: {
27
- innerRadius: number;
28
- outerRadius: number;
29
- thetaSegments: number;
30
- phiSegments: number;
31
- thetaStart: number;
32
- thetaLength: number;
44
+ /**
45
+ * An object with a property for each of the constructor parameters.
46
+ * @remarks Any modification after instantiation does not change the geometry.
47
+ */
48
+ readonly parameters: {
49
+ readonly innerRadius: number;
50
+ readonly outerRadius: number;
51
+ readonly thetaSegments: number;
52
+ readonly phiSegments: number;
53
+ readonly thetaStart: number;
54
+ readonly thetaLength: number;
33
55
  };
34
56
 
35
- static fromJSON(data: any): RingGeometry;
57
+ /** @internal */
58
+ static fromJSON(data: {}): RingGeometry;
36
59
  }
@@ -1,13 +1,53 @@
1
1
  import { Shape } from './../extras/core/Shape';
2
2
  import { BufferGeometry } from './../core/BufferGeometry';
3
3
 
4
+ /**
5
+ * Creates an one-sided polygonal geometry from one or more path shapes.
6
+ * @example
7
+ * ```typescript
8
+ * const x = 0, y = 0;
9
+ * const heartShape = new THREE.Shape();
10
+ * heartShape.moveTo(x + 5, y + 5);
11
+ * heartShape.bezierCurveTo(x + 5, y + 5, x + 4, y, x, y);
12
+ * heartShape.bezierCurveTo(x - 6, y, x - 6, y + 7, x - 6, y + 7);
13
+ * heartShape.bezierCurveTo(x - 6, y + 11, x - 3, y + 15.4, x + 5, y + 19);
14
+ * heartShape.bezierCurveTo(x + 12, y + 15.4, x + 16, y + 11, x + 16, y + 7);
15
+ * heartShape.bezierCurveTo(x + 16, y + 7, x + 16, y, x + 10, y);
16
+ * heartShape.bezierCurveTo(x + 7, y, x + 5, y + 5, x + 5, y + 5);
17
+ * const geometry = new THREE.ShapeGeometry(heartShape);
18
+ * const material = new THREE.MeshBasicMaterial({
19
+ * color: 0x00ff00
20
+ * });
21
+ * const mesh = new THREE.Mesh(geometry, material);
22
+ * scene.add(mesh);
23
+ * ```
24
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/ShapeGeometry | Official Documentation}
25
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/ShapeGeometry.js | Source}
26
+ */
4
27
  export class ShapeGeometry extends BufferGeometry {
5
28
  /**
6
- * @default 'ShapShapeGeometryeBufferGeometry'
29
+ * Create a new instance of {@link ShapeGeometry}
30
+ * @param shapes Array of shapes or a single {@link THREE.Shape | Shape}. Default `new Shape([new Vector2(0, 0.5), new Vector2(-0.5, -0.5), new Vector2(0.5, -0.5)])`, _a single triangle shape_.
31
+ * @param curveSegments Number of segments per shape. Expects a `Integer`. Default `12`
7
32
  */
8
- type: string;
9
-
10
33
  constructor(shapes?: Shape | Shape[], curveSegments?: number);
11
34
 
12
- static fromJSON(data: any): ShapeGeometry;
35
+ /**
36
+ * A Read-only _string_ to check if `this` object type.
37
+ * @remarks Sub-classes will update this value.
38
+ * @defaultValue `ShapeGeometry`
39
+ */
40
+ override readonly type: string | 'ShapeGeometry';
41
+
42
+ /**
43
+ * An object with a property for each of the constructor parameters.
44
+ * @remarks Any modification after instantiation does not change the geometry.
45
+ */
46
+ readonly parameters: {
47
+ readonly shapes: Shape | Shape[];
48
+ readonly curveSegments: number;
49
+ };
50
+
51
+ /** @internal */
52
+ static fromJSON(data: {}): ShapeGeometry;
13
53
  }
@@ -1,20 +1,35 @@
1
1
  import { BufferGeometry } from './../core/BufferGeometry';
2
2
 
3
+ /**
4
+ * A class for generating sphere geometries.
5
+ * @example
6
+ * ```typescript
7
+ * const geometry = new THREE.SphereGeometry(15, 32, 16);
8
+ * const material = new THREE.MeshBasicMaterial({
9
+ * color: 0xffff00
10
+ * });
11
+ * const sphere = new THREE.Mesh(geometry, material);
12
+ * scene.add(sphere);
13
+ * ```
14
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/SphereGeometry | Official Documentation}
15
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/SphereGeometry.js | Source}
16
+ */
3
17
  export class SphereGeometry extends BufferGeometry {
4
18
  /**
19
+ * Create a new instance of {@link SphereGeometry}
20
+ * @remarks
5
21
  * The geometry is created by sweeping and calculating vertexes
6
- * around the Y axis (horizontal sweep) and the Z axis (vertical sweep).
22
+ * around the **Y** axis (horizontal sweep) and the **Z** axis (vertical sweep)
7
23
  * Thus, incomplete spheres (akin to `'sphere slices'`) can be created
8
- * through the use of different values of phiStart, phiLength, thetaStart and thetaLength,
24
+ * through the use of different values of {@link phiStart}, {@link phiLength}, {@link thetaStart} and {@link thetaLength},
9
25
  * in order to define the points in which we start (or end) calculating those vertices.
10
- *
11
- * @param [radius=50] - sphere radius. Default is 50.
12
- * @param [widthSegments=8] - number of horizontal segments. Minimum value is 3, and the default is 32.
13
- * @param [heightSegments=6] - number of vertical segments. Minimum value is 2, and the default is 16.
14
- * @param [phiStart=0] - specify horizontal starting angle. Default is 0.
15
- * @param [phiLength=Math.PI * 2] - specify horizontal sweep angle size. Default is Math.PI * 2.
16
- * @param [thetaStart=0] - specify vertical starting angle. Default is 0.
17
- * @param [thetaLength=Math.PI * 2] - specify vertical sweep angle size. Default is Math.PI.
26
+ * @param radius Sphere radius. Expects a `Float`. Default `1`
27
+ * @param widthSegments Number of horizontal segments. Minimum value is 3, and the Expects a `Integer`. Default `32`
28
+ * @param heightSegments Number of vertical segments. Minimum value is 2, and the Expects a `Integer`. Default `16`
29
+ * @param phiStart Specify horizontal starting angle. Expects a `Float`. Default `0`
30
+ * @param phiLength Specify horizontal sweep angle size. Expects a `Float`. Default `Math.PI * 2`
31
+ * @param thetaStart Specify vertical starting angle. Expects a `Float`. Default `0`
32
+ * @param thetaLength Specify vertical sweep angle size. Expects a `Float`. Default `Math.PI`
18
33
  */
19
34
  constructor(
20
35
  radius?: number,
@@ -27,19 +42,26 @@ export class SphereGeometry extends BufferGeometry {
27
42
  );
28
43
 
29
44
  /**
30
- * @default 'SphereGeometry'
45
+ * A Read-only _string_ to check if `this` object type.
46
+ * @remarks Sub-classes will update this value.
47
+ * @defaultValue `SphereGeometry`
31
48
  */
32
- type: string;
49
+ override readonly type: string | 'SphereGeometry';
33
50
 
34
- parameters: {
35
- radius: number;
36
- widthSegments: number;
37
- heightSegments: number;
38
- phiStart: number;
39
- phiLength: number;
40
- thetaStart: number;
41
- thetaLength: number;
51
+ /**
52
+ * An object with a property for each of the constructor parameters.
53
+ * @remarks Any modification after instantiation does not change the geometry.
54
+ */
55
+ readonly parameters: {
56
+ readonly radius: number;
57
+ readonly widthSegments: number;
58
+ readonly heightSegments: number;
59
+ readonly phiStart: number;
60
+ readonly phiLength: number;
61
+ readonly thetaStart: number;
62
+ readonly thetaLength: number;
42
63
  };
43
64
 
44
- static fromJSON(data: any): SphereGeometry;
65
+ /** @internal */
66
+ static fromJSON(data: {}): SphereGeometry;
45
67
  }
@@ -1,16 +1,25 @@
1
1
  import { PolyhedronGeometry } from './PolyhedronGeometry';
2
2
 
3
+ /**
4
+ * A class for generating a tetrahedron geometries.
5
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/TetrahedronGeometry | Official Documentation}
6
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/TetrahedronGeometry.js | Source}
7
+ */
3
8
  export class TetrahedronGeometry extends PolyhedronGeometry {
4
9
  /**
5
- * @param [radius=1]
6
- * @param [detail=0]
10
+ * Create a new instance of {@link TetrahedronGeometry}
11
+ * @param radius Radius of the tetrahedron. Expects a `Float`. Default `1`
12
+ * @param detail Setting this to a value greater than 0 adds vertices making it no longer a tetrahedron. Expects a `Integer`. Default `0`
7
13
  */
8
14
  constructor(radius?: number, detail?: number);
9
15
 
10
16
  /**
11
- * @default 'TetrahedronGeometry'
17
+ * A Read-only _string_ to check if `this` object type.
18
+ * @remarks Sub-classes will update this value.
19
+ * @defaultValue `TetrahedronGeometry`
12
20
  */
13
- type: string;
21
+ override readonly type: string | 'TetrahedronGeometry';
14
22
 
15
- static fromJSON(data: any): TetrahedronGeometry;
23
+ /** @internal */
24
+ static fromJSON(data: {}): TetrahedronGeometry;
16
25
  }
@@ -1,27 +1,49 @@
1
1
  import { BufferGeometry } from './../core/BufferGeometry';
2
2
 
3
+ /**
4
+ * A class for generating torus geometries.
5
+ * @example
6
+ * ```typescript
7
+ * const geometry = new THREE.TorusGeometry(10, 3, 16, 100);
8
+ * const material = new THREE.MeshBasicMaterial({
9
+ * color: 0xffff00
10
+ * });
11
+ * const torus = new THREE.Mesh(geometry, material);
12
+ * scene.add(torus);
13
+ * ```
14
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/TorusGeometry | Official Documentation}
15
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/TorusGeometry.js | Source}
16
+ */
3
17
  export class TorusGeometry extends BufferGeometry {
4
18
  /**
5
- * @param radius - Radius of the torus, from the center of the torus to the center of the tube. Default is 1.
6
- * @param tube - Radius of the tube. Default is 0.4.
7
- * @param radialSegments - Default is 12
8
- * @param tubularSegments - Default is 48.
9
- * @param arc - Central angle. Default is Math.PI * 2.
19
+ * Create a new instance of {@link TorusGeometry}
20
+ * @param radius Radius of the torus, from the center of the torus to the center of the tube. Expects a `Float`. Default `1`.
21
+ * @param tube Radius of the tube. Expects a `Float`. Default `0.4`.
22
+ * @param radialSegments Expects a `Integer`.Default is `12`.
23
+ * @param tubularSegments Expects a `Integer`. Default `48`.
24
+ * @param arc Central angle. Expects a `Float`. Default `Math.PI * 2`
10
25
  */
11
26
  constructor(radius?: number, tube?: number, radialSegments?: number, tubularSegments?: number, arc?: number);
12
27
 
13
28
  /**
14
- * @default 'TorusGeometry'
29
+ * A Read-only _string_ to check if `this` object type.
30
+ * @remarks Sub-classes will update this value.
31
+ * @defaultValue `TorusGeometry`
15
32
  */
16
- type: string;
33
+ override readonly type: string | 'TorusGeometry';
17
34
 
18
- parameters: {
19
- radius: number;
20
- tube: number;
21
- radialSegments: number;
22
- tubularSegments: number;
23
- arc: number;
35
+ /**
36
+ * An object with a property for each of the constructor parameters.
37
+ * @remarks Any modification after instantiation does not change the geometry.
38
+ */
39
+ readonly parameters: {
40
+ readonly radius: number;
41
+ readonly tube: number;
42
+ readonly radialSegments: number;
43
+ readonly tubularSegments: number;
44
+ readonly arc: number;
24
45
  };
25
46
 
47
+ /** @internal */
26
48
  static fromJSON(data: any): TorusGeometry;
27
49
  }
@@ -1,13 +1,29 @@
1
1
  import { BufferGeometry } from './../core/BufferGeometry';
2
2
 
3
+ /**
4
+ * Creates a torus knot, the particular shape of which is defined by a pair of coprime integers, p and q
5
+ * If p and q are not coprime, the result will be a torus link.
6
+ * @example
7
+ * ```typescript
8
+ * const geometry = new THREE.TorusKnotGeometry(10, 3, 100, 16);
9
+ * const material = new THREE.MeshBasicMaterial({
10
+ * color: 0xffff00
11
+ * });
12
+ * const torusKnot = new THREE.Mesh(geometry, material);
13
+ * scene.add(torusKnot);
14
+ * ```
15
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/TorusKnotGeometry | Official Documentation}
16
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/TorusKnotGeometry.js | Source}
17
+ */
3
18
  export class TorusKnotGeometry extends BufferGeometry {
4
19
  /**
5
- * @param [radius=1]
6
- * @param [tube=0.4]
7
- * @param [radialSegments=64]
8
- * @param [tubularSegments=8]
9
- * @param [p=2]
10
- * @param [q=3]
20
+ * Create a new instance of {@link TorusKnotGeometry}
21
+ * @param radius Radius of the torus.. Default `1`.
22
+ * @param tube Expects a `Float`. Default `0.4`.
23
+ * @param tubularSegments Expects a `Integer`. Default `64`.
24
+ * @param radialSegments Expects a `Integer`. Default `8`.
25
+ * @param p This value determines, how many times the geometry winds around its axis of rotational symmetry. Expects a `Integer`. Default `2`.
26
+ * @param q This value determines, how many times the geometry winds around a circle in the interior of the torus. Expects a `Integer`. Default `3`.
11
27
  */
12
28
  constructor(
13
29
  radius?: number,
@@ -19,18 +35,25 @@ export class TorusKnotGeometry extends BufferGeometry {
19
35
  );
20
36
 
21
37
  /**
22
- * @default 'TorusKnotGeometry'
38
+ * A Read-only _string_ to check if `this` object type.
39
+ * @remarks Sub-classes will update this value.
40
+ * @defaultValue `TorusKnotGeometry`
23
41
  */
24
- type: string;
42
+ override readonly type: string | 'TorusKnotGeometry';
25
43
 
26
- parameters: {
27
- radius: number;
28
- tube: number;
29
- tubularSegments: number;
30
- radialSegments: number;
31
- p: number;
32
- q: number;
44
+ /**
45
+ * An object with a property for each of the constructor parameters.
46
+ * @remarks Any modification after instantiation does not change the geometry.
47
+ */
48
+ readonly parameters: {
49
+ readonly radius: number;
50
+ readonly tube: number;
51
+ readonly tubularSegments: number;
52
+ readonly radialSegments: number;
53
+ readonly p: number;
54
+ readonly q: number;
33
55
  };
34
56
 
35
- static fromJSON(data: any): TorusKnotGeometry;
57
+ /** @internal */
58
+ static fromJSON(data: {}): TorusKnotGeometry;
36
59
  }