@types/three 0.134.0 → 0.137.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/ArcballControls.d.ts +0 -2
- three/examples/jsm/controls/DragControls.d.ts +2 -1
- three/examples/jsm/controls/OrbitControls.d.ts +4 -0
- three/examples/jsm/controls/TransformControls.d.ts +1 -0
- three/examples/jsm/csm/CSM.d.ts +47 -22
- three/examples/jsm/csm/CSMFrustum.d.ts +19 -0
- three/examples/jsm/csm/CSMHelper.d.ts +20 -7
- three/examples/jsm/csm/CSMShader.d.ts +4 -0
- three/examples/jsm/exporters/GLTFExporter.d.ts +1 -0
- three/examples/jsm/geometries/ConvexGeometry.d.ts +1 -1
- three/examples/jsm/loaders/GLTFLoader.d.ts +2 -0
- three/examples/jsm/loaders/LDrawLoader.d.ts +6 -0
- three/examples/jsm/loaders/LogLuvLoader.d.ts +19 -0
- three/examples/jsm/loaders/RGBMLoader.d.ts +10 -10
- three/examples/jsm/math/OBB.d.ts +1 -1
- three/examples/jsm/nodes/utils/ColorSpaceNode.d.ts +1 -1
- three/examples/jsm/objects/Reflector.d.ts +2 -0
- three/examples/jsm/objects/Refractor.d.ts +2 -0
- three/examples/jsm/utils/LDrawUtils.d.ts +5 -0
- three/examples/jsm/utils/PackedPhongMaterial.d.ts +10 -0
- three/examples/jsm/utils/SceneUtils.d.ts +10 -12
- three/examples/jsm/webxr/OculusHandPointerModel.d.ts +3 -3
- three/index.d.ts +1 -1
- three/package.json +3 -3
- three/src/Three.d.ts +1 -0
- three/src/cameras/OrthographicCamera.d.ts +1 -1
- three/src/constants.d.ts +4 -21
- three/src/core/Layers.d.ts +1 -0
- three/src/core/Object3D.d.ts +40 -8
- three/src/core/Raycaster.d.ts +1 -0
- three/src/extras/ImageUtils.d.ts +2 -0
- three/src/extras/PMREMGenerator.d.ts +2 -2
- three/src/materials/Material.d.ts +5 -6
- three/src/math/Box3.d.ts +2 -2
- three/src/math/Color.d.ts +2 -22
- three/src/renderers/WebGLRenderer.d.ts +0 -5
- three/src/renderers/webgl/WebGLUtils.d.ts +3 -1
- three/src/renderers/webxr/WebXRManager.d.ts +1 -1
- three/src/textures/CubeTexture.d.ts +1 -1
- three/src/textures/FramebufferTexture.d.ts +8 -0
- three/src/textures/VideoTexture.d.ts +1 -1
- three/examples/jsm/csm/Frustum.d.ts +0 -16
- three/examples/jsm/csm/Shader.d.ts +0 -6
- three/examples/jsm/utils/RoughnessMipmapper.d.ts +0 -7
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: Thu, 27 Jan 2022 22:31:34 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: `THREE`
|
|
14
14
|
|
|
@@ -152,8 +152,6 @@ export class ArcballControls extends EventDispatcher {
|
|
|
152
152
|
|
|
153
153
|
unsetMouseAction(mouse: ArcballControlsMouseActionMouse, key?: ArcballControlsMouseActionKeys): boolean;
|
|
154
154
|
|
|
155
|
-
setTarget(x: number, y: number, z: number): void;
|
|
156
|
-
|
|
157
155
|
update(): void;
|
|
158
156
|
|
|
159
157
|
dispose(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Camera, EventDispatcher, Object3D } from '../../../src/Three';
|
|
1
|
+
import { Camera, EventDispatcher, Object3D, Raycaster } from '../../../src/Three';
|
|
2
2
|
|
|
3
3
|
export class DragControls extends EventDispatcher {
|
|
4
4
|
constructor(objects: Object3D[], camera: Camera, domElement?: HTMLElement);
|
|
@@ -14,4 +14,5 @@ export class DragControls extends EventDispatcher {
|
|
|
14
14
|
deactivate(): void;
|
|
15
15
|
dispose(): void;
|
|
16
16
|
getObjects(): Object3D[];
|
|
17
|
+
getRaycaster(): Raycaster;
|
|
17
18
|
}
|
|
@@ -47,6 +47,10 @@ export class OrbitControls {
|
|
|
47
47
|
mouseButtons: { LEFT: MOUSE; MIDDLE: MOUSE; RIGHT: MOUSE };
|
|
48
48
|
touches: { ONE: TOUCH; TWO: TOUCH };
|
|
49
49
|
|
|
50
|
+
target0: Vector3;
|
|
51
|
+
position0: Vector3;
|
|
52
|
+
zoomO: number;
|
|
53
|
+
|
|
50
54
|
update(): boolean;
|
|
51
55
|
|
|
52
56
|
listenToKeyEvents(domElement: HTMLElement): void;
|
three/examples/jsm/csm/CSM.d.ts
CHANGED
|
@@ -1,36 +1,61 @@
|
|
|
1
|
+
import { Camera, Vector3, DirectionalLight, Material, Vector2, Object3D } from '../../../src/Three';
|
|
2
|
+
|
|
3
|
+
export enum CMSMode {
|
|
4
|
+
practical = 'practical',
|
|
5
|
+
uniform = 'uniform',
|
|
6
|
+
logarithmic = 'logarithmic',
|
|
7
|
+
custom = 'custom',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface CMSParameters {
|
|
11
|
+
camera?: Camera;
|
|
12
|
+
parent?: Object3D;
|
|
13
|
+
cascades?: number;
|
|
14
|
+
maxFar?: number;
|
|
15
|
+
mode?: CMSMode;
|
|
16
|
+
shadowMapSize?: number;
|
|
17
|
+
shadowBias?: number;
|
|
18
|
+
lightDirection?: Vector3;
|
|
19
|
+
lightIntensity?: number;
|
|
20
|
+
lightNear?: number;
|
|
21
|
+
lightFar?: number;
|
|
22
|
+
lightMargin?: number;
|
|
23
|
+
customSplitsCallback?: (cascades: number, cameraNear: number, cameraFar: number, breaks: number[]) => void;
|
|
24
|
+
}
|
|
25
|
+
|
|
1
26
|
export class CSM {
|
|
2
|
-
constructor(data
|
|
3
|
-
camera:
|
|
4
|
-
parent:
|
|
5
|
-
cascades:
|
|
6
|
-
maxFar:
|
|
7
|
-
mode:
|
|
8
|
-
shadowMapSize:
|
|
9
|
-
shadowBias:
|
|
10
|
-
lightDirection:
|
|
11
|
-
lightIntensity:
|
|
12
|
-
lightNear:
|
|
13
|
-
lightFar:
|
|
14
|
-
lightMargin:
|
|
15
|
-
customSplitsCallback:
|
|
27
|
+
constructor(data?: CMSParameters);
|
|
28
|
+
camera: Camera;
|
|
29
|
+
parent: Object3D;
|
|
30
|
+
cascades: number;
|
|
31
|
+
maxFar: number;
|
|
32
|
+
mode: CMSMode;
|
|
33
|
+
shadowMapSize: number;
|
|
34
|
+
shadowBias: number;
|
|
35
|
+
lightDirection: Vector3;
|
|
36
|
+
lightIntensity: number;
|
|
37
|
+
lightNear: number;
|
|
38
|
+
lightFar: number;
|
|
39
|
+
lightMargin: number;
|
|
40
|
+
customSplitsCallback: (cascades: number, cameraNear: number, cameraFar: number, breaks: number[]) => void;
|
|
16
41
|
fade: boolean;
|
|
17
|
-
mainFrustum:
|
|
18
|
-
frustums:
|
|
19
|
-
breaks:
|
|
20
|
-
lights:
|
|
21
|
-
shaders: Map<
|
|
42
|
+
mainFrustum: CSMFrustrum;
|
|
43
|
+
frustums: CSMFrustrum[];
|
|
44
|
+
breaks: number[];
|
|
45
|
+
lights: DirectionalLight[];
|
|
46
|
+
shaders: Map<unknown, string>;
|
|
22
47
|
createLights(): void;
|
|
23
48
|
initCascades(): void;
|
|
24
49
|
updateShadowBounds(): void;
|
|
25
50
|
getBreaks(): void;
|
|
26
51
|
update(): void;
|
|
27
52
|
injectInclude(): void;
|
|
28
|
-
setupMaterial(material:
|
|
53
|
+
setupMaterial(material: Material): void;
|
|
29
54
|
updateUniforms(): void;
|
|
30
|
-
getExtendedBreaks(target:
|
|
55
|
+
getExtendedBreaks(target: Vector2[]): void;
|
|
31
56
|
updateFrustums(): void;
|
|
32
57
|
remove(): void;
|
|
33
58
|
dispose(): void;
|
|
34
59
|
}
|
|
35
60
|
|
|
36
|
-
import
|
|
61
|
+
import CSMFrustrum from './CSMFrustum.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Matrix4, Vector3 } from '../../../src/Three';
|
|
2
|
+
|
|
3
|
+
export interface CSMFrustumVerticies {
|
|
4
|
+
near: Vector3[];
|
|
5
|
+
far: Vector3[];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface CSMFrustumParameters {
|
|
9
|
+
projectionMatrix?: Matrix4;
|
|
10
|
+
maxFar?: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default class CSMFrustum {
|
|
14
|
+
constructor(data?: CSMFrustumParameters);
|
|
15
|
+
vertices: CSMFrustumVerticies;
|
|
16
|
+
setFromProjectionMatrix(projectionMatrix: Matrix4, maxFar: number): CSMFrustumVerticies;
|
|
17
|
+
split(breaks: number[], target: CSMFrustum[]): void;
|
|
18
|
+
toSpace(cameraMatrix: Matrix4, target: CSMFrustum): void;
|
|
19
|
+
}
|
|
@@ -1,13 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
Box3Helper,
|
|
3
|
+
BufferGeometry,
|
|
4
|
+
Group,
|
|
5
|
+
LineBasicMaterial,
|
|
6
|
+
LineSegments,
|
|
7
|
+
Mesh,
|
|
8
|
+
MeshBasicMaterial,
|
|
9
|
+
PlaneGeometry,
|
|
10
|
+
} from '../../../src/Three';
|
|
11
|
+
|
|
12
|
+
import { CSM } from './CSM';
|
|
13
|
+
|
|
14
|
+
export class CSMHelper<TCSM extends CSM = CSM> extends Group {
|
|
15
|
+
constructor(csm: TCSM);
|
|
16
|
+
csm: TCSM;
|
|
4
17
|
displayFrustum: boolean;
|
|
5
18
|
displayPlanes: boolean;
|
|
6
19
|
displayShadowBounds: boolean;
|
|
7
|
-
frustumLines:
|
|
8
|
-
cascadeLines:
|
|
9
|
-
cascadePlanes:
|
|
10
|
-
shadowLines:
|
|
20
|
+
frustumLines: LineSegments<BufferGeometry, LineBasicMaterial>;
|
|
21
|
+
cascadeLines: Box3Helper[];
|
|
22
|
+
cascadePlanes: Array<Mesh<PlaneGeometry, MeshBasicMaterial>>;
|
|
23
|
+
shadowLines: Box3Helper[];
|
|
11
24
|
updateVisibility(): void;
|
|
12
25
|
update(): void;
|
|
13
26
|
}
|
|
@@ -64,6 +64,8 @@ export class GLTFLoader extends Loader {
|
|
|
64
64
|
onLoad: (gltf: GLTF) => void,
|
|
65
65
|
onError?: (event: ErrorEvent) => void,
|
|
66
66
|
): void;
|
|
67
|
+
|
|
68
|
+
parseAsync(data: ArrayBuffer | string, path: string): Promise<void>;
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
export type GLTFReferenceType = 'materials' | 'nodes' | 'textures' | 'meshes';
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { Loader, LoadingManager, Group, Material } from '../../../src/Three';
|
|
2
2
|
|
|
3
3
|
export class LDrawLoader extends Loader {
|
|
4
|
+
materials: Material[];
|
|
5
|
+
materialsLibrary: Record<string, Material>;
|
|
6
|
+
fileMap: Record<string, string>;
|
|
7
|
+
smoothNormals: boolean;
|
|
8
|
+
|
|
4
9
|
constructor(manager?: LoadingManager);
|
|
5
10
|
|
|
6
11
|
load(
|
|
@@ -10,6 +15,7 @@ export class LDrawLoader extends Loader {
|
|
|
10
15
|
onError?: (event: ErrorEvent) => void,
|
|
11
16
|
): void;
|
|
12
17
|
loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise<Group>;
|
|
18
|
+
preloadMaterials(url: string): Promise<void>;
|
|
13
19
|
setFileMap(fileMap: Record<string, string>): void;
|
|
14
20
|
setMaterials(materials: Material[]): void;
|
|
15
21
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DataTextureLoader, TextureDataType, LoadingManager, PixelFormat } from '../../../src/Three';
|
|
2
|
+
|
|
3
|
+
export interface LogLuv {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
data: Uint16Array | Float32Array;
|
|
7
|
+
format: PixelFormat;
|
|
8
|
+
type: TextureDataType;
|
|
9
|
+
flipY: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export class LogLuvLoader extends DataTextureLoader {
|
|
13
|
+
type: TextureDataType;
|
|
14
|
+
constructor(manager: LoadingManager);
|
|
15
|
+
|
|
16
|
+
parse(buffer: Iterable<number>): LogLuv;
|
|
17
|
+
|
|
18
|
+
setDataType(value: TextureDataType): this;
|
|
19
|
+
}
|
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CubeTexture,
|
|
3
|
-
LoadingManager,
|
|
4
|
-
DataTextureLoader,
|
|
5
|
-
PixelFormat,
|
|
6
|
-
TextureDataType,
|
|
7
|
-
TextureEncoding,
|
|
8
|
-
} from '../../../src/Three';
|
|
1
|
+
import { CubeTexture, LoadingManager, DataTextureLoader, PixelFormat, TextureDataType } from '../../../src/Three';
|
|
9
2
|
|
|
10
3
|
export interface RGBM {
|
|
11
4
|
width: number;
|
|
12
5
|
height: number;
|
|
13
|
-
data:
|
|
6
|
+
data: Uint16Array | Float32Array;
|
|
14
7
|
header: string;
|
|
15
8
|
format: PixelFormat;
|
|
16
9
|
type: TextureDataType;
|
|
17
10
|
flipY: boolean;
|
|
18
|
-
encoding: TextureEncoding;
|
|
19
11
|
}
|
|
20
12
|
|
|
21
13
|
export class RGBMLoader extends DataTextureLoader {
|
|
14
|
+
type: TextureDataType;
|
|
15
|
+
|
|
16
|
+
maxRange: number;
|
|
17
|
+
|
|
22
18
|
constructor(manager?: LoadingManager);
|
|
23
19
|
|
|
24
20
|
loadCubemap(
|
|
@@ -29,4 +25,8 @@ export class RGBMLoader extends DataTextureLoader {
|
|
|
29
25
|
): CubeTexture;
|
|
30
26
|
|
|
31
27
|
parse(buffer: ArrayBuffer): RGBM;
|
|
28
|
+
|
|
29
|
+
setDataType(dataType: TextureDataType): this;
|
|
30
|
+
|
|
31
|
+
setMaxRange(value: number): this;
|
|
32
32
|
}
|
three/examples/jsm/math/OBB.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export class OBB {
|
|
|
14
14
|
containsPoint(point: Vector3): boolean;
|
|
15
15
|
intersectsBox3(box3: Box3): boolean;
|
|
16
16
|
intersectsSphere(sphere: Sphere): boolean;
|
|
17
|
-
intersectsOBB(obb: OBB, epsilon
|
|
17
|
+
intersectsOBB(obb: OBB, epsilon?: number): boolean;
|
|
18
18
|
intersectsPlane(plane: Plane): boolean;
|
|
19
19
|
intersectRay(ray: Ray, result: Vector3): Vector3 | null;
|
|
20
20
|
intersectsRay(ray: Ray): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `PackedPhongMaterial` inherited from THREE.MeshPhongMaterial
|
|
3
|
+
*
|
|
4
|
+
* @param {Object} parameters
|
|
5
|
+
*/
|
|
6
|
+
import { MeshPhongMaterial, MeshPhongMaterialParameters } from '../../../src/Three';
|
|
7
|
+
|
|
8
|
+
export class PackedPhongMaterial extends MeshPhongMaterial {
|
|
9
|
+
constructor(parameters: MeshPhongMaterialParameters);
|
|
10
|
+
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { BufferGeometry, Group, InstancedMesh, Material, Object3D, Scene } from '../../../src/Three';
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function attach(child: Object3D, scene: Scene, parent: Object3D): void;
|
|
14
|
-
}
|
|
3
|
+
export function createMeshesFromInstancedMesh(instancedMesh: InstancedMesh): Group;
|
|
4
|
+
export function createMultiMaterialObject(geometry: BufferGeometry, materials: Material[]): Group;
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use scene.attach( child ) instead.
|
|
7
|
+
*/
|
|
8
|
+
export function detach(child: Object3D, parent: Object3D, scene: Scene): void;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use parent.attach( child ) instead.
|
|
11
|
+
*/
|
|
12
|
+
export function attach(child: Object3D, scene: Scene, parent: Object3D): void;
|
|
@@ -53,11 +53,11 @@ export class OculusHandPointerModel extends Object3D {
|
|
|
53
53
|
|
|
54
54
|
public isAttached(): boolean;
|
|
55
55
|
|
|
56
|
-
public intersectObject(object: Object3D): Intersection[] | void;
|
|
56
|
+
public intersectObject(object: Object3D, recursive?: boolean): Intersection[] | void;
|
|
57
57
|
|
|
58
|
-
public intersectObjects(objects: Object3D[]): Intersection[] | void;
|
|
58
|
+
public intersectObjects(objects: Object3D[], recursive?: boolean): Intersection[] | void;
|
|
59
59
|
|
|
60
|
-
public checkIntersections(objects: Object3D[]): void;
|
|
60
|
+
public checkIntersections(objects: Object3D[], recursive?: boolean): void;
|
|
61
61
|
|
|
62
62
|
public setCursor(distance: number): void;
|
|
63
63
|
}
|
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.137.0",
|
|
4
4
|
"description": "TypeScript definitions for three",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,6 +25,6 @@
|
|
|
25
25
|
},
|
|
26
26
|
"scripts": {},
|
|
27
27
|
"dependencies": {},
|
|
28
|
-
"typesPublisherContentHash": "
|
|
29
|
-
"typeScriptVersion": "3.
|
|
28
|
+
"typesPublisherContentHash": "dad1fe1dce939480949b1f93552d8ca03cab08b655aca66703302855e9fb414d",
|
|
29
|
+
"typeScriptVersion": "3.8"
|
|
30
30
|
}
|
three/src/Three.d.ts
CHANGED
|
@@ -224,4 +224,5 @@ export * from './textures/CompressedTexture';
|
|
|
224
224
|
export * from './textures/CubeTexture';
|
|
225
225
|
export * from './textures/CanvasTexture';
|
|
226
226
|
export * from './textures/DepthTexture';
|
|
227
|
+
export * from './textures/FramebufferTexture';
|
|
227
228
|
export * from './textures/Texture';
|
|
@@ -18,7 +18,7 @@ export class OrthographicCamera extends Camera {
|
|
|
18
18
|
* @param [near=0.1] Camera frustum near plane.
|
|
19
19
|
* @param [far=2000] Camera frustum far plane.
|
|
20
20
|
*/
|
|
21
|
-
constructor(left
|
|
21
|
+
constructor(left?: number, right?: number, top?: number, bottom?: number, near?: number, far?: number);
|
|
22
22
|
|
|
23
23
|
type: 'OrthographicCamera';
|
|
24
24
|
|
three/src/constants.d.ts
CHANGED
|
@@ -105,6 +105,7 @@ export const LinearToneMapping: ToneMapping;
|
|
|
105
105
|
export const ReinhardToneMapping: ToneMapping;
|
|
106
106
|
export const CineonToneMapping: ToneMapping;
|
|
107
107
|
export const ACESFilmicToneMapping: ToneMapping;
|
|
108
|
+
export const CustomToneMapping: ToneMapping;
|
|
108
109
|
|
|
109
110
|
// Mapping modes
|
|
110
111
|
export enum Mapping {}
|
|
@@ -147,25 +148,23 @@ export const FloatType: TextureDataType;
|
|
|
147
148
|
export const HalfFloatType: TextureDataType;
|
|
148
149
|
export const UnsignedShort4444Type: TextureDataType;
|
|
149
150
|
export const UnsignedShort5551Type: TextureDataType;
|
|
150
|
-
export const UnsignedShort565Type: TextureDataType;
|
|
151
151
|
export const UnsignedInt248Type: TextureDataType;
|
|
152
152
|
|
|
153
153
|
// Pixel formats
|
|
154
154
|
export enum PixelFormat {}
|
|
155
155
|
export const AlphaFormat: PixelFormat;
|
|
156
|
-
export const RGBFormat: PixelFormat;
|
|
157
156
|
export const RGBAFormat: PixelFormat;
|
|
158
157
|
export const LuminanceFormat: PixelFormat;
|
|
159
158
|
export const LuminanceAlphaFormat: PixelFormat;
|
|
160
|
-
export const RGBEFormat: PixelFormat;
|
|
161
159
|
export const DepthFormat: PixelFormat;
|
|
162
160
|
export const DepthStencilFormat: PixelFormat;
|
|
163
161
|
export const RedFormat: PixelFormat;
|
|
164
162
|
export const RedIntegerFormat: PixelFormat;
|
|
165
163
|
export const RGFormat: PixelFormat;
|
|
166
164
|
export const RGIntegerFormat: PixelFormat;
|
|
167
|
-
export const RGBIntegerFormat: PixelFormat;
|
|
168
165
|
export const RGBAIntegerFormat: PixelFormat;
|
|
166
|
+
export const _SRGBFormat: PixelFormat; // fallback for WebGL 1
|
|
167
|
+
export const _SRGBAFormat: PixelFormat; // fallback for WebGL 1
|
|
169
168
|
|
|
170
169
|
// Internal Pixel Formats
|
|
171
170
|
export type PixelFormatGPU =
|
|
@@ -224,6 +223,7 @@ export type PixelFormatGPU =
|
|
|
224
223
|
| 'RGB10_A2'
|
|
225
224
|
| 'RGB10_A2UI'
|
|
226
225
|
| 'SRGB8_ALPHA8'
|
|
226
|
+
| 'SRGB8'
|
|
227
227
|
| 'DEPTH_COMPONENT16'
|
|
228
228
|
| 'DEPTH_COMPONENT24'
|
|
229
229
|
| 'DEPTH_COMPONENT32F'
|
|
@@ -264,20 +264,6 @@ export const RGBA_ASTC_10x8_Format: CompressedPixelFormat;
|
|
|
264
264
|
export const RGBA_ASTC_10x10_Format: CompressedPixelFormat;
|
|
265
265
|
export const RGBA_ASTC_12x10_Format: CompressedPixelFormat;
|
|
266
266
|
export const RGBA_ASTC_12x12_Format: CompressedPixelFormat;
|
|
267
|
-
export const SRGB8_ALPHA8_ASTC_4x4_Format: CompressedPixelFormat;
|
|
268
|
-
export const SRGB8_ALPHA8_ASTC_5x4_Format: CompressedPixelFormat;
|
|
269
|
-
export const SRGB8_ALPHA8_ASTC_5x5_Format: CompressedPixelFormat;
|
|
270
|
-
export const SRGB8_ALPHA8_ASTC_6x5_Format: CompressedPixelFormat;
|
|
271
|
-
export const SRGB8_ALPHA8_ASTC_6x6_Format: CompressedPixelFormat;
|
|
272
|
-
export const SRGB8_ALPHA8_ASTC_8x5_Format: CompressedPixelFormat;
|
|
273
|
-
export const SRGB8_ALPHA8_ASTC_8x6_Format: CompressedPixelFormat;
|
|
274
|
-
export const SRGB8_ALPHA8_ASTC_8x8_Format: CompressedPixelFormat;
|
|
275
|
-
export const SRGB8_ALPHA8_ASTC_10x5_Format: CompressedPixelFormat;
|
|
276
|
-
export const SRGB8_ALPHA8_ASTC_10x6_Format: CompressedPixelFormat;
|
|
277
|
-
export const SRGB8_ALPHA8_ASTC_10x8_Format: CompressedPixelFormat;
|
|
278
|
-
export const SRGB8_ALPHA8_ASTC_10x10_Format: CompressedPixelFormat;
|
|
279
|
-
export const SRGB8_ALPHA8_ASTC_12x10_Format: CompressedPixelFormat;
|
|
280
|
-
export const SRGB8_ALPHA8_ASTC_12x12_Format: CompressedPixelFormat;
|
|
281
267
|
|
|
282
268
|
// BPTC compressed texture formats
|
|
283
269
|
export const RGBA_BPTC_Format: CompressedPixelFormat;
|
|
@@ -315,12 +301,9 @@ export const TriangleFanDrawMode: TrianglesDrawModes;
|
|
|
315
301
|
export enum TextureEncoding {}
|
|
316
302
|
export const LinearEncoding: TextureEncoding;
|
|
317
303
|
export const sRGBEncoding: TextureEncoding;
|
|
318
|
-
export const GammaEncoding: TextureEncoding;
|
|
319
|
-
export const RGBEEncoding: TextureEncoding;
|
|
320
304
|
export const LogLuvEncoding: TextureEncoding;
|
|
321
305
|
export const RGBM7Encoding: TextureEncoding;
|
|
322
306
|
export const RGBM16Encoding: TextureEncoding;
|
|
323
|
-
export const RGBDEncoding: TextureEncoding;
|
|
324
307
|
|
|
325
308
|
// Depth packing strategies
|
|
326
309
|
export enum DepthPackingStrategies {}
|
three/src/core/Layers.d.ts
CHANGED
three/src/core/Object3D.d.ts
CHANGED
|
@@ -119,6 +119,7 @@ export class Object3D<E extends BaseEvent = Event> extends EventDispatcher<E> {
|
|
|
119
119
|
* @default new THREE.Layers()
|
|
120
120
|
*/
|
|
121
121
|
layers: Layers;
|
|
122
|
+
|
|
122
123
|
/**
|
|
123
124
|
* Object gets rendered if true.
|
|
124
125
|
* @default true
|
|
@@ -211,18 +212,41 @@ export class Object3D<E extends BaseEvent = Event> extends EventDispatcher<E> {
|
|
|
211
212
|
static DefaultMatrixAutoUpdate: boolean;
|
|
212
213
|
|
|
213
214
|
/**
|
|
214
|
-
*
|
|
215
|
+
* Applies the matrix transform to the object and updates the object's position, rotation and scale.
|
|
215
216
|
*/
|
|
216
217
|
applyMatrix4(matrix: Matrix4): void;
|
|
217
218
|
|
|
219
|
+
/**
|
|
220
|
+
* Applies the rotation represented by the quaternion to the object.
|
|
221
|
+
*/
|
|
218
222
|
applyQuaternion(quaternion: Quaternion): this;
|
|
219
223
|
|
|
224
|
+
/**
|
|
225
|
+
* axis -- A normalized vector in object space.
|
|
226
|
+
* angle -- angle in radians
|
|
227
|
+
* @param axis A normalized vector in object space.
|
|
228
|
+
* @param angle angle in radians
|
|
229
|
+
*/
|
|
220
230
|
setRotationFromAxisAngle(axis: Vector3, angle: number): void;
|
|
221
231
|
|
|
232
|
+
/**
|
|
233
|
+
* Calls setRotationFromEuler(euler) on the .quaternion.
|
|
234
|
+
* @param euler Euler angle specifying rotation amount.
|
|
235
|
+
*/
|
|
222
236
|
setRotationFromEuler(euler: Euler): void;
|
|
223
237
|
|
|
238
|
+
/**
|
|
239
|
+
* Calls setFromRotationMatrix(m) on the .quaternion.
|
|
240
|
+
*
|
|
241
|
+
* Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
|
|
242
|
+
* @param m rotate the quaternion by the rotation component of the matrix.
|
|
243
|
+
*/
|
|
224
244
|
setRotationFromMatrix(m: Matrix4): void;
|
|
225
245
|
|
|
246
|
+
/**
|
|
247
|
+
* Copy the given quaternion into .quaternion.
|
|
248
|
+
* @param q normalized Quaternion
|
|
249
|
+
*/
|
|
226
250
|
setRotationFromQuaternion(q: Quaternion): void;
|
|
227
251
|
|
|
228
252
|
/**
|
|
@@ -240,24 +264,25 @@ export class Object3D<E extends BaseEvent = Event> extends EventDispatcher<E> {
|
|
|
240
264
|
rotateOnWorldAxis(axis: Vector3, angle: number): this;
|
|
241
265
|
|
|
242
266
|
/**
|
|
243
|
-
*
|
|
244
|
-
* @param angle
|
|
267
|
+
* Rotates the object around x axis in local space.
|
|
268
|
+
* @param angle the angle to rotate in radians.
|
|
245
269
|
*/
|
|
246
270
|
rotateX(angle: number): this;
|
|
247
271
|
|
|
248
272
|
/**
|
|
249
|
-
*
|
|
250
|
-
* @param angle
|
|
273
|
+
* Rotates the object around y axis in local space.
|
|
274
|
+
* @param angle the angle to rotate in radians.
|
|
251
275
|
*/
|
|
252
276
|
rotateY(angle: number): this;
|
|
253
277
|
|
|
254
278
|
/**
|
|
255
|
-
*
|
|
256
|
-
* @param angle
|
|
279
|
+
* Rotates the object around z axis in local space.
|
|
280
|
+
* @param angle the angle to rotate in radians.
|
|
257
281
|
*/
|
|
258
282
|
rotateZ(angle: number): this;
|
|
259
283
|
|
|
260
284
|
/**
|
|
285
|
+
* Translate an object by distance along an axis in object space. The axis is assumed to be normalized.
|
|
261
286
|
* @param axis A normalized vector in object space.
|
|
262
287
|
* @param distance The distance to translate.
|
|
263
288
|
*/
|
|
@@ -294,7 +319,9 @@ export class Object3D<E extends BaseEvent = Event> extends EventDispatcher<E> {
|
|
|
294
319
|
worldToLocal(vector: Vector3): Vector3;
|
|
295
320
|
|
|
296
321
|
/**
|
|
297
|
-
*
|
|
322
|
+
* Optionally, the x, y and z components of the world space position.
|
|
323
|
+
* Rotates the object to face a point in world space.
|
|
324
|
+
* This method does not support objects having non-uniformly-scaled parent(s).
|
|
298
325
|
* @param vector A world vector to look at.
|
|
299
326
|
*/
|
|
300
327
|
lookAt(vector: Vector3 | number, y?: number, z?: number): void;
|
|
@@ -361,6 +388,11 @@ export class Object3D<E extends BaseEvent = Event> extends EventDispatcher<E> {
|
|
|
361
388
|
*/
|
|
362
389
|
updateMatrixWorld(force?: boolean): void;
|
|
363
390
|
|
|
391
|
+
/**
|
|
392
|
+
* Updates the global transform of the object.
|
|
393
|
+
* @param updateParents recursively updates global transform of ancestors.
|
|
394
|
+
* @param updateChildren recursively updates global transform of descendants.
|
|
395
|
+
*/
|
|
364
396
|
updateWorldMatrix(updateParents: boolean, updateChildren: boolean): void;
|
|
365
397
|
|
|
366
398
|
toJSON(meta?: { geometries: any; materials: any; textures: any; images: any }): any;
|
three/src/core/Raycaster.d.ts
CHANGED
three/src/extras/ImageUtils.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ import { Scene } from '../scenes/Scene';
|
|
|
7
7
|
export class PMREMGenerator {
|
|
8
8
|
constructor(renderer: WebGLRenderer);
|
|
9
9
|
fromScene(scene: Scene, sigma?: number, near?: number, far?: number): WebGLRenderTarget;
|
|
10
|
-
fromEquirectangular(equirectangular: Texture): WebGLRenderTarget;
|
|
11
|
-
fromCubemap(cubemap: CubeTexture): WebGLRenderTarget;
|
|
10
|
+
fromEquirectangular(equirectangular: Texture, renderTarget?: WebGLRenderTarget | null): WebGLRenderTarget;
|
|
11
|
+
fromCubemap(cubemap: CubeTexture, renderTarget?: WebGLRenderTarget | null): WebGLRenderTarget;
|
|
12
12
|
compileCubemapShader(): void;
|
|
13
13
|
compileEquirectangularShader(): void;
|
|
14
14
|
dispose(): void;
|
|
@@ -80,6 +80,11 @@ export class Material extends EventDispatcher {
|
|
|
80
80
|
*/
|
|
81
81
|
alphaToCoverage: boolean;
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* @default false
|
|
85
|
+
*/
|
|
86
|
+
alphaWrite: boolean;
|
|
87
|
+
|
|
83
88
|
/**
|
|
84
89
|
* Blending destination. It's one of the blending mode constants defined in Three.js. Default is {@link OneMinusSrcAlphaFactor}.
|
|
85
90
|
* @default THREE.OneMinusSrcAlphaFactor
|
|
@@ -181,12 +186,6 @@ export class Material extends EventDispatcher {
|
|
|
181
186
|
*/
|
|
182
187
|
fog: boolean;
|
|
183
188
|
|
|
184
|
-
/**
|
|
185
|
-
* When this property is set to THREE.RGBFormat, the material is considered to be opaque and alpha values are ignored.
|
|
186
|
-
* @default THREE.RGBAFormat
|
|
187
|
-
*/
|
|
188
|
-
format: PixelFormat;
|
|
189
|
-
|
|
190
189
|
/**
|
|
191
190
|
* Unique number of this material instance.
|
|
192
191
|
*/
|
three/src/math/Box3.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export class Box3 {
|
|
|
25
25
|
setFromBufferAttribute(bufferAttribute: BufferAttribute): this;
|
|
26
26
|
setFromPoints(points: Vector3[]): this;
|
|
27
27
|
setFromCenterAndSize(center: Vector3, size: Vector3): this;
|
|
28
|
-
setFromObject(object: Object3D): this;
|
|
28
|
+
setFromObject(object: Object3D, precise?: boolean): this;
|
|
29
29
|
clone(): this;
|
|
30
30
|
copy(box: Box3): this;
|
|
31
31
|
makeEmpty(): this;
|
|
@@ -35,7 +35,7 @@ export class Box3 {
|
|
|
35
35
|
expandByPoint(point: Vector3): this;
|
|
36
36
|
expandByVector(vector: Vector3): this;
|
|
37
37
|
expandByScalar(scalar: number): this;
|
|
38
|
-
expandByObject(object: Object3D): this;
|
|
38
|
+
expandByObject(object: Object3D, precise?: boolean): this;
|
|
39
39
|
containsPoint(point: Vector3): boolean;
|
|
40
40
|
containsBox(box: Box3): boolean;
|
|
41
41
|
getParameter(point: Vector3, target: Vector3): Vector3;
|
three/src/math/Color.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export interface HSL {
|
|
|
7
7
|
l: number;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
export function SRGBToLinear(c: number): number;
|
|
11
|
+
|
|
10
12
|
/**
|
|
11
13
|
* Represents a color. See also {@link ColorUtils}.
|
|
12
14
|
*
|
|
@@ -85,28 +87,6 @@ export class Color {
|
|
|
85
87
|
*/
|
|
86
88
|
copy(color: Color): this;
|
|
87
89
|
|
|
88
|
-
/**
|
|
89
|
-
* Copies given color making conversion from gamma to linear space.
|
|
90
|
-
* @param color Color to copy.
|
|
91
|
-
*/
|
|
92
|
-
copyGammaToLinear(color: Color, gammaFactor?: number): Color;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Copies given color making conversion from linear to gamma space.
|
|
96
|
-
* @param color Color to copy.
|
|
97
|
-
*/
|
|
98
|
-
copyLinearToGamma(color: Color, gammaFactor?: number): Color;
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Converts this color from gamma to linear space.
|
|
102
|
-
*/
|
|
103
|
-
convertGammaToLinear(gammaFactor?: number): Color;
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Converts this color from linear to gamma space.
|
|
107
|
-
*/
|
|
108
|
-
convertLinearToGamma(gammaFactor?: number): Color;
|
|
109
|
-
|
|
110
90
|
/**
|
|
111
91
|
* Copies given color making conversion from sRGB to linear space.
|
|
112
92
|
* @param color Color to copy.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { CompressedPixelFormat, TextureEncoding } from '../../constants';
|
|
2
|
+
|
|
1
3
|
export class WebGLUtils {
|
|
2
4
|
constructor(gl: WebGLRenderingContext | WebGL2RenderingContext, extensions: any, capabilities: any);
|
|
3
5
|
|
|
4
|
-
convert(p:
|
|
6
|
+
convert(p: CompressedPixelFormat, encoding?: TextureEncoding | null): void;
|
|
5
7
|
}
|
|
@@ -25,7 +25,7 @@ export class WebXRManager extends EventDispatcher {
|
|
|
25
25
|
getSession(): XRSession | null;
|
|
26
26
|
setSession(value: XRSession): Promise<void>;
|
|
27
27
|
getCamera(camera: Camera): Camera;
|
|
28
|
-
setAnimationLoop(callback: XRFrameRequestCallback): void;
|
|
28
|
+
setAnimationLoop(callback: XRFrameRequestCallback | null): void;
|
|
29
29
|
getFoveation(): number | undefined;
|
|
30
30
|
setFoveation(foveation: number): void;
|
|
31
31
|
dispose(): void;
|
|
@@ -9,7 +9,7 @@ export class CubeTexture extends Texture {
|
|
|
9
9
|
* @param [wrapT=THREE.ClampToEdgeWrapping]
|
|
10
10
|
* @param [magFilter=THREE.LinearFilter]
|
|
11
11
|
* @param [minFilter=THREE.LinearMipmapLinearFilter]
|
|
12
|
-
* @param [format=THREE.
|
|
12
|
+
* @param [format=THREE.RGBAFormat]
|
|
13
13
|
* @param [type=THREE.UnsignedByteType]
|
|
14
14
|
* @param [anisotropy=1]
|
|
15
15
|
* @param [encoding=THREE.LinearEncoding]
|
|
@@ -9,7 +9,7 @@ export class VideoTexture extends Texture {
|
|
|
9
9
|
* @param [wrapT=THREE.ClampToEdgeWrapping]
|
|
10
10
|
* @param [magFilter=THREE.LinearFilter]
|
|
11
11
|
* @param [minFilter=THREE.LinearFilter]
|
|
12
|
-
* @param [format=THREE.
|
|
12
|
+
* @param [format=THREE.RGBAFormat]
|
|
13
13
|
* @param [type=THREE.UnsignedByteType]
|
|
14
14
|
* @param [anisotropy=1]
|
|
15
15
|
*/
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export default class Frustum {
|
|
2
|
-
constructor(data: any);
|
|
3
|
-
vertices: {
|
|
4
|
-
near: any[];
|
|
5
|
-
far: any[];
|
|
6
|
-
};
|
|
7
|
-
setFromProjectionMatrix(
|
|
8
|
-
projectionMatrix: any,
|
|
9
|
-
maxFar: any,
|
|
10
|
-
): {
|
|
11
|
-
near: any[];
|
|
12
|
-
far: any[];
|
|
13
|
-
};
|
|
14
|
-
split(breaks: any, target: any): void;
|
|
15
|
-
toSpace(cameraMatrix: any, target: any): void;
|
|
16
|
-
}
|