@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,59 +1,96 @@
|
|
|
1
1
|
import { Camera } from './Camera';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Camera
|
|
5
|
-
*
|
|
6
|
-
* @
|
|
4
|
+
* Camera that uses {@link https://en.wikipedia.org/wiki/Perspective_(graphical) | perspective projection}.
|
|
5
|
+
* This projection mode is designed to mimic the way the human eye sees
|
|
6
|
+
* @remarks
|
|
7
|
+
* It is the most common projection mode used for rendering a 3D scene.
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const camera = new THREE.PerspectiveCamera(45, width / height, 1, 1000);
|
|
11
|
+
* scene.add(camera);
|
|
12
|
+
* ```
|
|
13
|
+
* @see Example: {@link https://threejs.org/examples/#webgl_animation_skinning_blending | animation / skinning / blending }
|
|
14
|
+
* @see Example: {@link https://threejs.org/examples/#webgl_animation_skinning_morph | animation / skinning / morph }
|
|
15
|
+
* @see Example: {@link https://threejs.org/examples/#webgl_effects_stereo | effects / stereo }
|
|
16
|
+
* @see Example: {@link https://threejs.org/examples/#webgl_interactive_cubes | interactive / cubes }
|
|
17
|
+
* @see Example: {@link https://threejs.org/examples/#webgl_loader_collada_skinning | loader / collada / skinning }
|
|
18
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/cameras/PerspectiveCamera | Official Documentation}
|
|
19
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/cameras/PerspectiveCamera.js | Source}
|
|
7
20
|
*/
|
|
8
21
|
export class PerspectiveCamera extends Camera {
|
|
9
22
|
/**
|
|
10
|
-
*
|
|
11
|
-
* @
|
|
12
|
-
* @param
|
|
13
|
-
* @param
|
|
23
|
+
* Creates a new {@link PerspectiveCamera}.
|
|
24
|
+
* @remarks Together these define the camera's {@link https://en.wikipedia.org/wiki/Viewing_frustum | viewing frustum}.
|
|
25
|
+
* @param fov Camera frustum vertical field of view. Default `50`.
|
|
26
|
+
* @param aspect Camera frustum aspect ratio. Default `1`.
|
|
27
|
+
* @param near Camera frustum near plane. Default `0.1`.
|
|
28
|
+
* @param far Camera frustum far plane. Default `2000`.
|
|
14
29
|
*/
|
|
15
30
|
constructor(fov?: number, aspect?: number, near?: number, far?: number);
|
|
16
31
|
|
|
17
|
-
|
|
18
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Read-only flag to check if a given object is of type {@link Camera}.
|
|
34
|
+
* @remarks This is a _constant_ value
|
|
35
|
+
* @defaultValue `true`
|
|
36
|
+
*/
|
|
19
37
|
readonly isPerspectiveCamera: true;
|
|
20
38
|
|
|
21
39
|
/**
|
|
22
|
-
* @
|
|
40
|
+
* @override
|
|
41
|
+
* @defaultValue `PerspectiveCamera`
|
|
42
|
+
*/
|
|
43
|
+
override readonly type: string | 'PerspectiveCamera';
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Gets or sets the zoom factor of the camera.
|
|
47
|
+
* @defaultValue `1`
|
|
23
48
|
*/
|
|
24
49
|
zoom: number;
|
|
25
50
|
|
|
26
51
|
/**
|
|
27
52
|
* Camera frustum vertical field of view, from bottom to top of view, in degrees.
|
|
28
|
-
* @
|
|
53
|
+
* @remarks Expects a `Float`
|
|
54
|
+
* @defaultValue `50`
|
|
29
55
|
*/
|
|
30
56
|
fov: number;
|
|
31
57
|
|
|
32
58
|
/**
|
|
33
|
-
* Camera frustum aspect ratio,
|
|
34
|
-
* @
|
|
59
|
+
* Camera frustum aspect ratio, usually the canvas width / canvas height.
|
|
60
|
+
* @remarks Expects a `Float`
|
|
61
|
+
* @defaultValue `1`, _(square canvas)_.
|
|
35
62
|
*/
|
|
36
63
|
aspect: number;
|
|
37
64
|
|
|
38
65
|
/**
|
|
39
66
|
* Camera frustum near plane.
|
|
40
|
-
* @
|
|
67
|
+
* @remarks The valid range is greater than `0` and less than the current value of the {@link far | .far} plane.
|
|
68
|
+
* @remarks Note that, unlike for the {@link THREE.OrthographicCamera | OrthographicCamera}, `0` is **not** a valid value for a {@link PerspectiveCamera |PerspectiveCamera's}. near plane.
|
|
69
|
+
* @defaultValue `0.1`
|
|
70
|
+
* @remarks Expects a `Float`
|
|
41
71
|
*/
|
|
42
72
|
near: number;
|
|
43
73
|
|
|
44
74
|
/**
|
|
45
75
|
* Camera frustum far plane.
|
|
46
|
-
* @
|
|
76
|
+
* @remarks Must be greater than the current value of {@link near | .near} plane.
|
|
77
|
+
* @remarks Expects a `Float`
|
|
78
|
+
* @defaultValue `2000`
|
|
47
79
|
*/
|
|
48
80
|
far: number;
|
|
49
81
|
|
|
50
82
|
/**
|
|
51
|
-
*
|
|
83
|
+
* Object distance used for stereoscopy and depth-of-field effects.
|
|
84
|
+
* @remarks This parameter does not influence the projection matrix unless a {@link THREE.StereoCamera | StereoCamera} is being used.
|
|
85
|
+
* @remarks Expects a `Float`
|
|
86
|
+
* @defaultValue `10`
|
|
52
87
|
*/
|
|
53
88
|
focus: number;
|
|
54
89
|
|
|
55
90
|
/**
|
|
56
|
-
*
|
|
91
|
+
* Frustum window specification or null.
|
|
92
|
+
* This is set using the {@link setViewOffset | .setViewOffset} method and cleared using {@link clearViewOffset | .clearViewOffset}.
|
|
93
|
+
* @defaultValue `null`
|
|
57
94
|
*/
|
|
58
95
|
view: null | {
|
|
59
96
|
enabled: boolean;
|
|
@@ -66,69 +103,108 @@ export class PerspectiveCamera extends Camera {
|
|
|
66
103
|
};
|
|
67
104
|
|
|
68
105
|
/**
|
|
69
|
-
*
|
|
106
|
+
* Film size used for the larger axis.
|
|
107
|
+
* This parameter does not influence the projection matrix unless {@link filmOffset | .filmOffset} is set to a nonzero value.
|
|
108
|
+
* @remarks Expects a `Float`
|
|
109
|
+
* @defaultValue `35`, _millimeters_.
|
|
70
110
|
*/
|
|
71
111
|
filmGauge: number;
|
|
72
112
|
|
|
73
113
|
/**
|
|
74
|
-
* @
|
|
114
|
+
* Horizontal off-center offset in the same unit as {@link filmGauge | .filmGauge}.
|
|
115
|
+
* @remarks Expects a `Float`
|
|
116
|
+
* @defaultValue `0`
|
|
75
117
|
*/
|
|
76
118
|
filmOffset: number;
|
|
77
119
|
|
|
78
|
-
|
|
120
|
+
/**
|
|
121
|
+
* Returns the focal length of the current {@link .fov | fov} in respect to {@link filmGauge | .filmGauge}.
|
|
122
|
+
*/
|
|
79
123
|
getFocalLength(): number;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Sets the FOV by focal length in respect to the current {@link filmGauge | .filmGauge}.
|
|
127
|
+
* @remarks By default, the focal length is specified for a `35mm` (full frame) camera.
|
|
128
|
+
* @param focalLength Expects a `Float`
|
|
129
|
+
*/
|
|
130
|
+
setFocalLength(focalLength: number): void;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Returns the current vertical field of view angle in degrees considering {@link zoom | .zoom}.
|
|
134
|
+
*/
|
|
80
135
|
getEffectiveFOV(): number;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Returns the width of the image on the film
|
|
139
|
+
* @remarks
|
|
140
|
+
* If {@link aspect | .aspect}. is greater than or equal to one (landscape format), the result equals {@link filmGauge | .filmGauge}.
|
|
141
|
+
*/
|
|
81
142
|
getFilmWidth(): number;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Returns the height of the image on the film
|
|
146
|
+
* @remarks
|
|
147
|
+
* If {@link aspect | .aspect}. is less than or equal to one (portrait format), the result equals {@link filmGauge | .filmGauge}.
|
|
148
|
+
*/
|
|
82
149
|
getFilmHeight(): number;
|
|
83
150
|
|
|
84
151
|
/**
|
|
85
|
-
* Sets an offset in a larger frustum.
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* +---+---+---+
|
|
89
|
-
* | A | B | C |
|
|
90
|
-
* +---+---+---+
|
|
91
|
-
* | D | E | F |
|
|
92
|
-
* +---+---+---+
|
|
93
|
-
*
|
|
94
|
-
* then for each monitor you would call it like this:
|
|
95
|
-
*
|
|
96
|
-
* const w = 1920;
|
|
97
|
-
* const h = 1080;
|
|
98
|
-
* const fullWidth = w * 3;
|
|
99
|
-
* const fullHeight = h * 2;
|
|
152
|
+
* Sets an offset in a larger frustum.
|
|
153
|
+
* @remarks
|
|
154
|
+
* This is useful for multi-window or multi-monitor/multi-machine setups.
|
|
100
155
|
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
156
|
+
* For example, if you have 3x2 monitors and each monitor is _1920x1080_ and
|
|
157
|
+
* the monitors are in grid like this
|
|
158
|
+
* ```
|
|
159
|
+
* ┌───┬───┬───┐
|
|
160
|
+
* │ A │ B │ C │
|
|
161
|
+
* ├───┼───┼───┤
|
|
162
|
+
* │ D │ E │ F │
|
|
163
|
+
* └───┴───┴───┘
|
|
164
|
+
* ```
|
|
165
|
+
* then for each monitor you would call it like this
|
|
166
|
+
* ```typescript
|
|
167
|
+
* const w = 1920;
|
|
168
|
+
* const h = 1080;
|
|
169
|
+
* const fullWidth = w * 3;
|
|
170
|
+
* const fullHeight = h * 2;
|
|
113
171
|
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
172
|
+
* // Monitor - A
|
|
173
|
+
* camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );
|
|
174
|
+
* // Monitor - B
|
|
175
|
+
* camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );
|
|
176
|
+
* // Monitor - C
|
|
177
|
+
* camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );
|
|
178
|
+
* // Monitor - D
|
|
179
|
+
* camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );
|
|
180
|
+
* // Monitor - E
|
|
181
|
+
* camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );
|
|
182
|
+
* // Monitor - F
|
|
183
|
+
* camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );
|
|
184
|
+
* ```
|
|
185
|
+
* Note there is no reason monitors have to be the same size or in a grid.
|
|
186
|
+
* @param fullWidth Full width of multiview setup Expects a `Float`.
|
|
187
|
+
* @param fullHeight Full height of multiview setup Expects a `Float`.
|
|
188
|
+
* @param x Horizontal offset of subcamera Expects a `Float`.
|
|
189
|
+
* @param y Vertical offset of subcamera Expects a `Float`.
|
|
190
|
+
* @param width Width of subcamera Expects a `Float`.
|
|
191
|
+
* @param height Height of subcamera Expects a `Float`.
|
|
120
192
|
*/
|
|
121
193
|
setViewOffset(fullWidth: number, fullHeight: number, x: number, y: number, width: number, height: number): void;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Removes any offset set by the {@link setViewOffset | .setViewOffset} method.
|
|
197
|
+
*/
|
|
122
198
|
clearViewOffset(): void;
|
|
123
199
|
|
|
124
200
|
/**
|
|
125
|
-
* Updates the camera projection matrix
|
|
201
|
+
* Updates the camera projection matrix
|
|
202
|
+
* @remarks Must be called after any change of parameters.
|
|
126
203
|
*/
|
|
127
204
|
updateProjectionMatrix(): void;
|
|
128
|
-
toJSON(meta?: any): any;
|
|
129
205
|
|
|
130
206
|
/**
|
|
131
|
-
* @deprecated Use {@link PerspectiveCamera
|
|
207
|
+
* @deprecated Use {@link PerspectiveCamera.setFocalLength | .setFocalLength()} and {@link PerspectiveCamera.filmGauge | .filmGauge} instead.
|
|
132
208
|
*/
|
|
133
209
|
setLens(focalLength: number, frameHeight?: number): void;
|
|
134
210
|
}
|
|
@@ -1,23 +1,50 @@
|
|
|
1
1
|
import { PerspectiveCamera } from './PerspectiveCamera';
|
|
2
2
|
import { Camera } from './Camera';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Dual {@link PerspectiveCamera | PerspectiveCamera}s used for effects such as
|
|
6
|
+
* {@link https://en.wikipedia.org/wiki/Anaglyph_3D | 3D Anaglyph} or
|
|
7
|
+
* {@link https://en.wikipedia.org/wiki/parallax_barrier | Parallax Barrier}.
|
|
8
|
+
* @see Example: {@link https://threejs.org/examples/#webgl_effects_anaglyph | effects / anaglyph }
|
|
9
|
+
* @see Example: {@link https://threejs.org/examples/#webgl_effects_parallaxbarrier | effects / parallaxbarrier }
|
|
10
|
+
* @see Example: {@link https://threejs.org/examples/#webgl_effects_stereo | effects / stereo }
|
|
11
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/cameras/StereoCamera | Official Documentation}
|
|
12
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/cameras/StereoCamera.js | Source}
|
|
13
|
+
*/
|
|
4
14
|
export class StereoCamera extends Camera {
|
|
5
15
|
constructor();
|
|
6
16
|
|
|
7
17
|
type: 'StereoCamera';
|
|
8
18
|
|
|
9
19
|
/**
|
|
10
|
-
* @
|
|
20
|
+
* @remarks Expects a `Float`
|
|
21
|
+
* @defaultValue `1`
|
|
11
22
|
*/
|
|
12
23
|
aspect: number;
|
|
13
24
|
|
|
14
25
|
/**
|
|
15
|
-
* @
|
|
26
|
+
* @remarks Expects a `Float`
|
|
27
|
+
* @defaultValue `0.064`
|
|
16
28
|
*/
|
|
17
29
|
eyeSep: number;
|
|
18
30
|
|
|
31
|
+
/**
|
|
32
|
+
* The Left camera.
|
|
33
|
+
* A {@link PerspectiveCamera } added to {@link THREE.PerspectiveCamera.layers | layer 1}
|
|
34
|
+
* @remarks Objects to be rendered by the **left** camera must also be added to this layer.
|
|
35
|
+
*/
|
|
19
36
|
cameraL: PerspectiveCamera;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The Right camera.
|
|
40
|
+
* A {@link PerspectiveCamera } added to {@link THREE.PerspectiveCamera.layers | layer 2}
|
|
41
|
+
* @remarks Objects to be rendered by the **right** camera must also be added to this layer.
|
|
42
|
+
*/
|
|
20
43
|
cameraR: PerspectiveCamera;
|
|
21
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Update the stereo cameras based on the camera passed in.
|
|
47
|
+
* @param camera
|
|
48
|
+
*/
|
|
22
49
|
update(camera: PerspectiveCamera): void;
|
|
23
50
|
}
|