@types/three 0.149.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.
- three/README.md +2 -2
- three/build/three.d.cts +2 -0
- three/build/three.d.ts +2 -0
- three/build/three.module.d.ts +2 -0
- three/examples/jsm/controls/OrbitControls.d.ts +5 -0
- three/examples/jsm/controls/TransformControls.d.ts +1 -5
- three/examples/jsm/geometries/TextGeometry.d.ts +92 -15
- three/examples/jsm/helpers/OctreeHelper.d.ts +1 -1
- three/examples/jsm/libs/fflate.module.d.ts +1 -0
- three/examples/jsm/libs/lil-gui.module.min.d.ts +1 -0
- three/examples/jsm/libs/stats.module.d.ts +2 -23
- three/examples/jsm/loaders/EXRLoader.d.ts +3 -2
- three/examples/jsm/misc/GPUComputationRenderer.d.ts +4 -2
- three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +3 -4
- three/examples/jsm/objects/MarchingCubes.d.ts +1 -0
- three/examples/jsm/shaders/VelocityShader.d.ts +2 -2
- three/index.d.ts +1 -1
- three/package.json +19 -4
- three/src/Three.d.ts +0 -1
- three/src/audio/Audio.d.ts +184 -20
- three/src/audio/AudioAnalyser.d.ts +42 -4
- three/src/audio/AudioContext.d.ts +12 -1
- three/src/audio/AudioListener.d.ts +76 -8
- three/src/audio/PositionalAudio.d.ts +86 -5
- three/src/cameras/ArrayCamera.d.ts +23 -2
- three/src/cameras/Camera.d.ts +42 -13
- three/src/cameras/CubeCamera.d.ts +49 -1
- three/src/cameras/OrthographicCamera.d.ts +77 -25
- three/src/cameras/PerspectiveCamera.d.ts +132 -56
- three/src/cameras/StereoCamera.d.ts +29 -2
- three/src/constants.d.ts +790 -245
- three/src/core/BufferAttribute.d.ts +456 -85
- three/src/core/BufferGeometry.d.ts +237 -67
- three/src/core/Clock.d.ts +28 -20
- three/src/core/EventDispatcher.d.ts +20 -4
- three/src/core/GLBufferAttribute.d.ts +102 -8
- three/src/core/InstancedBufferAttribute.d.ts +13 -24
- three/src/core/InstancedBufferGeometry.d.ts +22 -4
- three/src/core/InstancedInterleavedBuffer.d.ts +10 -2
- three/src/core/InterleavedBuffer.d.ts +98 -14
- three/src/core/InterleavedBufferAttribute.d.ts +146 -7
- three/src/core/Layers.d.ts +61 -6
- three/src/core/Object3D.d.ts +244 -123
- three/src/core/Raycaster.d.ts +104 -27
- three/src/core/Uniform.d.ts +28 -11
- three/src/core/UniformsGroup.d.ts +10 -4
- three/src/extras/Earcut.d.ts +3 -4
- three/src/geometries/BoxGeometry.d.ts +39 -16
- three/src/geometries/CapsuleGeometry.d.ts +35 -12
- three/src/geometries/CircleGeometry.d.ts +38 -12
- three/src/geometries/ConeGeometry.d.ts +45 -10
- three/src/geometries/CylinderGeometry.d.ts +41 -19
- three/src/geometries/DodecahedronGeometry.d.ts +14 -5
- three/src/geometries/EdgesGeometry.d.ts +30 -8
- three/src/geometries/ExtrudeGeometry.d.ts +93 -12
- three/src/geometries/IcosahedronGeometry.d.ts +15 -5
- three/src/geometries/LatheGeometry.d.ts +41 -12
- three/src/geometries/OctahedronGeometry.d.ts +14 -5
- three/src/geometries/PlaneGeometry.d.ts +35 -12
- three/src/geometries/PolyhedronGeometry.d.ts +41 -12
- three/src/geometries/RingGeometry.d.ts +39 -16
- three/src/geometries/ShapeGeometry.d.ts +44 -4
- three/src/geometries/SphereGeometry.d.ts +43 -21
- three/src/geometries/TetrahedronGeometry.d.ts +14 -5
- three/src/geometries/TorusGeometry.d.ts +35 -13
- three/src/geometries/TorusKnotGeometry.d.ts +39 -16
- three/src/geometries/TubeGeometry.d.ts +63 -15
- three/src/geometries/WireframeGeometry.d.ts +30 -4
- three/src/materials/MeshPhysicalMaterial.d.ts +13 -1
- three/src/math/Color.d.ts +157 -3
- three/src/math/ColorManagement.d.ts +13 -7
- three/src/objects/Bone.d.ts +30 -3
- three/src/objects/Group.d.ts +37 -1
- three/src/objects/InstancedMesh.d.ts +122 -3
- three/src/objects/LOD.d.ts +62 -18
- three/src/objects/Line.d.ts +67 -4
- three/src/objects/LineLoop.d.ts +26 -1
- three/src/objects/LineSegments.d.ts +21 -9
- three/src/objects/Mesh.d.ts +60 -4
- three/src/objects/Points.d.ts +39 -8
- three/src/objects/Skeleton.d.ts +89 -3
- three/src/objects/SkinnedMesh.d.ts +122 -3
- three/src/objects/Sprite.d.ts +51 -4
- three/src/renderers/WebGLRenderTarget.d.ts +9 -3
- three/src/renderers/WebGLRenderer.d.ts +2 -2
- three/src/scenes/Fog.d.ts +59 -7
- three/src/scenes/FogExp2.d.ts +41 -6
- three/src/scenes/Scene.d.ts +45 -22
- three/src/textures/CanvasTexture.d.ts +35 -13
- three/src/textures/CompressedArrayTexture.d.ts +39 -5
- three/src/textures/CompressedTexture.d.ts +49 -20
- three/src/textures/CubeTexture.d.ts +71 -18
- three/src/textures/Data3DTexture.d.ts +74 -10
- three/src/textures/DataArrayTexture.d.ts +83 -9
- three/src/textures/DataTexture.d.ts +81 -26
- three/src/textures/DepthTexture.d.ts +71 -15
- three/src/textures/FramebufferTexture.d.ts +57 -2
- three/src/textures/Source.d.ts +23 -13
- three/src/textures/Texture.d.ts +289 -73
- three/src/textures/VideoTexture.d.ts +69 -13
- three/src/textures/types.d.ts +9 -0
- three/src/utils.d.ts +5 -2
- three/examples/jsm/libs/fflate.module.min.d.ts +0 -1185
|
@@ -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
|
|
12
|
-
* @param
|
|
13
|
-
* @param
|
|
14
|
-
* @param
|
|
15
|
-
* @param
|
|
16
|
-
* @param
|
|
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
|
-
*
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
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
|
-
* @
|
|
6
|
-
* @param
|
|
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
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
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
|
-
*
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
* @
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
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
|
-
*
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
57
|
+
/** @internal */
|
|
58
|
+
static fromJSON(data: {}): TorusKnotGeometry;
|
|
36
59
|
}
|
|
@@ -2,37 +2,85 @@ import { Curve } from './../extras/core/Curve';
|
|
|
2
2
|
import { Vector3 } from './../math/Vector3';
|
|
3
3
|
import { BufferGeometry } from './../core/BufferGeometry';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Creates a tube that extrudes along a 3d curve.
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* class CustomSinCurve extends THREE.Curve {
|
|
10
|
+
* constructor(scale = 1) {
|
|
11
|
+
* super();
|
|
12
|
+
* this.scale = scale;
|
|
13
|
+
* }
|
|
14
|
+
* getPoint(t, optionalTarget = new THREE.Vector3()) {
|
|
15
|
+
* const tx = t * 3 - 1.5;
|
|
16
|
+
* const ty = Math.sin(2 * Math.PI * t);
|
|
17
|
+
* const tz = 0;
|
|
18
|
+
* return optionalTarget.set(tx, ty, tz).multiplyScalar(this.scale);
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
* const path = new CustomSinCurve(10);
|
|
22
|
+
* const geometry = new THREE.TubeGeometry(path, 20, 2, 8, false);
|
|
23
|
+
* const material = new THREE.MeshBasicMaterial({
|
|
24
|
+
* color: 0x00ff00
|
|
25
|
+
* });
|
|
26
|
+
* const mesh = new THREE.Mesh(geometry, material);
|
|
27
|
+
* scene.add(mesh);
|
|
28
|
+
* ```
|
|
29
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/geometries/TubeGeometry | Official Documentation}
|
|
30
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/TubeGeometry.js | Source}
|
|
31
|
+
*/
|
|
5
32
|
export class TubeGeometry extends BufferGeometry {
|
|
6
33
|
/**
|
|
7
|
-
* @
|
|
8
|
-
* @param
|
|
9
|
-
* @
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
34
|
+
* Create a new instance of {@link TubeGeometry}
|
|
35
|
+
* @param path A 3D path that inherits from the {@link THREE.Curve | Curve} base class.
|
|
36
|
+
* Default {@link THREE.QuadraticBezierCurve3 | new THREE.QuadraticBezierCurve3(new Vector3(-1, -1, 0 ), new Vector3(-1, 1, 0), new Vector3(1, 1, 0))}.
|
|
37
|
+
* @param tubularSegments The number of segments that make up the tube. Expects a `Integer`. Default `64`.
|
|
38
|
+
* @param radius The radius of the tube. Expects a `Float`. Default `1`.
|
|
39
|
+
* @param radialSegments The number of segments that make up the cross-section. Expects a `Integer`. Default `8`.
|
|
40
|
+
* @param closed Is the tube open or closed. Default `false`.
|
|
12
41
|
*/
|
|
13
42
|
constructor(
|
|
14
43
|
path?: Curve<Vector3>,
|
|
15
44
|
tubularSegments?: number,
|
|
16
45
|
radius?: number,
|
|
17
|
-
|
|
46
|
+
radialSegments?: number,
|
|
18
47
|
closed?: boolean,
|
|
19
48
|
);
|
|
20
49
|
|
|
21
50
|
/**
|
|
22
|
-
*
|
|
51
|
+
* A Read-only _string_ to check if `this` object type.
|
|
52
|
+
* @remarks Sub-classes will update this value.
|
|
53
|
+
* @defaultValue `TubeGeometry`
|
|
23
54
|
*/
|
|
24
|
-
type: string;
|
|
55
|
+
override readonly type: string | 'TubeGeometry';
|
|
25
56
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
57
|
+
/**
|
|
58
|
+
* An object with a property for each of the constructor parameters.
|
|
59
|
+
* @remarks Any modification after instantiation does not change the geometry.
|
|
60
|
+
*/
|
|
61
|
+
readonly parameters: {
|
|
62
|
+
readonly path: Curve<Vector3>;
|
|
63
|
+
readonly tubularSegments: number;
|
|
64
|
+
readonly radius: number;
|
|
65
|
+
readonly radialSegments: number;
|
|
66
|
+
readonly closed: boolean;
|
|
32
67
|
};
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* An array of {@link THREE.Vector3 | Vector3} tangents
|
|
71
|
+
*/
|
|
33
72
|
tangents: Vector3[];
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* An array of {@link THREE.Vector3 | Vector3} normals
|
|
76
|
+
*/
|
|
34
77
|
normals: Vector3[];
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* An array of {@link THREE.Vector3 | Vector3} binormals
|
|
81
|
+
*/
|
|
35
82
|
binormals: Vector3[];
|
|
36
83
|
|
|
37
|
-
|
|
84
|
+
/** @internal */
|
|
85
|
+
static fromJSON(data: {}): TubeGeometry;
|
|
38
86
|
}
|
|
@@ -1,14 +1,40 @@
|
|
|
1
1
|
import { BufferGeometry } from './../core/BufferGeometry';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* This can be used as a helper object to view a {@link BufferGeometry | geometry} as a wireframe.
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* const geometry = new THREE.SphereGeometry(100, 100, 100);
|
|
8
|
+
* const wireframe = new THREE.WireframeGeometry(geometry);
|
|
9
|
+
* const line = new THREE.LineSegments(wireframe);
|
|
10
|
+
* line.material.depthTest = false;
|
|
11
|
+
* line.material.opacity = 0.25;
|
|
12
|
+
* line.material.transparent = true;
|
|
13
|
+
* scene.add(line);
|
|
14
|
+
* ```
|
|
15
|
+
* @see Example: {@link https://threejs.org/examples/#webgl_helpers | helpers}
|
|
16
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/geometries/WireframeGeometry | Official Documentation}
|
|
17
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/WireframeGeometry.js | Source}
|
|
18
|
+
*/
|
|
3
19
|
export class WireframeGeometry<TBufferGeometry extends BufferGeometry = BufferGeometry> extends BufferGeometry {
|
|
20
|
+
/**
|
|
21
|
+
* Create a new instance of {@link WireframeGeometry}
|
|
22
|
+
* @param geometry Any geometry object. Default `null`.
|
|
23
|
+
*/
|
|
4
24
|
constructor(geometry?: TBufferGeometry);
|
|
5
25
|
|
|
6
26
|
/**
|
|
7
|
-
*
|
|
27
|
+
* A Read-only _string_ to check if `this` object type.
|
|
28
|
+
* @remarks Sub-classes will update this value.
|
|
29
|
+
* @defaultValue `WireframeGeometry`
|
|
8
30
|
*/
|
|
9
|
-
type: string;
|
|
31
|
+
override readonly type: string | 'WireframeGeometry';
|
|
10
32
|
|
|
11
|
-
|
|
12
|
-
|
|
33
|
+
/**
|
|
34
|
+
* An object with a property for each of the constructor parameters.
|
|
35
|
+
* @remarks Any modification after instantiation does not change the geometry.
|
|
36
|
+
*/
|
|
37
|
+
readonly parameters: {
|
|
38
|
+
readonly geometry: TBufferGeometry;
|
|
13
39
|
};
|
|
14
40
|
}
|
|
@@ -16,10 +16,16 @@ export interface MeshPhysicalMaterialParameters extends MeshStandardMaterialPara
|
|
|
16
16
|
|
|
17
17
|
sheen?: number | undefined;
|
|
18
18
|
sheenColor?: Color | undefined;
|
|
19
|
+
sheenColorMap?: Texture | null | undefined;
|
|
19
20
|
sheenRoughness?: number | undefined;
|
|
21
|
+
sheenRoughnessMap?: Texture | null | undefined;
|
|
20
22
|
|
|
21
23
|
transmission?: number | undefined;
|
|
22
24
|
transmissionMap?: Texture | null | undefined;
|
|
25
|
+
|
|
26
|
+
thickness?: number | undefined;
|
|
27
|
+
thicknessMap?: Texture | null | undefined;
|
|
28
|
+
|
|
23
29
|
attenuationDistance?: number | undefined;
|
|
24
30
|
attenuationColor?: Color | undefined;
|
|
25
31
|
|
|
@@ -27,6 +33,12 @@ export interface MeshPhysicalMaterialParameters extends MeshStandardMaterialPara
|
|
|
27
33
|
specularColor?: Color | undefined;
|
|
28
34
|
specularIntensityMap?: Texture | null | undefined;
|
|
29
35
|
specularColorMap?: Texture | null | undefined;
|
|
36
|
+
|
|
37
|
+
iridescenceMap?: Texture | null | undefined;
|
|
38
|
+
iridescenceIOR?: number | undefined;
|
|
39
|
+
iridescence?: number | undefined;
|
|
40
|
+
iridescenceThicknessRange?: [number, number] | undefined;
|
|
41
|
+
iridescenceThicknessMap?: Texture | null | undefined;
|
|
30
42
|
}
|
|
31
43
|
|
|
32
44
|
export class MeshPhysicalMaterial extends MeshStandardMaterial {
|
|
@@ -175,7 +187,7 @@ export class MeshPhysicalMaterial extends MeshStandardMaterial {
|
|
|
175
187
|
/**
|
|
176
188
|
* @default [100, 400]
|
|
177
189
|
*/
|
|
178
|
-
iridescenceThicknessRange: number
|
|
190
|
+
iridescenceThicknessRange: [number, number];
|
|
179
191
|
|
|
180
192
|
/**
|
|
181
193
|
* @default null
|
three/src/math/Color.d.ts
CHANGED
|
@@ -2,9 +2,163 @@ import { ColorSpace } from '../constants';
|
|
|
2
2
|
import { ColorRepresentation } from '../utils';
|
|
3
3
|
|
|
4
4
|
import { BufferAttribute } from './../core/BufferAttribute';
|
|
5
|
+
import { InterleavedBufferAttribute } from './../core/InterleavedBufferAttribute';
|
|
5
6
|
|
|
6
7
|
export { SRGBToLinear } from './ColorManagement';
|
|
7
8
|
|
|
9
|
+
declare const _colorKeywords: {
|
|
10
|
+
aliceblue: 0xf0f8ff;
|
|
11
|
+
antiquewhite: 0xfaebd7;
|
|
12
|
+
aqua: 0x00ffff;
|
|
13
|
+
aquamarine: 0x7fffd4;
|
|
14
|
+
azure: 0xf0ffff;
|
|
15
|
+
beige: 0xf5f5dc;
|
|
16
|
+
bisque: 0xffe4c4;
|
|
17
|
+
black: 0x000000;
|
|
18
|
+
blanchedalmond: 0xffebcd;
|
|
19
|
+
blue: 0x0000ff;
|
|
20
|
+
blueviolet: 0x8a2be2;
|
|
21
|
+
brown: 0xa52a2a;
|
|
22
|
+
burlywood: 0xdeb887;
|
|
23
|
+
cadetblue: 0x5f9ea0;
|
|
24
|
+
chartreuse: 0x7fff00;
|
|
25
|
+
chocolate: 0xd2691e;
|
|
26
|
+
coral: 0xff7f50;
|
|
27
|
+
cornflowerblue: 0x6495ed;
|
|
28
|
+
cornsilk: 0xfff8dc;
|
|
29
|
+
crimson: 0xdc143c;
|
|
30
|
+
cyan: 0x00ffff;
|
|
31
|
+
darkblue: 0x00008b;
|
|
32
|
+
darkcyan: 0x008b8b;
|
|
33
|
+
darkgoldenrod: 0xb8860b;
|
|
34
|
+
darkgray: 0xa9a9a9;
|
|
35
|
+
darkgreen: 0x006400;
|
|
36
|
+
darkgrey: 0xa9a9a9;
|
|
37
|
+
darkkhaki: 0xbdb76b;
|
|
38
|
+
darkmagenta: 0x8b008b;
|
|
39
|
+
darkolivegreen: 0x556b2f;
|
|
40
|
+
darkorange: 0xff8c00;
|
|
41
|
+
darkorchid: 0x9932cc;
|
|
42
|
+
darkred: 0x8b0000;
|
|
43
|
+
darksalmon: 0xe9967a;
|
|
44
|
+
darkseagreen: 0x8fbc8f;
|
|
45
|
+
darkslateblue: 0x483d8b;
|
|
46
|
+
darkslategray: 0x2f4f4f;
|
|
47
|
+
darkslategrey: 0x2f4f4f;
|
|
48
|
+
darkturquoise: 0x00ced1;
|
|
49
|
+
darkviolet: 0x9400d3;
|
|
50
|
+
deeppink: 0xff1493;
|
|
51
|
+
deepskyblue: 0x00bfff;
|
|
52
|
+
dimgray: 0x696969;
|
|
53
|
+
dimgrey: 0x696969;
|
|
54
|
+
dodgerblue: 0x1e90ff;
|
|
55
|
+
firebrick: 0xb22222;
|
|
56
|
+
floralwhite: 0xfffaf0;
|
|
57
|
+
forestgreen: 0x228b22;
|
|
58
|
+
fuchsia: 0xff00ff;
|
|
59
|
+
gainsboro: 0xdcdcdc;
|
|
60
|
+
ghostwhite: 0xf8f8ff;
|
|
61
|
+
gold: 0xffd700;
|
|
62
|
+
goldenrod: 0xdaa520;
|
|
63
|
+
gray: 0x808080;
|
|
64
|
+
green: 0x008000;
|
|
65
|
+
greenyellow: 0xadff2f;
|
|
66
|
+
grey: 0x808080;
|
|
67
|
+
honeydew: 0xf0fff0;
|
|
68
|
+
hotpink: 0xff69b4;
|
|
69
|
+
indianred: 0xcd5c5c;
|
|
70
|
+
indigo: 0x4b0082;
|
|
71
|
+
ivory: 0xfffff0;
|
|
72
|
+
khaki: 0xf0e68c;
|
|
73
|
+
lavender: 0xe6e6fa;
|
|
74
|
+
lavenderblush: 0xfff0f5;
|
|
75
|
+
lawngreen: 0x7cfc00;
|
|
76
|
+
lemonchiffon: 0xfffacd;
|
|
77
|
+
lightblue: 0xadd8e6;
|
|
78
|
+
lightcoral: 0xf08080;
|
|
79
|
+
lightcyan: 0xe0ffff;
|
|
80
|
+
lightgoldenrodyellow: 0xfafad2;
|
|
81
|
+
lightgray: 0xd3d3d3;
|
|
82
|
+
lightgreen: 0x90ee90;
|
|
83
|
+
lightgrey: 0xd3d3d3;
|
|
84
|
+
lightpink: 0xffb6c1;
|
|
85
|
+
lightsalmon: 0xffa07a;
|
|
86
|
+
lightseagreen: 0x20b2aa;
|
|
87
|
+
lightskyblue: 0x87cefa;
|
|
88
|
+
lightslategray: 0x778899;
|
|
89
|
+
lightslategrey: 0x778899;
|
|
90
|
+
lightsteelblue: 0xb0c4de;
|
|
91
|
+
lightyellow: 0xffffe0;
|
|
92
|
+
lime: 0x00ff00;
|
|
93
|
+
limegreen: 0x32cd32;
|
|
94
|
+
linen: 0xfaf0e6;
|
|
95
|
+
magenta: 0xff00ff;
|
|
96
|
+
maroon: 0x800000;
|
|
97
|
+
mediumaquamarine: 0x66cdaa;
|
|
98
|
+
mediumblue: 0x0000cd;
|
|
99
|
+
mediumorchid: 0xba55d3;
|
|
100
|
+
mediumpurple: 0x9370db;
|
|
101
|
+
mediumseagreen: 0x3cb371;
|
|
102
|
+
mediumslateblue: 0x7b68ee;
|
|
103
|
+
mediumspringgreen: 0x00fa9a;
|
|
104
|
+
mediumturquoise: 0x48d1cc;
|
|
105
|
+
mediumvioletred: 0xc71585;
|
|
106
|
+
midnightblue: 0x191970;
|
|
107
|
+
mintcream: 0xf5fffa;
|
|
108
|
+
mistyrose: 0xffe4e1;
|
|
109
|
+
moccasin: 0xffe4b5;
|
|
110
|
+
navajowhite: 0xffdead;
|
|
111
|
+
navy: 0x000080;
|
|
112
|
+
oldlace: 0xfdf5e6;
|
|
113
|
+
olive: 0x808000;
|
|
114
|
+
olivedrab: 0x6b8e23;
|
|
115
|
+
orange: 0xffa500;
|
|
116
|
+
orangered: 0xff4500;
|
|
117
|
+
orchid: 0xda70d6;
|
|
118
|
+
palegoldenrod: 0xeee8aa;
|
|
119
|
+
palegreen: 0x98fb98;
|
|
120
|
+
paleturquoise: 0xafeeee;
|
|
121
|
+
palevioletred: 0xdb7093;
|
|
122
|
+
papayawhip: 0xffefd5;
|
|
123
|
+
peachpuff: 0xffdab9;
|
|
124
|
+
peru: 0xcd853f;
|
|
125
|
+
pink: 0xffc0cb;
|
|
126
|
+
plum: 0xdda0dd;
|
|
127
|
+
powderblue: 0xb0e0e6;
|
|
128
|
+
purple: 0x800080;
|
|
129
|
+
rebeccapurple: 0x663399;
|
|
130
|
+
red: 0xff0000;
|
|
131
|
+
rosybrown: 0xbc8f8f;
|
|
132
|
+
royalblue: 0x4169e1;
|
|
133
|
+
saddlebrown: 0x8b4513;
|
|
134
|
+
salmon: 0xfa8072;
|
|
135
|
+
sandybrown: 0xf4a460;
|
|
136
|
+
seagreen: 0x2e8b57;
|
|
137
|
+
seashell: 0xfff5ee;
|
|
138
|
+
sienna: 0xa0522d;
|
|
139
|
+
silver: 0xc0c0c0;
|
|
140
|
+
skyblue: 0x87ceeb;
|
|
141
|
+
slateblue: 0x6a5acd;
|
|
142
|
+
slategray: 0x708090;
|
|
143
|
+
slategrey: 0x708090;
|
|
144
|
+
snow: 0xfffafa;
|
|
145
|
+
springgreen: 0x00ff7f;
|
|
146
|
+
steelblue: 0x4682b4;
|
|
147
|
+
tan: 0xd2b48c;
|
|
148
|
+
teal: 0x008080;
|
|
149
|
+
thistle: 0xd8bfd8;
|
|
150
|
+
tomato: 0xff6347;
|
|
151
|
+
turquoise: 0x40e0d0;
|
|
152
|
+
violet: 0xee82ee;
|
|
153
|
+
wheat: 0xf5deb3;
|
|
154
|
+
white: 0xffffff;
|
|
155
|
+
whitesmoke: 0xf5f5f5;
|
|
156
|
+
yellow: 0xffff00;
|
|
157
|
+
yellowgreen: 0x9acd32;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export type ColorKeyword = keyof typeof _colorKeywords;
|
|
161
|
+
|
|
8
162
|
export interface HSL {
|
|
9
163
|
h: number;
|
|
10
164
|
s: number;
|
|
@@ -82,7 +236,7 @@ export class Color {
|
|
|
82
236
|
* Faster than {@link Color#setStyle .setStyle()} method if you don't need the other CSS-style formats.
|
|
83
237
|
* @param style Color name in X11 format.
|
|
84
238
|
*/
|
|
85
|
-
setColorName(style:
|
|
239
|
+
setColorName(style: ColorKeyword, colorSpace?: ColorSpace): Color;
|
|
86
240
|
|
|
87
241
|
/**
|
|
88
242
|
* Clones this color.
|
|
@@ -173,12 +327,12 @@ export class Color {
|
|
|
173
327
|
*/
|
|
174
328
|
toArray(xyz: ArrayLike<number>, offset?: number): ArrayLike<number>;
|
|
175
329
|
|
|
176
|
-
fromBufferAttribute(attribute: BufferAttribute, index: number): this;
|
|
330
|
+
fromBufferAttribute(attribute: BufferAttribute | InterleavedBufferAttribute, index: number): this;
|
|
177
331
|
|
|
178
332
|
[Symbol.iterator](): Generator<number, void>;
|
|
179
333
|
|
|
180
334
|
/**
|
|
181
335
|
* List of X11 color names.
|
|
182
336
|
*/
|
|
183
|
-
static NAMES:
|
|
337
|
+
static NAMES: typeof _colorKeywords;
|
|
184
338
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColorSpace, LinearSRGBColorSpace, SRGBColorSpace } from '../constants';
|
|
1
|
+
import { ColorSpace, DisplayP3ColorSpace, LinearSRGBColorSpace, SRGBColorSpace } from '../constants';
|
|
2
2
|
import { Color } from './Color';
|
|
3
3
|
|
|
4
4
|
export function SRGBToLinear(c: number): number;
|
|
@@ -7,9 +7,9 @@ export function LinearToSRGB(c: number): number;
|
|
|
7
7
|
|
|
8
8
|
export namespace ColorManagement {
|
|
9
9
|
/**
|
|
10
|
-
* @default
|
|
10
|
+
* @default false
|
|
11
11
|
*/
|
|
12
|
-
let
|
|
12
|
+
let enabled: boolean;
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @default LinearSRGBColorSpace
|
|
@@ -18,11 +18,17 @@ export namespace ColorManagement {
|
|
|
18
18
|
|
|
19
19
|
function convert(
|
|
20
20
|
color: Color,
|
|
21
|
-
sourceColorSpace: SRGBColorSpace | LinearSRGBColorSpace,
|
|
22
|
-
targetColorSpace: SRGBColorSpace | LinearSRGBColorSpace,
|
|
21
|
+
sourceColorSpace: typeof SRGBColorSpace | typeof LinearSRGBColorSpace | typeof DisplayP3ColorSpace,
|
|
22
|
+
targetColorSpace: typeof SRGBColorSpace | typeof LinearSRGBColorSpace | typeof DisplayP3ColorSpace,
|
|
23
23
|
): Color;
|
|
24
24
|
|
|
25
|
-
function fromWorkingColorSpace(
|
|
25
|
+
function fromWorkingColorSpace(
|
|
26
|
+
color: Color,
|
|
27
|
+
targetColorSpace: typeof SRGBColorSpace | typeof LinearSRGBColorSpace | typeof DisplayP3ColorSpace,
|
|
28
|
+
): Color;
|
|
26
29
|
|
|
27
|
-
function toWorkingColorSpace(
|
|
30
|
+
function toWorkingColorSpace(
|
|
31
|
+
color: Color,
|
|
32
|
+
sourceColorSpace: typeof SRGBColorSpace | typeof LinearSRGBColorSpace | typeof DisplayP3ColorSpace,
|
|
33
|
+
): Color;
|
|
28
34
|
}
|