@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
three/src/objects/Points.d.ts
CHANGED
|
@@ -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
|
|
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
|
-
*
|
|
16
|
-
* @param
|
|
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
|
-
|
|
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
|
|
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.
|
|
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
|
-
|
|
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
|
}
|
three/src/objects/Skeleton.d.ts
CHANGED
|
@@ -2,28 +2,114 @@ import { Bone } from './Bone';
|
|
|
2
2
|
import { Matrix4 } from './../math/Matrix4';
|
|
3
3
|
import { DataTexture } from './../textures/DataTexture';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Use an array of {@link Bone | bones} to create a {@link Skeleton} that can be used by a {@link THREE.SkinnedMesh | SkinnedMesh}.
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Create a simple "arm"
|
|
10
|
+
* const bones = [];
|
|
11
|
+
* const shoulder = new THREE.Bone();
|
|
12
|
+
* const elbow = new THREE.Bone();
|
|
13
|
+
* const hand = new THREE.Bone();
|
|
14
|
+
* shoulder.add(elbow);
|
|
15
|
+
* elbow.add(hand);
|
|
16
|
+
* bones.push(shoulder);
|
|
17
|
+
* bones.push(elbow);
|
|
18
|
+
* bones.push(hand);
|
|
19
|
+
* shoulder.position.y = -5;
|
|
20
|
+
* elbow.position.y = 0;
|
|
21
|
+
* hand.position.y = 5;
|
|
22
|
+
* const armSkeleton = new THREE.Skeleton(bones);
|
|
23
|
+
* See the[page: SkinnedMesh] page
|
|
24
|
+
* for an example of usage with standard[page: BufferGeometry].
|
|
25
|
+
* ```
|
|
26
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/objects/Skeleton | Official Documentation}
|
|
27
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/objects/Skeleton.js | Source}
|
|
28
|
+
*/
|
|
5
29
|
export class Skeleton {
|
|
30
|
+
/**
|
|
31
|
+
* Creates a new Skeleton.
|
|
32
|
+
* @param bones The array of {@link THREE.Bone | bones}. Default `[]`.
|
|
33
|
+
* @param boneInverses An array of {@link THREE.Matrix4 | Matrix4s}. Default `[]`.
|
|
34
|
+
*/
|
|
6
35
|
constructor(bones: Bone[], boneInverses?: Matrix4[]);
|
|
7
36
|
|
|
37
|
+
/**
|
|
38
|
+
* {@link http://en.wikipedia.org/wiki/Universally_unique_identifier | UUID} of this object instance.
|
|
39
|
+
* @remarks This gets automatically assigned and shouldn't be edited.
|
|
40
|
+
*/
|
|
8
41
|
uuid: string;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The array of {@link THREE.Bone | Bones}.
|
|
45
|
+
* @remarks Note this is a copy of the original array, not a reference, so you can modify the original array without effecting this one.
|
|
46
|
+
*/
|
|
9
47
|
bones: Bone[];
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* An array of {@link Matrix4 | Matrix4s} that represent the inverse of the {@link THREE.Matrix4 | matrixWorld} of the individual bones.
|
|
51
|
+
*/
|
|
10
52
|
boneInverses: Matrix4[];
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The array buffer holding the bone data when using a vertex texture.
|
|
56
|
+
*/
|
|
11
57
|
boneMatrices: Float32Array;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* The {@link THREE.DataTexture | DataTexture} holding the bone data when using a vertex texture.
|
|
61
|
+
*/
|
|
12
62
|
boneTexture: null | DataTexture;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The size of the {@link boneTexture | .boneTexture}.
|
|
66
|
+
* @remarks Expects a `Integer`
|
|
67
|
+
*/
|
|
13
68
|
boneTextureSize: number;
|
|
69
|
+
|
|
14
70
|
frame: number;
|
|
15
71
|
|
|
16
72
|
init(): void;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Generates the {@link boneInverses} array if not provided in the constructor.
|
|
76
|
+
*/
|
|
17
77
|
calculateInverses(): void;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Computes an instance of {@link THREE.DataTexture | DataTexture} in order to pass the bone data more efficiently to the shader
|
|
81
|
+
* @remarks
|
|
82
|
+
* The texture is assigned to {@link boneTexture}.
|
|
83
|
+
*/
|
|
18
84
|
computeBoneTexture(): this;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Returns the skeleton to the base pose.
|
|
88
|
+
*/
|
|
19
89
|
pose(): void;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Updates the {@link boneMatrices} and {@link boneTexture} after changing the bones
|
|
93
|
+
* @remarks
|
|
94
|
+
* This is called automatically by the {@link THREE.WebGLRenderer | WebGLRenderer} if the {@link Skeleton} is used with a {@link THREE.SkinnedMesh | SkinnedMesh}.
|
|
95
|
+
*/
|
|
20
96
|
update(): void;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Returns a clone of this {@link Skeleton} object.
|
|
100
|
+
*/
|
|
21
101
|
clone(): Skeleton;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Searches through the skeleton's bone array and returns the first with a matching name.
|
|
105
|
+
* @param name String to match to the Bone's {@link THREE.Bone.name | .name} property.
|
|
106
|
+
*/
|
|
22
107
|
getBoneByName(name: string): undefined | Bone;
|
|
23
|
-
dispose(): void;
|
|
24
108
|
|
|
25
109
|
/**
|
|
26
|
-
*
|
|
110
|
+
* Frees the GPU-related resources allocated by this instance
|
|
111
|
+
* @remarks
|
|
112
|
+
* Call this method whenever this instance is no longer used in your app.
|
|
27
113
|
*/
|
|
28
|
-
|
|
114
|
+
dispose(): void;
|
|
29
115
|
}
|
|
@@ -5,21 +5,140 @@ import { Skeleton } from './Skeleton';
|
|
|
5
5
|
import { Mesh } from './Mesh';
|
|
6
6
|
import { BufferGeometry } from '../core/BufferGeometry';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* A mesh that has a {@link THREE.Skeleton | Skeleton} with {@link Bone | bones} that can then be used to animate the vertices of the geometry.
|
|
10
|
+
* @remarks
|
|
11
|
+
* {@link SkinnedMesh} can only be used with WebGL 2 or
|
|
12
|
+
* With WebGL 1 `OES_texture_float` and vertex textures support is required.
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const geometry = new THREE.CylinderGeometry(5, 5, 5, 5, 15, 5, 30);
|
|
16
|
+
* // create the skin indices and skin weights manually
|
|
17
|
+
* // (typically a loader would read this data from a 3D model for you)
|
|
18
|
+
* const position = geometry.attributes.position;
|
|
19
|
+
* const vertex = new THREE.Vector3();
|
|
20
|
+
* const skinIndices = [];
|
|
21
|
+
* const skinWeights = [];
|
|
22
|
+
* for (let i = 0; i & lt; position.count; i++) {
|
|
23
|
+
* vertex.fromBufferAttribute(position, i);
|
|
24
|
+
* // compute skinIndex and skinWeight based on some configuration data
|
|
25
|
+
* const y = (vertex.y + sizing.halfHeight);
|
|
26
|
+
* const skinIndex = Math.floor(y / sizing.segmentHeight);
|
|
27
|
+
* const skinWeight = (y % sizing.segmentHeight) / sizing.segmentHeight;
|
|
28
|
+
* skinIndices.push(skinIndex, skinIndex + 1, 0, 0);
|
|
29
|
+
* skinWeights.push(1 - skinWeight, skinWeight, 0, 0);
|
|
30
|
+
* }
|
|
31
|
+
* geometry.setAttribute('skinIndex', new THREE.Uint16BufferAttribute(skinIndices, 4));
|
|
32
|
+
* geometry.setAttribute('skinWeight', new THREE.Float32BufferAttribute(skinWeights, 4));
|
|
33
|
+
* // create skinned mesh and skeleton
|
|
34
|
+
* const mesh = new THREE.SkinnedMesh(geometry, material);
|
|
35
|
+
* const skeleton = new THREE.Skeleton(bones);
|
|
36
|
+
* // see example from THREE.Skeleton
|
|
37
|
+
* const rootBone = skeleton.bones[0];
|
|
38
|
+
* mesh.add(rootBone);
|
|
39
|
+
* // bind the skeleton to the mesh
|
|
40
|
+
* mesh.bind(skeleton);
|
|
41
|
+
* // move the bones and manipulate the model
|
|
42
|
+
* skeleton.bones[0].rotation.x = -0.1;
|
|
43
|
+
* skeleton.bones[1].rotation.x = 0.2;
|
|
44
|
+
* ```
|
|
45
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/objects/SkinnedMesh | Official Documentation}
|
|
46
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/objects/SkinnedMesh.js | Source}
|
|
47
|
+
*/
|
|
8
48
|
export class SkinnedMesh<
|
|
9
49
|
TGeometry extends BufferGeometry = BufferGeometry,
|
|
10
50
|
TMaterial extends Material | Material[] = Material | Material[],
|
|
11
51
|
> extends Mesh<TGeometry, TMaterial> {
|
|
52
|
+
/**
|
|
53
|
+
* Create a new instance of {@link SkinnedMesh}
|
|
54
|
+
* @param geometry An instance of {@link THREE.BufferGeometry | BufferGeometry}. Default {@link THREE.BufferGeometry | `new THREE.BufferGeometry()`}.
|
|
55
|
+
* @param material A single or an array of {@link THREE.Material | Material}. Default {@link THREE.MeshBasicMaterial | `new THREE.MeshBasicMaterial()`}.
|
|
56
|
+
*/
|
|
12
57
|
constructor(geometry?: TGeometry, material?: TMaterial, useVertexTexture?: boolean);
|
|
13
58
|
|
|
14
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Read-only flag to check if a given object is of type {@link SkinnedMesh}.
|
|
61
|
+
* @remarks This is a _constant_ value
|
|
62
|
+
* @defaultValue `true`
|
|
63
|
+
*/
|
|
64
|
+
readonly isSkinnedMesh: true;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @override
|
|
68
|
+
* @defaultValue `SkinnedMesh`
|
|
69
|
+
*/
|
|
70
|
+
override readonly type: string | 'SkinnedMesh';
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Either `attached` or `detached`.
|
|
74
|
+
* - `attached` uses the {@link THREE.SkinnedMesh.matrixWorld | SkinnedMesh.matrixWorld} property for the base transform matrix of the bones.
|
|
75
|
+
* - `detached` uses the {@link THREE.SkinnedMesh.bindMatrix | SkinnedMesh.bindMatrix}.
|
|
76
|
+
* @defaultValue `attached`.
|
|
77
|
+
*/
|
|
78
|
+
bindMode: 'attached' | 'detached';
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The base matrix that is used for the bound bone transforms.
|
|
82
|
+
*/
|
|
15
83
|
bindMatrix: Matrix4;
|
|
84
|
+
/**
|
|
85
|
+
* The base matrix that is used for resetting the bound bone transforms.
|
|
86
|
+
*/
|
|
16
87
|
bindMatrixInverse: Matrix4;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* {@link THREE.Skeleton | Skeleton} representing the bone hierarchy of the skinned mesh.
|
|
91
|
+
*/
|
|
17
92
|
skeleton: Skeleton;
|
|
18
|
-
readonly isSkinnedMesh: true;
|
|
19
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Bind a skeleton to the skinned mesh
|
|
96
|
+
* @remarks
|
|
97
|
+
* The bindMatrix gets saved to .bindMatrix property and the .bindMatrixInverse gets calculated.
|
|
98
|
+
* @param skeleton {@link THREE.Skeleton | Skeleton} created from a {@link Bone | Bones} tree.
|
|
99
|
+
* @param bindMatrix {@link THREE.Matrix4 | Matrix4} that represents the base transform of the skeleton.
|
|
100
|
+
*/
|
|
20
101
|
bind(skeleton: Skeleton, bindMatrix?: Matrix4): void;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* This method sets the skinned mesh in the rest pose (resets the pose).
|
|
105
|
+
*/
|
|
21
106
|
pose(): void;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Normalizes the skin weights.
|
|
110
|
+
*/
|
|
22
111
|
normalizeSkinWeights(): void;
|
|
23
|
-
|
|
112
|
+
|
|
113
|
+
/////////////////////////////////////////////////
|
|
114
|
+
// FUTURE - r151
|
|
115
|
+
/////////////////////////////////////////////////
|
|
116
|
+
// /**
|
|
117
|
+
// * Applies the bone transform associated with the given index to the given position vector
|
|
118
|
+
// * @remarks Returns the updated vector.
|
|
119
|
+
// * @param index Expects a `Integer`
|
|
120
|
+
// * @param vector
|
|
121
|
+
// */
|
|
122
|
+
// applyBoneTransform(index: number, vector: Vector3): Vector3;
|
|
123
|
+
|
|
124
|
+
// /**
|
|
125
|
+
// * @deprecated {@link THREE.SkinnedMesh}: {@link boneTransform | .boneTransform()} was renamed to {@link applyBoneTransform | .applyBoneTransform()} in **r151**.
|
|
126
|
+
// */
|
|
127
|
+
// boneTransform(index: number, target: Vector3): Vector3;
|
|
128
|
+
/////////////////////////////////////////////////
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Applies the bone transform associated with the given index to the given position vector.
|
|
132
|
+
* Calculates the position of the vertex at the given index relative to the current bone transformations.
|
|
133
|
+
* Target vector must be initialized with the vertex coordinates prior to the transformation:
|
|
134
|
+
* ```typescript
|
|
135
|
+
* const target = new THREE.Vector3();
|
|
136
|
+
* target.fromBufferAttribute( mesh.geometry.attributes.position, index );
|
|
137
|
+
* mesh.boneTransform( index, target );
|
|
138
|
+
* ```
|
|
139
|
+
* @remarks Returns the updated vector.
|
|
140
|
+
* @param index Expects a `Integer`
|
|
141
|
+
* @param vector
|
|
142
|
+
*/
|
|
24
143
|
boneTransform(index: number, target: Vector3): Vector3;
|
|
25
144
|
}
|
three/src/objects/Sprite.d.ts
CHANGED
|
@@ -5,16 +5,63 @@ import { Intersection } from '../core/Raycaster';
|
|
|
5
5
|
import { SpriteMaterial } from '../materials/Materials';
|
|
6
6
|
import { BufferGeometry } from '../core/BufferGeometry';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* A {@link Sprite} is a plane that always faces towards the camera, generally with a partially transparent texture applied.
|
|
10
|
+
* @remarks Sprites do not cast shadows, setting `castShadow = true` will have no effect.
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const map = new THREE.TextureLoader().load('sprite.png');
|
|
14
|
+
* const material = new THREE.SpriteMaterial({
|
|
15
|
+
* map: map
|
|
16
|
+
* });
|
|
17
|
+
* const {@link Sprite} = new THREE.Sprite(material);
|
|
18
|
+
* scene.add(sprite);
|
|
19
|
+
* ```
|
|
20
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/objects/Sprite | Official Documentation}
|
|
21
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/objects/Sprite.js | Source}
|
|
22
|
+
*/
|
|
8
23
|
export class Sprite extends Object3D {
|
|
24
|
+
/**
|
|
25
|
+
* Creates a new Sprite.
|
|
26
|
+
* @param material An instance of {@link THREE.SpriteMaterial | SpriteMaterial}. Default {@link THREE.SpriteMaterial | `new SpriteMaterial()`}, _with white color_.
|
|
27
|
+
*/
|
|
9
28
|
constructor(material?: SpriteMaterial);
|
|
10
29
|
|
|
11
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Read-only flag to check if a given object is of type {@link Sprite}.
|
|
32
|
+
* @remarks This is a _constant_ value
|
|
33
|
+
* @defaultValue `true`
|
|
34
|
+
*/
|
|
12
35
|
readonly isSprite: true;
|
|
13
36
|
|
|
37
|
+
/**
|
|
38
|
+
* @override
|
|
39
|
+
* @defaultValue `Sprite`
|
|
40
|
+
*/
|
|
41
|
+
override readonly type: string | 'Sprite';
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Whether the object gets rendered into shadow map.
|
|
45
|
+
* No effect in {@link Sprite}.
|
|
46
|
+
* @ignore
|
|
47
|
+
* @hidden
|
|
48
|
+
* @defaultValue `false`
|
|
49
|
+
*/
|
|
50
|
+
override castShadow: false;
|
|
51
|
+
|
|
14
52
|
geometry: BufferGeometry;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* An instance of {@link THREE.SpriteMaterial | SpriteMaterial}, defining the object's appearance.
|
|
56
|
+
* @defaultValue {@link THREE.SpriteMaterial | `new SpriteMaterial()`}, _with white color_.
|
|
57
|
+
*/
|
|
15
58
|
material: SpriteMaterial;
|
|
16
|
-
center: Vector2;
|
|
17
59
|
|
|
18
|
-
|
|
19
|
-
|
|
60
|
+
/**
|
|
61
|
+
* The sprite's anchor point, and the point around which the {@link Sprite} rotates.
|
|
62
|
+
* A value of (0.5, 0.5) corresponds to the midpoint of the sprite.
|
|
63
|
+
* A value of (0, 0) corresponds to the lower left corner of the sprite.
|
|
64
|
+
* @defaultValue {@link THREE.Vector2 | `new Vector2(0.5, 0.5)`}.
|
|
65
|
+
*/
|
|
66
|
+
center: Vector2;
|
|
20
67
|
}
|
|
@@ -2,13 +2,19 @@ import { Vector4 } from './../math/Vector4';
|
|
|
2
2
|
import { Texture } from './../textures/Texture';
|
|
3
3
|
import { DepthTexture } from './../textures/DepthTexture';
|
|
4
4
|
import { EventDispatcher } from './../core/EventDispatcher';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
Wrapping,
|
|
7
|
+
TextureDataType,
|
|
8
|
+
TextureEncoding,
|
|
9
|
+
MinificationTextureFilter,
|
|
10
|
+
MagnificationTextureFilter,
|
|
11
|
+
} from '../constants';
|
|
6
12
|
|
|
7
13
|
export interface WebGLRenderTargetOptions {
|
|
8
14
|
wrapS?: Wrapping | undefined;
|
|
9
15
|
wrapT?: Wrapping | undefined;
|
|
10
|
-
magFilter?:
|
|
11
|
-
minFilter?:
|
|
16
|
+
magFilter?: MagnificationTextureFilter | undefined;
|
|
17
|
+
minFilter?: MinificationTextureFilter | undefined;
|
|
12
18
|
format?: number | undefined; // RGBAFormat;
|
|
13
19
|
type?: TextureDataType | undefined; // UnsignedByteType;
|
|
14
20
|
anisotropy?: number | undefined; // 1;
|
|
@@ -178,9 +178,9 @@ export class WebGLRenderer implements Renderer {
|
|
|
178
178
|
outputEncoding: TextureEncoding;
|
|
179
179
|
|
|
180
180
|
/**
|
|
181
|
-
* @default
|
|
181
|
+
* @default true
|
|
182
182
|
*/
|
|
183
|
-
|
|
183
|
+
useLegacyLights: boolean;
|
|
184
184
|
|
|
185
185
|
/**
|
|
186
186
|
* @default THREE.NoToneMapping
|
three/src/scenes/Fog.d.ts
CHANGED
|
@@ -2,42 +2,94 @@ import { ColorRepresentation } from '../utils';
|
|
|
2
2
|
import { Color } from './../math/Color';
|
|
3
3
|
|
|
4
4
|
export interface FogBase {
|
|
5
|
+
/**
|
|
6
|
+
* Optional name of the `Fog` object
|
|
7
|
+
* @remarks _(doesn't need to be unique)_.
|
|
8
|
+
* @defaultValue `""`
|
|
9
|
+
*/
|
|
5
10
|
name: string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Fog color.
|
|
14
|
+
* @remarks If set to black, far away objects will be rendered black.
|
|
15
|
+
*/
|
|
6
16
|
color: Color;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Returns a new Fog instance with the same parameters as this one.
|
|
20
|
+
*/
|
|
7
21
|
clone(): FogBase;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Return Fog data in JSON format.
|
|
25
|
+
*/
|
|
8
26
|
toJSON(): any;
|
|
9
27
|
}
|
|
10
28
|
|
|
11
29
|
/**
|
|
12
30
|
* This class contains the parameters that define linear fog, i.e., that grows linearly denser with the distance.
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* const scene = new THREE.Scene();
|
|
34
|
+
* scene.fog = new THREE.Fog(0xcccccc, 10, 15);
|
|
35
|
+
* ```
|
|
36
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/scenes/Fog | Official Documentation}
|
|
37
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/scenes/Fog.js | Source}
|
|
13
38
|
*/
|
|
14
39
|
export class Fog implements FogBase {
|
|
40
|
+
/**
|
|
41
|
+
* The color parameter is passed to the {@link THREE.Color | Color} constructor to set the color property
|
|
42
|
+
* @remarks
|
|
43
|
+
* Color can be a hexadecimal integer or a CSS-style string.
|
|
44
|
+
* @param color
|
|
45
|
+
* @param near Expects a `Float`
|
|
46
|
+
* @param far Expects a `Float`
|
|
47
|
+
*/
|
|
15
48
|
constructor(color: ColorRepresentation, near?: number, far?: number);
|
|
16
49
|
|
|
17
50
|
/**
|
|
18
|
-
* @
|
|
51
|
+
* Read-only flag to check if a given object is of type {@link Fog}.
|
|
52
|
+
* @remarks This is a _constant_ value
|
|
53
|
+
* @defaultValue `true`
|
|
54
|
+
*/
|
|
55
|
+
readonly isFog: true;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Optional name of the object
|
|
59
|
+
* @remarks _(doesn't need to be unique)_.
|
|
60
|
+
* @defaultValue `""`
|
|
19
61
|
*/
|
|
20
62
|
name: string;
|
|
21
63
|
|
|
22
64
|
/**
|
|
23
65
|
* Fog color.
|
|
66
|
+
* @remarks If set to black, far away objects will be rendered black.
|
|
24
67
|
*/
|
|
25
68
|
color: Color;
|
|
26
69
|
|
|
27
70
|
/**
|
|
28
|
-
* The minimum distance to start applying fog.
|
|
29
|
-
* @
|
|
71
|
+
* The minimum distance to start applying fog.
|
|
72
|
+
* @remarks Objects that are less than **near** units from the active camera won't be affected by fog.
|
|
73
|
+
* @defaultValue `1`
|
|
74
|
+
* @remarks Expects a `Float`
|
|
30
75
|
*/
|
|
31
76
|
near: number;
|
|
32
77
|
|
|
33
78
|
/**
|
|
34
|
-
* The maximum distance at which fog stops being calculated and applied.
|
|
35
|
-
* @
|
|
79
|
+
* The maximum distance at which fog stops being calculated and applied.
|
|
80
|
+
* @remarks Objects that are more than **far** units away from the active camera won't be affected by fog.
|
|
81
|
+
* @defaultValue `1000`
|
|
82
|
+
* @remarks Expects a `Float`
|
|
36
83
|
*/
|
|
37
84
|
far: number;
|
|
38
85
|
|
|
39
|
-
|
|
40
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Returns a new {@link Fog} instance with the same parameters as this one.
|
|
88
|
+
*/
|
|
41
89
|
clone(): Fog;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Return {@link Fog} data in JSON format.
|
|
93
|
+
*/
|
|
42
94
|
toJSON(): any;
|
|
43
95
|
}
|
three/src/scenes/FogExp2.d.ts
CHANGED
|
@@ -1,26 +1,61 @@
|
|
|
1
|
+
import { ColorRepresentation } from '../utils';
|
|
1
2
|
import { Color } from './../math/Color';
|
|
2
3
|
import { FogBase } from './Fog';
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
|
-
* This class contains the parameters that define
|
|
6
|
+
* This class contains the parameters that define exponential squared fog, which gives a clear view near the camera and a faster than exponentially densening fog farther from the camera.
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const scene = new THREE.Scene();
|
|
10
|
+
* scene.fog = new THREE.FogExp2(0xcccccc, 0.002);
|
|
11
|
+
* ```
|
|
12
|
+
* @see Example: {@link https://threejs.org/examples/#webgl_geometry_terrain | webgl geometry terrain}
|
|
13
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/scenes/FogExp2 | Official Documentation}
|
|
14
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/scenes/FogExp2.js | Source}
|
|
5
15
|
*/
|
|
6
16
|
export class FogExp2 implements FogBase {
|
|
7
|
-
|
|
17
|
+
/**
|
|
18
|
+
* The color parameter is passed to the {@link THREE.Color | Color} constructor to set the color property
|
|
19
|
+
* @remarks Color can be a hexadecimal integer or a CSS-style string.
|
|
20
|
+
* @param color
|
|
21
|
+
* @param density Expects a `Float`
|
|
22
|
+
*/
|
|
23
|
+
constructor(color: ColorRepresentation, density?: number);
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Read-only flag to check if a given object is of type {@link FogExp2}.
|
|
27
|
+
* @remarks This is a _constant_ value
|
|
28
|
+
* @defaultValue `true`
|
|
29
|
+
*/
|
|
30
|
+
readonly isFogExp2: true;
|
|
8
31
|
|
|
9
32
|
/**
|
|
10
|
-
*
|
|
33
|
+
* Optional name of the object
|
|
34
|
+
* @remarks _(doesn't need to be unique)_.
|
|
35
|
+
* @defaultValue `""`
|
|
11
36
|
*/
|
|
12
37
|
name: string;
|
|
13
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Fog color.
|
|
41
|
+
* @remarks If set to black, far away objects will be rendered black.
|
|
42
|
+
*/
|
|
14
43
|
color: Color;
|
|
15
44
|
|
|
16
45
|
/**
|
|
17
46
|
* Defines how fast the fog will grow dense.
|
|
18
|
-
* @
|
|
47
|
+
* @defaultValue `0.00025`
|
|
48
|
+
* @remarks Expects a `Float`
|
|
19
49
|
*/
|
|
20
50
|
density: number;
|
|
21
51
|
|
|
22
|
-
|
|
23
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Returns a new {@link FogExp2} instance with the same parameters as this one.
|
|
54
|
+
*/
|
|
24
55
|
clone(): FogExp2;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Return {@link FogExp2} data in JSON format.
|
|
59
|
+
*/
|
|
25
60
|
toJSON(): any;
|
|
26
61
|
}
|