@types/three 0.154.0 → 0.155.0
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 +1 -1
- three/examples/jsm/controls/OrbitControls.d.ts +6 -0
- three/examples/jsm/csm/CSM.d.ts +5 -10
- three/examples/jsm/interactive/HTMLMesh.d.ts +2 -2
- three/examples/jsm/math/MeshSurfaceSampler.d.ts +9 -3
- three/examples/jsm/misc/RollerCoaster.d.ts +10 -5
- three/examples/jsm/nodes/loaders/NodeObjectLoader.d.ts +0 -2
- three/examples/jsm/objects/ReflectorForSSRPass.d.ts +4 -0
- three/examples/jsm/postprocessing/AfterimagePass.d.ts +2 -2
- three/examples/jsm/postprocessing/HalftonePass.d.ts +16 -2
- three/examples/jsm/postprocessing/OutputPass.d.ts +1 -4
- three/examples/jsm/postprocessing/RenderPixelatedPass.d.ts +2 -0
- three/examples/jsm/postprocessing/SSAOPass.d.ts +1 -1
- three/examples/jsm/postprocessing/SSRPass.d.ts +8 -10
- three/examples/jsm/postprocessing/TAARenderPass.d.ts +1 -1
- three/examples/jsm/postprocessing/TexturePass.d.ts +4 -4
- three/examples/jsm/utils/BufferGeometryUtils.d.ts +3 -2
- three/examples/jsm/webxr/XRPlanes.d.ts +5 -0
- three/index.d.ts +1 -1
- three/package.json +2 -2
- three/src/Three.d.ts +1 -0
- three/src/core/BufferAttribute.d.ts +14 -4
- three/src/core/RenderTarget.d.ts +78 -0
- three/src/extras/core/ShapePath.d.ts +2 -3
- three/src/helpers/BoxHelper.d.ts +5 -3
- three/src/loaders/ObjectLoader.d.ts +7 -7
- three/src/materials/Material.d.ts +5 -5
- three/src/objects/Group.d.ts +1 -1
- three/src/renderers/WebGLRenderTarget.d.ts +5 -72
- three/src/renderers/WebGLRenderer.d.ts +13 -10
- three/src/renderers/webgl/WebGLAttributes.d.ts +8 -6
- three/src/renderers/webgl/WebGLCapabilities.d.ts +1 -0
- three/src/renderers/webgl/WebGLState.d.ts +2 -13
three/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for three (https://threejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Mon, 31 Jul 2023 18:32:45 GMT
|
|
12
12
|
* Dependencies: [@types/fflate](https://npmjs.com/package/@types/fflate), [@types/lil-gui](https://npmjs.com/package/@types/lil-gui), [@types/meshoptimizer](https://npmjs.com/package/@types/meshoptimizer), [@types/stats.js](https://npmjs.com/package/@types/stats.js), [@types/tweenjs__tween.js](https://npmjs.com/package/@types/tweenjs__tween.js), [@types/webxr](https://npmjs.com/package/@types/webxr)
|
|
13
13
|
* Global values: `THREE`
|
|
14
14
|
|
|
@@ -122,6 +122,12 @@ export class OrbitControls {
|
|
|
122
122
|
*/
|
|
123
123
|
zoomSpeed: number;
|
|
124
124
|
|
|
125
|
+
/**
|
|
126
|
+
* Setting this property to `true` allows to zoom to the cursor's position.
|
|
127
|
+
* @default false
|
|
128
|
+
*/
|
|
129
|
+
zoomToCursor: boolean;
|
|
130
|
+
|
|
125
131
|
/**
|
|
126
132
|
* Enable or disable horizontal and
|
|
127
133
|
* vertical rotation of the camera.
|
three/examples/jsm/csm/CSM.d.ts
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import { Camera, Vector3, DirectionalLight, Material, Vector2, Object3D } from '../../../src/Three.js';
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
practical = 'practical',
|
|
5
|
-
uniform = 'uniform',
|
|
6
|
-
logarithmic = 'logarithmic',
|
|
7
|
-
custom = 'custom',
|
|
8
|
-
}
|
|
3
|
+
export type CSMMode = 'uniform' | 'logarithmic' | 'practical' | 'custom';
|
|
9
4
|
|
|
10
|
-
export interface
|
|
5
|
+
export interface CSMParameters {
|
|
11
6
|
camera?: Camera;
|
|
12
7
|
parent?: Object3D;
|
|
13
8
|
cascades?: number;
|
|
14
9
|
maxFar?: number;
|
|
15
|
-
mode?:
|
|
10
|
+
mode?: CSMMode;
|
|
16
11
|
shadowMapSize?: number;
|
|
17
12
|
shadowBias?: number;
|
|
18
13
|
lightDirection?: Vector3;
|
|
@@ -24,12 +19,12 @@ export interface CMSParameters {
|
|
|
24
19
|
}
|
|
25
20
|
|
|
26
21
|
export class CSM {
|
|
27
|
-
constructor(data:
|
|
22
|
+
constructor(data: CSMParameters);
|
|
28
23
|
camera: Camera;
|
|
29
24
|
parent: Object3D;
|
|
30
25
|
cascades: number;
|
|
31
26
|
maxFar: number;
|
|
32
|
-
mode:
|
|
27
|
+
mode: CSMMode;
|
|
33
28
|
shadowMapSize: number;
|
|
34
29
|
shadowBias: number;
|
|
35
30
|
lightDirection: Vector3;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BufferGeometry, Color, Mesh, Vector3 } from '../../../src/Three.js';
|
|
1
|
+
import { BufferGeometry, Color, Mesh, Vector2, Vector3 } from '../../../src/Three.js';
|
|
2
2
|
|
|
3
3
|
export class MeshSurfaceSampler {
|
|
4
4
|
distribution: Float32Array | null;
|
|
@@ -9,7 +9,13 @@ export class MeshSurfaceSampler {
|
|
|
9
9
|
constructor(mesh: Mesh);
|
|
10
10
|
binarySearch(x: number): number;
|
|
11
11
|
build(): this;
|
|
12
|
-
sample(targetPosition: Vector3, targetNormal?: Vector3, targetColor?: Color): this;
|
|
13
|
-
sampleFace(
|
|
12
|
+
sample(targetPosition: Vector3, targetNormal?: Vector3, targetColor?: Color, targetUV?: Vector2): this;
|
|
13
|
+
sampleFace(
|
|
14
|
+
faceIndex: number,
|
|
15
|
+
targetPosition: Vector3,
|
|
16
|
+
targetNormal?: Vector3,
|
|
17
|
+
targetColor?: Color,
|
|
18
|
+
targetUV?: Vector2,
|
|
19
|
+
): this;
|
|
14
20
|
setWeightAttribute(name: string | null): this;
|
|
15
21
|
}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
import { BufferGeometry,
|
|
1
|
+
import { BufferGeometry, Mesh, Vector3 } from '../../../src/Three.js';
|
|
2
|
+
|
|
3
|
+
interface Curve {
|
|
4
|
+
getPointAt(u: number): Vector3;
|
|
5
|
+
getTangentAt(u: number): Vector3;
|
|
6
|
+
}
|
|
2
7
|
|
|
3
8
|
export class RollerCoasterGeometry extends BufferGeometry {
|
|
4
|
-
constructor(curve: Curve
|
|
9
|
+
constructor(curve: Curve, divisions: number);
|
|
5
10
|
}
|
|
6
11
|
|
|
7
12
|
export class RollerCoasterLiftersGeometry extends BufferGeometry {
|
|
8
|
-
constructor(curve: Curve
|
|
13
|
+
constructor(curve: Curve, divisions: number);
|
|
9
14
|
}
|
|
10
15
|
|
|
11
16
|
export class RollerCoasterShadowGeometry extends BufferGeometry {
|
|
12
|
-
constructor(curve: Curve
|
|
17
|
+
constructor(curve: Curve, divisions: number);
|
|
13
18
|
}
|
|
14
19
|
|
|
15
20
|
export class SkyGeometry extends BufferGeometry {
|
|
16
|
-
constructor(
|
|
21
|
+
constructor();
|
|
17
22
|
}
|
|
18
23
|
|
|
19
24
|
export class TreesGeometry extends BufferGeometry {
|
|
@@ -5,7 +5,5 @@ import { AnyJson } from '../core/constants.js';
|
|
|
5
5
|
export default class NodeObjectLoader extends ObjectLoader {
|
|
6
6
|
parseNodes(json: AnyJson, textures: { [key: string]: Texture }): NodeLoaderResult;
|
|
7
7
|
|
|
8
|
-
// tslint:disable-next-line:comment-format
|
|
9
|
-
//@ts-expect-error
|
|
10
8
|
parseMaterials(json: AnyJson, textures: { [key: string]: Texture }): { [key: string]: Material };
|
|
11
9
|
}
|
|
@@ -7,6 +7,8 @@ import {
|
|
|
7
7
|
Scene,
|
|
8
8
|
Camera,
|
|
9
9
|
IUniform,
|
|
10
|
+
Color,
|
|
11
|
+
Vector2,
|
|
10
12
|
} from '../../../src/Three.js';
|
|
11
13
|
|
|
12
14
|
export interface ReflectorShader {
|
|
@@ -39,6 +41,8 @@ export class ReflectorForSSRPass<TGeometry extends BufferGeometry = BufferGeomet
|
|
|
39
41
|
needsUpdate: boolean;
|
|
40
42
|
maxDistance: number;
|
|
41
43
|
opacity: number;
|
|
44
|
+
color: Color;
|
|
45
|
+
resolution: Vector2;
|
|
42
46
|
|
|
43
47
|
get distanceAttenuation(): boolean;
|
|
44
48
|
set distanceAttenuation(val: boolean);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { WebGLRenderTarget, ShaderMaterial } from '../../../src/Three.js';
|
|
1
|
+
import { WebGLRenderTarget, ShaderMaterial, IUniform } from '../../../src/Three.js';
|
|
2
2
|
|
|
3
3
|
import { Pass, FullScreenQuad } from './Pass.js';
|
|
4
4
|
|
|
5
5
|
export class AfterimagePass extends Pass {
|
|
6
6
|
constructor(damp?: number);
|
|
7
7
|
shader: object;
|
|
8
|
-
uniforms:
|
|
8
|
+
uniforms: Record<string, IUniform>;
|
|
9
9
|
textureComp: WebGLRenderTarget;
|
|
10
10
|
textureOld: WebGLRenderTarget;
|
|
11
11
|
shaderMaterial: ShaderMaterial;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ShaderMaterial } from '../../../src/Three.js';
|
|
1
|
+
import { IUniform, ShaderMaterial } from '../../../src/Three.js';
|
|
2
2
|
|
|
3
3
|
import { Pass, FullScreenQuad } from './Pass.js';
|
|
4
4
|
|
|
@@ -17,7 +17,21 @@ export interface HalftonePassParameters {
|
|
|
17
17
|
|
|
18
18
|
export class HalftonePass extends Pass {
|
|
19
19
|
constructor(width: number, height: number, params: HalftonePassParameters);
|
|
20
|
-
uniforms:
|
|
20
|
+
uniforms: {
|
|
21
|
+
tDiffuse: IUniform;
|
|
22
|
+
shape: IUniform<number>;
|
|
23
|
+
radius: IUniform<number>;
|
|
24
|
+
rotateR: IUniform<number>;
|
|
25
|
+
rotateG: IUniform<number>;
|
|
26
|
+
rotateB: IUniform<number>;
|
|
27
|
+
scatter: IUniform<number>;
|
|
28
|
+
width: IUniform<number>;
|
|
29
|
+
height: IUniform<number>;
|
|
30
|
+
blending: IUniform<number>;
|
|
31
|
+
blendingMode: IUniform<number>;
|
|
32
|
+
greyscale: IUniform<boolean>;
|
|
33
|
+
disable: IUniform<boolean>;
|
|
34
|
+
};
|
|
21
35
|
material: ShaderMaterial;
|
|
22
36
|
fsQuad: FullScreenQuad;
|
|
23
37
|
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { ShaderMaterial } from '../../../src/Three.js';
|
|
2
|
-
import { ToneMapping } from '../../../src/constants.js';
|
|
3
2
|
|
|
4
3
|
import { Pass, FullScreenQuad } from './Pass.js';
|
|
5
4
|
|
|
6
5
|
export class OutputPass extends Pass {
|
|
7
|
-
constructor(
|
|
6
|
+
constructor();
|
|
8
7
|
uniforms: object;
|
|
9
8
|
material: ShaderMaterial;
|
|
10
9
|
fsQuad: FullScreenQuad;
|
|
11
|
-
toneMapping: ToneMapping;
|
|
12
|
-
toneMappingExposure: number;
|
|
13
10
|
}
|
|
@@ -43,19 +43,17 @@ export class SSRPass extends Pass {
|
|
|
43
43
|
get selects(): Mesh[] | null;
|
|
44
44
|
set selects(val: Mesh[] | null);
|
|
45
45
|
selective: boolean;
|
|
46
|
-
get
|
|
47
|
-
set
|
|
46
|
+
get bouncing(): boolean;
|
|
47
|
+
set bouncing(val: boolean);
|
|
48
48
|
|
|
49
49
|
blur: boolean;
|
|
50
50
|
|
|
51
|
-
get
|
|
52
|
-
set
|
|
53
|
-
get
|
|
54
|
-
set
|
|
55
|
-
get
|
|
56
|
-
set
|
|
57
|
-
|
|
58
|
-
thickTolerance: number;
|
|
51
|
+
get distanceAttenuation(): boolean;
|
|
52
|
+
set distanceAttenuation(val: boolean);
|
|
53
|
+
get fresnel(): boolean;
|
|
54
|
+
set fresnel(val: boolean);
|
|
55
|
+
get infiniteThick(): boolean;
|
|
56
|
+
set infiniteThick(val: boolean);
|
|
59
57
|
|
|
60
58
|
beautyRenderTarget: WebGLRenderTarget;
|
|
61
59
|
prevRenderTarget: WebGLRenderTarget;
|
|
@@ -3,6 +3,6 @@ import { Scene, Camera, ColorRepresentation } from '../../../src/Three.js';
|
|
|
3
3
|
import { SSAARenderPass } from './SSAARenderPass.js';
|
|
4
4
|
|
|
5
5
|
export class TAARenderPass extends SSAARenderPass {
|
|
6
|
-
constructor(scene: Scene, camera: Camera, clearColor
|
|
6
|
+
constructor(scene: Scene, camera: Camera, clearColor?: ColorRepresentation, clearAlpha?: number);
|
|
7
7
|
accumulate: boolean;
|
|
8
8
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Texture, ShaderMaterial } from '../../../src/Three.js';
|
|
1
|
+
import { Texture, ShaderMaterial, IUniform } from '../../../src/Three.js';
|
|
2
2
|
|
|
3
3
|
import { Pass, FullScreenQuad } from './Pass.js';
|
|
4
4
|
|
|
5
5
|
export class TexturePass extends Pass {
|
|
6
|
-
constructor(map
|
|
7
|
-
map: Texture;
|
|
6
|
+
constructor(map?: Texture, opacity?: number);
|
|
7
|
+
map: Texture | undefined;
|
|
8
8
|
opacity: number;
|
|
9
|
-
uniforms:
|
|
9
|
+
uniforms: Record<string, IUniform>;
|
|
10
10
|
material: ShaderMaterial;
|
|
11
11
|
fsQuad: FullScreenQuad;
|
|
12
12
|
}
|
|
@@ -28,10 +28,11 @@ export function deinterleaveAttribute(geometry: BufferGeometry): void;
|
|
|
28
28
|
export function deinterleaveGeometry(geometry: BufferGeometry): void;
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* Modifies the supplied geometry if it is non-indexed, otherwise creates a new, non-indexed geometry. Returns the
|
|
32
|
+
* geometry with smooth normals everywhere except faces that meet at an angle greater than the crease angle.
|
|
32
33
|
*
|
|
33
34
|
* @param geometry The input geometry.
|
|
34
|
-
* @param creaseAngle The crease angle.
|
|
35
|
+
* @param creaseAngle The crease angle in radians.
|
|
35
36
|
*/
|
|
36
37
|
export function toCreasedNormals(geometry: BufferGeometry, creaseAngle?: number): BufferGeometry;
|
|
37
38
|
|
three/index.d.ts
CHANGED
three/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/three",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.155.0",
|
|
4
4
|
"description": "TypeScript definitions for three",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"lil-gui": "~0.17.0",
|
|
33
33
|
"meshoptimizer": "~0.18.1"
|
|
34
34
|
},
|
|
35
|
-
"typesPublisherContentHash": "
|
|
35
|
+
"typesPublisherContentHash": "c1fbe1c79de7796b7bff881189bb5495cc06e1512544408b367ce229d7ef1702",
|
|
36
36
|
"typeScriptVersion": "4.4",
|
|
37
37
|
"exports": {
|
|
38
38
|
".": {
|
three/src/Three.d.ts
CHANGED
|
@@ -114,11 +114,11 @@ export class BufferAttribute {
|
|
|
114
114
|
normalized: boolean;
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
|
-
*
|
|
118
|
-
* @
|
|
119
|
-
*
|
|
117
|
+
* Represents the number of items this buffer attribute stores. It is internally computed by dividing the
|
|
118
|
+
* {@link BufferAttribute.array | array}'s length by the {@link BufferAttribute.itemSize | itemSize}. Read-only
|
|
119
|
+
* property.
|
|
120
120
|
*/
|
|
121
|
-
count: number;
|
|
121
|
+
readonly count: number;
|
|
122
122
|
|
|
123
123
|
/**
|
|
124
124
|
* Flag to indicate that this attribute has changed and should be re-sent to the GPU.
|
|
@@ -217,6 +217,16 @@ export class BufferAttribute {
|
|
|
217
217
|
*/
|
|
218
218
|
set(value: ArrayLike<number> | ArrayBufferView, offset?: number): this;
|
|
219
219
|
|
|
220
|
+
/**
|
|
221
|
+
* Returns the given component of the vector at the given index.
|
|
222
|
+
*/
|
|
223
|
+
getComponent(index: number, component: number): number;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Sets the given component of the vector at the given index.
|
|
227
|
+
*/
|
|
228
|
+
setComponent(index: number, component: number, value: number): void;
|
|
229
|
+
|
|
220
230
|
/**
|
|
221
231
|
* Returns the x component of the vector at the given index.
|
|
222
232
|
* @param index Expects a `Integer`
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Vector4 } from '../math/Vector4.js';
|
|
2
|
+
import { Texture } from '../textures/Texture.js';
|
|
3
|
+
import { DepthTexture } from '../textures/DepthTexture.js';
|
|
4
|
+
import { EventDispatcher } from './EventDispatcher.js';
|
|
5
|
+
import {
|
|
6
|
+
Wrapping,
|
|
7
|
+
TextureDataType,
|
|
8
|
+
TextureEncoding,
|
|
9
|
+
MinificationTextureFilter,
|
|
10
|
+
MagnificationTextureFilter,
|
|
11
|
+
ColorSpace,
|
|
12
|
+
} from '../constants.js';
|
|
13
|
+
|
|
14
|
+
export interface RenderTargetOptions {
|
|
15
|
+
wrapS?: Wrapping | undefined;
|
|
16
|
+
wrapT?: Wrapping | undefined;
|
|
17
|
+
magFilter?: MagnificationTextureFilter | undefined;
|
|
18
|
+
minFilter?: MinificationTextureFilter | undefined;
|
|
19
|
+
generateMipmaps?: boolean | undefined; // true;
|
|
20
|
+
format?: number | undefined; // RGBAFormat;
|
|
21
|
+
type?: TextureDataType | undefined; // UnsignedByteType;
|
|
22
|
+
anisotropy?: number | undefined; // 1;
|
|
23
|
+
colorSpace?: ColorSpace | undefined;
|
|
24
|
+
depthBuffer?: boolean | undefined; // true;
|
|
25
|
+
stencilBuffer?: boolean | undefined; // false;
|
|
26
|
+
depthTexture?: DepthTexture | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Defines the count of MSAA samples. Can only be used with WebGL 2. Default is **0**.
|
|
29
|
+
* @default 0
|
|
30
|
+
*/
|
|
31
|
+
samples?: number;
|
|
32
|
+
/** @deprecated Use 'colorSpace' in three.js r152+. */
|
|
33
|
+
encoding?: TextureEncoding | undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export class RenderTarget<TTexture extends Texture | Texture[] = Texture> extends EventDispatcher {
|
|
37
|
+
constructor(width?: number, height?: number, options?: RenderTargetOptions);
|
|
38
|
+
|
|
39
|
+
readonly isRenderTarget: true;
|
|
40
|
+
|
|
41
|
+
width: number;
|
|
42
|
+
height: number;
|
|
43
|
+
depth: number;
|
|
44
|
+
|
|
45
|
+
scissor: Vector4;
|
|
46
|
+
/**
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
scissorTest: boolean;
|
|
50
|
+
viewport: Vector4;
|
|
51
|
+
texture: TTexture;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @default true
|
|
55
|
+
*/
|
|
56
|
+
depthBuffer: boolean;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
stencilBuffer: boolean;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @default null
|
|
65
|
+
*/
|
|
66
|
+
depthTexture: DepthTexture;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Defines the count of MSAA samples. Can only be used with WebGL 2. Default is **0**.
|
|
70
|
+
* @default 0
|
|
71
|
+
*/
|
|
72
|
+
samples: number;
|
|
73
|
+
|
|
74
|
+
setSize(width: number, height: number, depth?: number): void;
|
|
75
|
+
clone(): this;
|
|
76
|
+
copy(source: RenderTarget): this;
|
|
77
|
+
dispose(): void;
|
|
78
|
+
}
|
|
@@ -5,9 +5,8 @@ import { Path } from './Path.js';
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* This class is used to convert a series of shapes to an array of {@link THREE.Path | Path's},
|
|
8
|
-
* for example an SVG shape to a path
|
|
9
|
-
* @see
|
|
10
|
-
* @see {@link https://threejs.org/docs/index.html#api/en/extras/core/ShapePath | Official Documentation}
|
|
8
|
+
* for example an SVG shape to a path.
|
|
9
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/extras/core/ShapePath | Official Documentation}
|
|
11
10
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/core/ShapePath.js | Source}
|
|
12
11
|
*/
|
|
13
12
|
export class ShapePath {
|
three/src/helpers/BoxHelper.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ColorRepresentation } from '../math/Color.js';
|
|
2
|
-
import { Object3D } from '
|
|
3
|
-
import { LineSegments } from '
|
|
2
|
+
import { Object3D } from '../core/Object3D.js';
|
|
3
|
+
import { LineSegments } from '../objects/LineSegments.js';
|
|
4
|
+
import { BufferGeometry } from '../core/BufferGeometry.js';
|
|
5
|
+
import { LineBasicMaterial } from '../materials/LineBasicMaterial.js';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* Helper object to graphically show the world-axis-aligned bounding box around an object
|
|
@@ -21,7 +23,7 @@ import { LineSegments } from './../objects/LineSegments.js';
|
|
|
21
23
|
* @see {@link https://threejs.org/docs/index.html#api/en/helpers/BoxHelper | Official Documentation}
|
|
22
24
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/BoxHelper.js | Source}
|
|
23
25
|
*/
|
|
24
|
-
export class BoxHelper extends LineSegments {
|
|
26
|
+
export class BoxHelper extends LineSegments<BufferGeometry, LineBasicMaterial> {
|
|
25
27
|
/**
|
|
26
28
|
* Creates a new wireframe box that bounds the passed object
|
|
27
29
|
* @remarks
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Loader } from './Loader.js';
|
|
2
2
|
import { LoadingManager } from './LoadingManager.js';
|
|
3
|
-
import { Object3D } from '
|
|
4
|
-
import { Texture } from '
|
|
5
|
-
import { Material } from '
|
|
6
|
-
import { AnimationClip } from '
|
|
3
|
+
import { Object3D } from '../core/Object3D.js';
|
|
4
|
+
import { Texture } from '../textures/Texture.js';
|
|
5
|
+
import { Material } from '../materials/Material.js';
|
|
6
|
+
import { AnimationClip } from '../animation/AnimationClip.js';
|
|
7
7
|
import { InstancedBufferGeometry } from '../core/InstancedBufferGeometry.js';
|
|
8
8
|
import { BufferGeometry } from '../core/BufferGeometry.js';
|
|
9
9
|
import { Source } from '../textures/Source.js';
|
|
@@ -26,12 +26,12 @@ export class ObjectLoader extends Loader {
|
|
|
26
26
|
parse<T extends Object3D>(json: any, onLoad?: (object: Object3D) => void): T;
|
|
27
27
|
// tslint:disable-next-line:no-unnecessary-generics
|
|
28
28
|
parseAsync<T extends Object3D>(json: any): Promise<T>;
|
|
29
|
-
parseGeometries(json: any): { [key: string]: InstancedBufferGeometry | BufferGeometry };
|
|
30
|
-
parseMaterials(json: any, textures: { [key: string]: Texture }):
|
|
29
|
+
parseGeometries(json: any): { [key: string]: InstancedBufferGeometry | BufferGeometry };
|
|
30
|
+
parseMaterials(json: any, textures: { [key: string]: Texture }): { [key: string]: Material };
|
|
31
31
|
parseAnimations(json: any): AnimationClip[];
|
|
32
32
|
parseImages(json: any, onLoad?: () => void): { [key: string]: Source };
|
|
33
33
|
parseImagesAsync(json: any): Promise<{ [key: string]: Source }>;
|
|
34
|
-
parseTextures(json: any, images:
|
|
34
|
+
parseTextures(json: any, images: { [key: string]: Source }): { [key: string]: Texture };
|
|
35
35
|
parseObject<T extends Object3D>(
|
|
36
36
|
data: any,
|
|
37
37
|
geometries: any[],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Plane } from '
|
|
2
|
-
import { EventDispatcher } from '
|
|
3
|
-
import { WebGLRenderer } from '
|
|
4
|
-
import { Shader } from '
|
|
1
|
+
import { Plane } from '../math/Plane.js';
|
|
2
|
+
import { EventDispatcher } from '../core/EventDispatcher.js';
|
|
3
|
+
import { WebGLRenderer } from '../renderers/WebGLRenderer.js';
|
|
4
|
+
import { Shader } from '../renderers/shaders/ShaderLib.js';
|
|
5
5
|
import {
|
|
6
6
|
BlendingDstFactor,
|
|
7
7
|
BlendingEquation,
|
|
@@ -135,7 +135,7 @@ export class Material extends EventDispatcher {
|
|
|
135
135
|
* See the WebGL / clipping /intersection example. Default is null.
|
|
136
136
|
* @default null
|
|
137
137
|
*/
|
|
138
|
-
clippingPlanes:
|
|
138
|
+
clippingPlanes: Plane[];
|
|
139
139
|
|
|
140
140
|
/**
|
|
141
141
|
* Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
|
three/src/objects/Group.d.ts
CHANGED
|
@@ -1,78 +1,11 @@
|
|
|
1
|
-
import { Vector4 } from '../math/Vector4.js';
|
|
2
1
|
import { Texture } from '../textures/Texture.js';
|
|
3
|
-
import {
|
|
4
|
-
import { EventDispatcher } from '../core/EventDispatcher.js';
|
|
5
|
-
import {
|
|
6
|
-
Wrapping,
|
|
7
|
-
TextureDataType,
|
|
8
|
-
TextureEncoding,
|
|
9
|
-
MinificationTextureFilter,
|
|
10
|
-
MagnificationTextureFilter,
|
|
11
|
-
ColorSpace,
|
|
12
|
-
} from '../constants.js';
|
|
2
|
+
import { RenderTarget, RenderTargetOptions } from '../core/RenderTarget.js';
|
|
13
3
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
wrapT?: Wrapping | undefined;
|
|
17
|
-
magFilter?: MagnificationTextureFilter | undefined;
|
|
18
|
-
minFilter?: MinificationTextureFilter | undefined;
|
|
19
|
-
generateMipmaps?: boolean | undefined; // true;
|
|
20
|
-
format?: number | undefined; // RGBAFormat;
|
|
21
|
-
type?: TextureDataType | undefined; // UnsignedByteType;
|
|
22
|
-
anisotropy?: number | undefined; // 1;
|
|
23
|
-
colorSpace?: ColorSpace | undefined;
|
|
24
|
-
depthBuffer?: boolean | undefined; // true;
|
|
25
|
-
stencilBuffer?: boolean | undefined; // false;
|
|
26
|
-
depthTexture?: DepthTexture | undefined;
|
|
27
|
-
/**
|
|
28
|
-
* Defines the count of MSAA samples. Can only be used with WebGL 2. Default is **0**.
|
|
29
|
-
* @default 0
|
|
30
|
-
*/
|
|
31
|
-
samples?: number;
|
|
32
|
-
/** @deprecated Use 'colorSpace' in three.js r152+. */
|
|
33
|
-
encoding?: TextureEncoding | undefined;
|
|
34
|
-
}
|
|
4
|
+
// tslint:disable-next-line:no-empty-interface
|
|
5
|
+
export interface WebGLRenderTargetOptions extends RenderTargetOptions {}
|
|
35
6
|
|
|
36
|
-
export class WebGLRenderTarget<TTexture extends Texture | Texture[] = Texture> extends
|
|
37
|
-
constructor(width?: number, height?: number, options?:
|
|
7
|
+
export class WebGLRenderTarget<TTexture extends Texture | Texture[] = Texture> extends RenderTarget<TTexture> {
|
|
8
|
+
constructor(width?: number, height?: number, options?: RenderTargetOptions);
|
|
38
9
|
|
|
39
10
|
readonly isWebGLRenderTarget: true;
|
|
40
|
-
|
|
41
|
-
width: number;
|
|
42
|
-
height: number;
|
|
43
|
-
depth: number;
|
|
44
|
-
|
|
45
|
-
scissor: Vector4;
|
|
46
|
-
/**
|
|
47
|
-
* @default false
|
|
48
|
-
*/
|
|
49
|
-
scissorTest: boolean;
|
|
50
|
-
viewport: Vector4;
|
|
51
|
-
texture: TTexture;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* @default true
|
|
55
|
-
*/
|
|
56
|
-
depthBuffer: boolean;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* @default true
|
|
60
|
-
*/
|
|
61
|
-
stencilBuffer: boolean;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* @default null
|
|
65
|
-
*/
|
|
66
|
-
depthTexture: DepthTexture;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Defines the count of MSAA samples. Can only be used with WebGL 2. Default is **0**.
|
|
70
|
-
* @default 0
|
|
71
|
-
*/
|
|
72
|
-
samples: number;
|
|
73
|
-
|
|
74
|
-
setSize(width: number, height: number, depth?: number): void;
|
|
75
|
-
clone(): this;
|
|
76
|
-
copy(source: WebGLRenderTarget): this;
|
|
77
|
-
dispose(): void;
|
|
78
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Scene } from '
|
|
2
|
-
import { Camera } from '
|
|
1
|
+
import { Scene } from '../scenes/Scene.js';
|
|
2
|
+
import { Camera } from '../cameras/Camera.js';
|
|
3
3
|
import { WebGLExtensions } from './webgl/WebGLExtensions.js';
|
|
4
4
|
import { WebGLInfo } from './webgl/WebGLInfo.js';
|
|
5
5
|
import { WebGLShadowMap } from './webgl/WebGLShadowMap.js';
|
|
@@ -7,13 +7,13 @@ import { WebGLCapabilities } from './webgl/WebGLCapabilities.js';
|
|
|
7
7
|
import { WebGLProperties } from './webgl/WebGLProperties.js';
|
|
8
8
|
import { WebGLRenderLists } from './webgl/WebGLRenderLists.js';
|
|
9
9
|
import { WebGLState } from './webgl/WebGLState.js';
|
|
10
|
-
import { Vector2 } from '
|
|
11
|
-
import { Vector4 } from '
|
|
12
|
-
import { Color, ColorRepresentation } from '
|
|
10
|
+
import { Vector2 } from '../math/Vector2.js';
|
|
11
|
+
import { Vector4 } from '../math/Vector4.js';
|
|
12
|
+
import { Color, ColorRepresentation } from '../math/Color.js';
|
|
13
13
|
import { WebGLRenderTarget } from './WebGLRenderTarget.js';
|
|
14
14
|
import { WebGLMultipleRenderTargets } from './WebGLMultipleRenderTargets.js';
|
|
15
|
-
import { Object3D } from '
|
|
16
|
-
import { Material } from '
|
|
15
|
+
import { Object3D } from '../core/Object3D.js';
|
|
16
|
+
import { Material } from '../materials/Material.js';
|
|
17
17
|
import {
|
|
18
18
|
ToneMapping,
|
|
19
19
|
ShadowMapType,
|
|
@@ -22,14 +22,15 @@ import {
|
|
|
22
22
|
ColorSpace,
|
|
23
23
|
WebGLCoordinateSystem,
|
|
24
24
|
} from '../constants.js';
|
|
25
|
-
import { WebXRManager } from '
|
|
26
|
-
import { BufferGeometry } from '
|
|
25
|
+
import { WebXRManager } from './webxr/WebXRManager.js';
|
|
26
|
+
import { BufferGeometry } from '../core/BufferGeometry.js';
|
|
27
27
|
import { OffscreenCanvas, Texture } from '../textures/Texture.js';
|
|
28
28
|
import { Data3DTexture } from '../textures/Data3DTexture.js';
|
|
29
29
|
import { Vector3 } from '../math/Vector3.js';
|
|
30
30
|
import { Box3 } from '../math/Box3.js';
|
|
31
31
|
import { DataArrayTexture } from '../textures/DataArrayTexture.js';
|
|
32
32
|
import { WebGLProgram } from './webgl/WebGLProgram.js';
|
|
33
|
+
import { Plane } from '../math/Plane.js';
|
|
33
34
|
|
|
34
35
|
export interface Renderer {
|
|
35
36
|
domElement: HTMLCanvasElement;
|
|
@@ -184,7 +185,7 @@ export class WebGLRenderer implements Renderer {
|
|
|
184
185
|
/**
|
|
185
186
|
* @default []
|
|
186
187
|
*/
|
|
187
|
-
clippingPlanes:
|
|
188
|
+
clippingPlanes: readonly Plane[];
|
|
188
189
|
|
|
189
190
|
/**
|
|
190
191
|
* @default false
|
|
@@ -210,6 +211,8 @@ export class WebGLRenderer implements Renderer {
|
|
|
210
211
|
get coordinateSystem(): typeof WebGLCoordinateSystem;
|
|
211
212
|
|
|
212
213
|
/**
|
|
214
|
+
* @deprecated Migrate your lighting according to the following guide:
|
|
215
|
+
* https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733.
|
|
213
216
|
* @default true
|
|
214
217
|
*/
|
|
215
218
|
useLegacyLights: boolean;
|
|
@@ -6,12 +6,14 @@ import { GLBufferAttribute } from '../../core/GLBufferAttribute.js';
|
|
|
6
6
|
export class WebGLAttributes {
|
|
7
7
|
constructor(gl: WebGLRenderingContext | WebGL2RenderingContext, capabilities: WebGLCapabilities);
|
|
8
8
|
|
|
9
|
-
get(attribute: BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute):
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
get(attribute: BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute):
|
|
10
|
+
| {
|
|
11
|
+
buffer: WebGLBuffer;
|
|
12
|
+
type: number;
|
|
13
|
+
bytesPerElement: number;
|
|
14
|
+
version: number;
|
|
15
|
+
}
|
|
16
|
+
| undefined;
|
|
15
17
|
|
|
16
18
|
remove(attribute: BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute): void;
|
|
17
19
|
|
|
@@ -7,6 +7,7 @@ export class WebGLCapabilities {
|
|
|
7
7
|
constructor(gl: WebGLRenderingContext, extensions: any, parameters: WebGLCapabilitiesParameters);
|
|
8
8
|
|
|
9
9
|
readonly isWebGL2: boolean;
|
|
10
|
+
readonly drawBuffers: boolean;
|
|
10
11
|
precision: string;
|
|
11
12
|
logarithmicDepthBuffer: boolean;
|
|
12
13
|
maxTextures: number;
|
|
@@ -10,6 +10,7 @@ import { WebGLCapabilities } from './WebGLCapabilities.js';
|
|
|
10
10
|
import { WebGLExtensions } from './WebGLExtensions.js';
|
|
11
11
|
import { Material } from '../../materials/Material.js';
|
|
12
12
|
import { Vector4 } from '../../math/Vector4.js';
|
|
13
|
+
import { WebGLRenderTarget } from '../WebGLRenderTarget.js';
|
|
13
14
|
|
|
14
15
|
export class WebGLColorBuffer {
|
|
15
16
|
constructor();
|
|
@@ -52,22 +53,10 @@ export class WebGLState {
|
|
|
52
53
|
stencil: WebGLStencilBuffer;
|
|
53
54
|
};
|
|
54
55
|
|
|
55
|
-
initAttributes(): void;
|
|
56
|
-
enableAttribute(attribute: number): void;
|
|
57
|
-
enableAttributeAndDivisor(attribute: number, meshPerAttribute: number): void;
|
|
58
|
-
disableUnusedAttributes(): void;
|
|
59
|
-
vertexAttribPointer(
|
|
60
|
-
index: number,
|
|
61
|
-
size: number,
|
|
62
|
-
type: number,
|
|
63
|
-
normalized: boolean,
|
|
64
|
-
stride: number,
|
|
65
|
-
offset: number,
|
|
66
|
-
): void;
|
|
67
56
|
enable(id: number): void;
|
|
68
57
|
disable(id: number): void;
|
|
69
58
|
bindFramebuffer(target: number, framebuffer: WebGLFramebuffer | null): void;
|
|
70
|
-
|
|
59
|
+
drawBuffers(renderTarget: WebGLRenderTarget | null, framebuffer: WebGLFramebuffer | null): void;
|
|
71
60
|
useProgram(program: any): boolean;
|
|
72
61
|
setBlending(
|
|
73
62
|
blending: Blending,
|