@types/three 0.140.0 → 0.143.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 +2 -2
- three/examples/jsm/controls/FirstPersonControls.d.ts +1 -1
- three/examples/jsm/controls/FlyControls.d.ts +1 -1
- three/examples/jsm/controls/OrbitControls.d.ts +3 -3
- three/examples/jsm/curves/NURBSUtils.d.ts +18 -20
- three/examples/jsm/exporters/GLTFExporter.d.ts +1 -1
- three/examples/jsm/exporters/KTX2Exporter.d.ts +5 -0
- three/examples/jsm/geometries/LightningStrike.d.ts +3 -3
- three/examples/jsm/loaders/GLTFLoader.d.ts +1 -1
- three/examples/jsm/loaders/NRRDLoader.d.ts +2 -2
- three/examples/jsm/misc/MorphAnimMesh.d.ts +1 -1
- three/examples/jsm/objects/GroundProjectedEnv.d.ts +13 -0
- three/examples/jsm/objects/LightningStorm.d.ts +3 -3
- three/examples/jsm/postprocessing/SAOPass.d.ts +1 -1
- three/examples/jsm/shaders/ACESFilmicToneMappingShader.d.ts +10 -0
- three/examples/jsm/textures/FlakesTexture.d.ts +3 -0
- three/examples/jsm/utils/CameraUtils.d.ts +7 -9
- three/examples/jsm/utils/GeometryCompressionUtils.d.ts +3 -5
- three/examples/jsm/utils/GeometryUtils.d.ts +23 -25
- three/examples/jsm/utils/SkeletonUtils.d.ts +16 -22
- three/examples/jsm/webxr/ARButton.d.ts +5 -1
- three/examples/jsm/webxr/OculusHandModel.d.ts +3 -2
- three/examples/jsm/webxr/OculusHandPointerModel.d.ts +6 -2
- three/examples/jsm/webxr/XRControllerModelFactory.d.ts +2 -0
- three/examples/jsm/webxr/XREstimatedLight.d.ts +5 -5
- three/examples/jsm/webxr/XRHandModelFactory.d.ts +1 -1
- three/index.d.ts +1 -1
- three/package.json +6 -4
- three/src/Three.d.ts +4 -2
- three/src/animation/AnimationUtils.d.ts +32 -34
- three/src/audio/AudioContext.d.ts +1 -1
- three/src/core/UniformsGroup.d.ts +27 -0
- three/src/extras/DataUtils.d.ts +2 -4
- three/src/materials/MeshPhysicalMaterial.d.ts +20 -0
- three/src/renderers/WebGLRenderTarget.d.ts +6 -0
- three/src/renderers/WebGLRenderer.d.ts +1 -7
- three/src/renderers/shaders/UniformsUtils.d.ts +6 -1
- three/src/renderers/webgl/WebGLUniformsGroups.d.ts +17 -0
- three/src/renderers/webxr/WebXRController.d.ts +31 -5
- three/src/renderers/webxr/WebXRManager.d.ts +23 -7
- three/examples/jsm/shaders/SSRrShader.d.ts +0 -48
- three/src/renderers/webxr/WebXR.d.ts +0 -328
three/README.md
CHANGED
|
@@ -8,8 +8,8 @@ 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:
|
|
12
|
-
* Dependencies:
|
|
11
|
+
* Last updated: Thu, 28 Jul 2022 16:32:18 GMT
|
|
12
|
+
* Dependencies: [@types/webxr](https://npmjs.com/package/@types/webxr)
|
|
13
13
|
* Global values: `THREE`
|
|
14
14
|
|
|
15
15
|
# Credits
|
|
@@ -4,7 +4,7 @@ export class OrbitControls {
|
|
|
4
4
|
constructor(object: Camera, domElement?: HTMLElement);
|
|
5
5
|
|
|
6
6
|
object: Camera;
|
|
7
|
-
domElement: HTMLElement |
|
|
7
|
+
domElement: HTMLElement | Document;
|
|
8
8
|
|
|
9
9
|
// API
|
|
10
10
|
enabled: boolean;
|
|
@@ -43,8 +43,8 @@ export class OrbitControls {
|
|
|
43
43
|
autoRotateSpeed: number;
|
|
44
44
|
|
|
45
45
|
keys: { LEFT: string; UP: string; RIGHT: string; BOTTOM: string };
|
|
46
|
-
mouseButtons: { LEFT: MOUSE; MIDDLE: MOUSE; RIGHT: MOUSE }
|
|
47
|
-
touches: { ONE: TOUCH; TWO: TOUCH }
|
|
46
|
+
mouseButtons: Partial<{ LEFT: MOUSE; MIDDLE: MOUSE; RIGHT: MOUSE }>;
|
|
47
|
+
touches: Partial<{ ONE: TOUCH; TWO: TOUCH }>;
|
|
48
48
|
|
|
49
49
|
target0: Vector3;
|
|
50
50
|
position0: Vector3;
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { Vector3, Vector4 } from '../../../src/Three';
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
): Vector3;
|
|
22
|
-
}
|
|
3
|
+
export function findSpan(p: number, u: number, U: number[]): number;
|
|
4
|
+
export function calcBasisFunctions(span: number, u: number, p: number, U: number[]): number[];
|
|
5
|
+
export function calcBSplinePoint(p: number, U: number[], P: Vector4[], u: number): Vector4;
|
|
6
|
+
export function calcBasisFunctionDerivatives(span: number, u: number, p: number, n: number, U: number[]): number[][];
|
|
7
|
+
export function calcBSplineDerivatives(p: number, U: number[], P: Vector4[], u: number, nd: number): Vector4[];
|
|
8
|
+
export function calcKoverI(k: number, i: number): number;
|
|
9
|
+
export function calcRationalCurveDerivatives(Pders: Vector4[]): Vector3[];
|
|
10
|
+
export function calcNURBSDerivatives(p: number, U: number[], P: Vector4[], u: number, nd: number): Vector3[];
|
|
11
|
+
export function calcSurfacePoint(
|
|
12
|
+
p: number,
|
|
13
|
+
q: number,
|
|
14
|
+
U: number[],
|
|
15
|
+
V: number[],
|
|
16
|
+
P: Vector4[],
|
|
17
|
+
u: number,
|
|
18
|
+
v: number,
|
|
19
|
+
target: Vector3,
|
|
20
|
+
): Vector3;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Vector3 } from '../../../src/Three';
|
|
1
|
+
import { BufferGeometry, Vector3 } from '../../../src/Three';
|
|
2
2
|
|
|
3
3
|
export interface RandomGenerator {
|
|
4
4
|
random(): number;
|
|
@@ -87,7 +87,7 @@ export interface RayParameters {
|
|
|
87
87
|
) => void;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
export class LightningStrike {
|
|
90
|
+
export class LightningStrike extends BufferGeometry {
|
|
91
91
|
constructor(rayParameters?: RayParameters);
|
|
92
92
|
copyParameters(dest?: RayParameters, source?: RayParameters): RayParameters;
|
|
93
93
|
|
|
@@ -103,6 +103,6 @@ export class LightningStrike {
|
|
|
103
103
|
|
|
104
104
|
update(time: number): void;
|
|
105
105
|
|
|
106
|
-
copy(source: LightningStrike):
|
|
106
|
+
copy(source: LightningStrike): this;
|
|
107
107
|
clone(): this;
|
|
108
108
|
}
|
|
@@ -65,7 +65,7 @@ export class GLTFLoader extends Loader {
|
|
|
65
65
|
onError?: (event: ErrorEvent) => void,
|
|
66
66
|
): void;
|
|
67
67
|
|
|
68
|
-
parseAsync(data: ArrayBuffer | string, path: string): Promise<
|
|
68
|
+
parseAsync(data: ArrayBuffer | string, path: string): Promise<GLTF>;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
export type GLTFReferenceType = 'materials' | 'nodes' | 'textures' | 'meshes';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { LoadingManager } from '../../../src/Three';
|
|
1
|
+
import { Loader, LoadingManager } from '../../../src/Three';
|
|
2
2
|
|
|
3
3
|
import { Volume } from '../misc/Volume';
|
|
4
4
|
|
|
5
|
-
export class NRRDLoader {
|
|
5
|
+
export class NRRDLoader extends Loader {
|
|
6
6
|
constructor(manager?: LoadingManager);
|
|
7
7
|
manager: LoadingManager;
|
|
8
8
|
path: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Mesh, IcosahedronGeometry, ShaderMaterial, Texture } from '../../../src/Three';
|
|
2
|
+
|
|
3
|
+
export class GroundProjectedEnv extends Mesh<IcosahedronGeometry, ShaderMaterial> {
|
|
4
|
+
constructor(texture: Texture, options?: { height?: number; radius?: number });
|
|
5
|
+
|
|
6
|
+
set radius(radius: number);
|
|
7
|
+
|
|
8
|
+
get radius(): number;
|
|
9
|
+
|
|
10
|
+
set height(height: number);
|
|
11
|
+
|
|
12
|
+
get height(): number;
|
|
13
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Material, Vector3 } from '../../../src/Three';
|
|
1
|
+
import { Material, Object3D, Vector3 } from '../../../src/Three';
|
|
2
2
|
|
|
3
3
|
import { LightningStrike, RayParameters } from '../geometries/LightningStrike';
|
|
4
4
|
|
|
@@ -24,9 +24,9 @@ export interface StormParams {
|
|
|
24
24
|
onLightningDown?: (lightning: LightningStrike) => void;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export class LightningStorm {
|
|
27
|
+
export class LightningStorm extends Object3D {
|
|
28
28
|
constructor(stormParams?: StormParams);
|
|
29
29
|
update(time: number): void;
|
|
30
|
-
copy(source: LightningStorm):
|
|
30
|
+
copy(source: LightningStorm, recursive?: boolean): this;
|
|
31
31
|
clone(): this;
|
|
32
32
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { PerspectiveCamera, Vector3 } from '../../../src/Three.js';
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
): void;
|
|
11
|
-
}
|
|
3
|
+
export function frameCorners(
|
|
4
|
+
camera: PerspectiveCamera,
|
|
5
|
+
bottomLeftCorner: Vector3,
|
|
6
|
+
bottomRightCorner: Vector3,
|
|
7
|
+
topLeftCorner: Vector3,
|
|
8
|
+
estimateViewFrustum?: boolean,
|
|
9
|
+
): void;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Mesh } from '../../../src/Three';
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function compressUvs(mesh: Mesh): void;
|
|
7
|
-
}
|
|
3
|
+
export function compressNormals(mesh: Mesh, encodeMethod: string): void;
|
|
4
|
+
export function compressPositions(mesh: Mesh): void;
|
|
5
|
+
export function compressUvs(mesh: Mesh): void;
|
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
import { Vector3 } from '../../../src/Three';
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
function gosper(size?: number): number[];
|
|
27
|
-
}
|
|
3
|
+
export function hilbert2D(
|
|
4
|
+
center?: Vector3,
|
|
5
|
+
size?: number,
|
|
6
|
+
iterations?: number,
|
|
7
|
+
v0?: number,
|
|
8
|
+
v1?: number,
|
|
9
|
+
v2?: number,
|
|
10
|
+
v3?: number,
|
|
11
|
+
): Vector3[];
|
|
12
|
+
export function hilbert3D(
|
|
13
|
+
center?: Vector3,
|
|
14
|
+
size?: number,
|
|
15
|
+
iterations?: number,
|
|
16
|
+
v0?: number,
|
|
17
|
+
v1?: number,
|
|
18
|
+
v2?: number,
|
|
19
|
+
v3?: number,
|
|
20
|
+
v4?: number,
|
|
21
|
+
v5?: number,
|
|
22
|
+
v6?: number,
|
|
23
|
+
v7?: number,
|
|
24
|
+
): Vector3[];
|
|
25
|
+
export function gosper(size?: number): number[];
|
|
@@ -1,34 +1,28 @@
|
|
|
1
1
|
import { AnimationClip, Bone, Matrix4, Object3D, Skeleton, SkeletonHelper } from '../../../src/Three';
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
export function retarget(target: Object3D | Skeleton, source: Object3D | Skeleton, options: {}): void;
|
|
3
|
+
export function retarget(target: Object3D | Skeleton, source: Object3D | Skeleton, options: {}): void;
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
export function retargetClip(
|
|
6
|
+
target: Skeleton | Object3D,
|
|
7
|
+
source: Skeleton | Object3D,
|
|
8
|
+
clip: AnimationClip,
|
|
9
|
+
options: {},
|
|
10
|
+
): AnimationClip;
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
export function getHelperFromSkeleton(skeleton: Skeleton): SkeletonHelper;
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
target: Object3D | Skeleton,
|
|
17
|
-
source: Object3D | Skeleton,
|
|
18
|
-
options: {},
|
|
19
|
-
): Matrix4[];
|
|
14
|
+
export function getSkeletonOffsets(target: Object3D | Skeleton, source: Object3D | Skeleton, options: {}): Matrix4[];
|
|
20
15
|
|
|
21
|
-
|
|
16
|
+
export function renameBones(skeleton: Skeleton, names: {}): any;
|
|
22
17
|
|
|
23
|
-
|
|
18
|
+
export function getBones(skeleton: Skeleton | Bone[]): Bone[];
|
|
24
19
|
|
|
25
|
-
|
|
20
|
+
export function getBoneByName(name: string, skeleton: Skeleton): Bone;
|
|
26
21
|
|
|
27
|
-
|
|
22
|
+
export function getNearestBone(bone: Bone, names: {}): Bone;
|
|
28
23
|
|
|
29
|
-
|
|
24
|
+
export function findBoneTrackData(name: string, tracks: any[]): {};
|
|
30
25
|
|
|
31
|
-
|
|
26
|
+
export function getEqualsBonesNames(skeleton: Skeleton, targetSkeleton: Skeleton): string[];
|
|
32
27
|
|
|
33
|
-
|
|
34
|
-
}
|
|
28
|
+
export function clone(source: Object3D): Object3D;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { WebGLRenderer } from '../../../src/Three';
|
|
2
2
|
|
|
3
|
+
export interface ARButtonSessionInit extends XRSessionInit {
|
|
4
|
+
domOverlay: { root: HTMLElement };
|
|
5
|
+
}
|
|
6
|
+
|
|
3
7
|
export namespace ARButton {
|
|
4
|
-
function createButton(renderer: WebGLRenderer, sessionInit?:
|
|
8
|
+
function createButton(renderer: WebGLRenderer, sessionInit?: Partial<ARButtonSessionInit>): HTMLElement;
|
|
5
9
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mesh, Object3D, Texture, Vector3 } from '../../../src/Three';
|
|
2
|
+
import { XRHandMeshModel } from './XRHandMeshModel';
|
|
2
3
|
|
|
3
4
|
export class OculusHandModel extends Object3D {
|
|
4
5
|
controller: Object3D;
|
|
5
|
-
motionController:
|
|
6
|
+
motionController: XRHandMeshModel | null;
|
|
6
7
|
envMap: Texture | null;
|
|
7
8
|
|
|
8
9
|
mesh: Mesh | null;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import 'webxr';
|
|
2
|
+
|
|
1
3
|
import {
|
|
2
4
|
BufferGeometry,
|
|
3
5
|
Intersection,
|
|
@@ -10,10 +12,12 @@ import {
|
|
|
10
12
|
Vector3,
|
|
11
13
|
} from '../../../src/Three';
|
|
12
14
|
|
|
15
|
+
import { XRHandMeshModel } from './XRHandMeshModel';
|
|
16
|
+
|
|
13
17
|
export class OculusHandPointerModel extends Object3D {
|
|
14
18
|
hand: Object3D;
|
|
15
19
|
controller: Object3D;
|
|
16
|
-
motionController:
|
|
20
|
+
motionController: XRHandMeshModel | null;
|
|
17
21
|
|
|
18
22
|
envMap: Texture | null;
|
|
19
23
|
|
|
@@ -31,7 +35,7 @@ export class OculusHandPointerModel extends Object3D {
|
|
|
31
35
|
raycaster: Raycaster;
|
|
32
36
|
|
|
33
37
|
visible: boolean;
|
|
34
|
-
xrInputSource:
|
|
38
|
+
xrInputSource: XRInputSource;
|
|
35
39
|
|
|
36
40
|
constructor(hand: Object3D, controller: Object3D);
|
|
37
41
|
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { DirectionalLight, Group, LightProbe,
|
|
1
|
+
import { DirectionalLight, Group, LightProbe, Texture, WebGLRenderer } from '../../../src/Three';
|
|
2
2
|
|
|
3
3
|
export class SessionLightProbe {
|
|
4
4
|
xrLight: XREstimatedLight;
|
|
5
5
|
renderer: WebGLRenderer;
|
|
6
|
-
lightProbe:
|
|
7
|
-
xrWebGLBinding:
|
|
6
|
+
lightProbe: LightProbe;
|
|
7
|
+
xrWebGLBinding: XRWebGLBinding | null;
|
|
8
8
|
estimationStartCallback: () => void;
|
|
9
9
|
frameCallback: (this: SessionLightProbe, time: number, xrFrame: XRFrame) => void;
|
|
10
10
|
|
|
11
11
|
constructor(
|
|
12
12
|
xrLight: XREstimatedLight,
|
|
13
13
|
renderer: WebGLRenderer,
|
|
14
|
-
lightProbe:
|
|
14
|
+
lightProbe: LightProbe,
|
|
15
15
|
environmentEstimation: boolean,
|
|
16
16
|
estimationStartCallback: () => void,
|
|
17
17
|
);
|
|
18
18
|
|
|
19
19
|
updateReflection: () => void;
|
|
20
20
|
|
|
21
|
-
onXRFrame:
|
|
21
|
+
onXRFrame: XRFrameRequestCallback;
|
|
22
22
|
|
|
23
23
|
dispose: () => void;
|
|
24
24
|
}
|
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.143.0",
|
|
4
4
|
"description": "TypeScript definitions for three",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,9 @@
|
|
|
24
24
|
"directory": "types/three"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {},
|
|
27
|
-
"dependencies": {
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@types/webxr": "*"
|
|
29
|
+
},
|
|
30
|
+
"typesPublisherContentHash": "2bd0a51b5f45c12a91bfe51f4e168b8c1ee7815e8f870ba4861a9e839d92d8f2",
|
|
31
|
+
"typeScriptVersion": "4.0"
|
|
30
32
|
}
|
three/src/Three.d.ts
CHANGED
|
@@ -16,7 +16,8 @@ export * from './animation/tracks/BooleanKeyframeTrack';
|
|
|
16
16
|
export * from './animation/PropertyMixer';
|
|
17
17
|
export * from './animation/PropertyBinding';
|
|
18
18
|
export * from './animation/KeyframeTrack';
|
|
19
|
-
|
|
19
|
+
import * as AnimationUtils from './animation/AnimationUtils';
|
|
20
|
+
export { AnimationUtils };
|
|
20
21
|
export * from './animation/AnimationObjectGroup';
|
|
21
22
|
export * from './animation/AnimationMixer';
|
|
22
23
|
export * from './animation/AnimationClip';
|
|
@@ -42,6 +43,7 @@ export * from './cameras/Camera';
|
|
|
42
43
|
* Core
|
|
43
44
|
*/
|
|
44
45
|
export * from './core/Uniform';
|
|
46
|
+
export * from './core/UniformsGroup';
|
|
45
47
|
export * from './core/InstancedBufferGeometry';
|
|
46
48
|
export * from './core/BufferGeometry';
|
|
47
49
|
export * from './core/InterleavedBufferAttribute';
|
|
@@ -207,7 +209,7 @@ export * from './renderers/webgl/WebGLShadowMap';
|
|
|
207
209
|
export * from './renderers/webgl/WebGLState';
|
|
208
210
|
export * from './renderers/webgl/WebGLTextures';
|
|
209
211
|
export * from './renderers/webgl/WebGLUniforms';
|
|
210
|
-
export * from './renderers/
|
|
212
|
+
export * from './renderers/webgl/WebGLUniformsGroups';
|
|
211
213
|
export * from './renderers/webxr/WebXRController';
|
|
212
214
|
export * from './renderers/webxr/WebXRManager';
|
|
213
215
|
export { WebGLUtils } from './renderers/webgl/WebGLUtils.js';
|
|
@@ -1,38 +1,36 @@
|
|
|
1
1
|
import { AnimationClip } from './AnimationClip';
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
function flattenJSON(jsonKeys: string[], times: any[], values: any[], valuePropertyName: string): void;
|
|
3
|
+
export function arraySlice(array: any, from: number, to: number): any;
|
|
4
|
+
export function convertArray(array: any, type: any, forceClone: boolean): any;
|
|
5
|
+
export function isTypedArray(object: any): boolean;
|
|
6
|
+
export function getKeyframeOrder(times: number[]): number[];
|
|
7
|
+
export function sortedArray(values: any[], stride: number, order: number[]): any[];
|
|
8
|
+
export function flattenJSON(jsonKeys: string[], times: any[], values: any[], valuePropertyName: string): void;
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @param sourceClip
|
|
12
|
+
* @param name
|
|
13
|
+
* @param startFrame
|
|
14
|
+
* @param endFrame
|
|
15
|
+
* @param [fps=30]
|
|
16
|
+
*/
|
|
17
|
+
export function subclip(
|
|
18
|
+
sourceClip: AnimationClip,
|
|
19
|
+
name: string,
|
|
20
|
+
startFrame: number,
|
|
21
|
+
endFrame: number,
|
|
22
|
+
fps?: number,
|
|
23
|
+
): AnimationClip;
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
25
|
+
/**
|
|
26
|
+
* @param targetClip
|
|
27
|
+
* @param [referenceFrame=0]
|
|
28
|
+
* @param [referenceClip=targetClip]
|
|
29
|
+
* @param [fps=30]
|
|
30
|
+
*/
|
|
31
|
+
export function makeClipAdditive(
|
|
32
|
+
targetClip: AnimationClip,
|
|
33
|
+
referenceFrame?: number,
|
|
34
|
+
referenceClip?: AnimationClip,
|
|
35
|
+
fps?: number,
|
|
36
|
+
): AnimationClip;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { EventDispatcher } from './EventDispatcher';
|
|
2
|
+
import { Uniform } from './Uniform';
|
|
3
|
+
|
|
4
|
+
import { Usage } from '../constants';
|
|
5
|
+
|
|
6
|
+
export class UniformsGroup extends EventDispatcher {
|
|
7
|
+
isUniformsGroup: true;
|
|
8
|
+
id: number;
|
|
9
|
+
usage: Usage;
|
|
10
|
+
uniforms: Uniform[];
|
|
11
|
+
|
|
12
|
+
constructor();
|
|
13
|
+
|
|
14
|
+
add(uniform: Uniform): this;
|
|
15
|
+
|
|
16
|
+
remove(uniform: Uniform): this;
|
|
17
|
+
|
|
18
|
+
setName(name: string): this;
|
|
19
|
+
|
|
20
|
+
setUsage(value: Usage): this;
|
|
21
|
+
|
|
22
|
+
dispose(): this;
|
|
23
|
+
|
|
24
|
+
copy(source: UniformsGroup): this;
|
|
25
|
+
|
|
26
|
+
clone(): UniformsGroup;
|
|
27
|
+
}
|
three/src/extras/DataUtils.d.ts
CHANGED
|
@@ -156,4 +156,24 @@ export class MeshPhysicalMaterial extends MeshStandardMaterial {
|
|
|
156
156
|
* @default null
|
|
157
157
|
*/
|
|
158
158
|
specularColorMap: Texture | null;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* @default null
|
|
162
|
+
*/
|
|
163
|
+
iridescenceMap: Texture | null;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* @default 1.3
|
|
167
|
+
*/
|
|
168
|
+
iridescenceIOR: number;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* @default [100, 400]
|
|
172
|
+
*/
|
|
173
|
+
iridescenceThicknessRange: number[];
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* @default null
|
|
177
|
+
*/
|
|
178
|
+
iridescenceThicknessMap: Texture | null;
|
|
159
179
|
}
|
|
@@ -17,6 +17,12 @@ export interface WebGLRenderTargetOptions {
|
|
|
17
17
|
generateMipmaps?: boolean | undefined; // true;
|
|
18
18
|
depthTexture?: DepthTexture | undefined;
|
|
19
19
|
encoding?: TextureEncoding | undefined;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Defines the count of MSAA samples. Can only be used with WebGL 2. Default is **0**.
|
|
23
|
+
* @default 0
|
|
24
|
+
*/
|
|
25
|
+
samples?: number;
|
|
20
26
|
}
|
|
21
27
|
|
|
22
28
|
export class WebGLRenderTarget extends EventDispatcher {
|
|
@@ -19,7 +19,6 @@ import { WebXRManager } from '../renderers/webxr/WebXRManager';
|
|
|
19
19
|
import { BufferGeometry } from './../core/BufferGeometry';
|
|
20
20
|
import { Texture } from '../textures/Texture';
|
|
21
21
|
import { Data3DTexture } from '../textures/Data3DTexture';
|
|
22
|
-
import { XRAnimationLoopCallback } from './webxr/WebXR';
|
|
23
22
|
import { Vector3 } from '../math/Vector3';
|
|
24
23
|
import { Box3 } from '../math/Box3';
|
|
25
24
|
import { DataArrayTexture } from '../textures/DataArrayTexture';
|
|
@@ -128,11 +127,6 @@ export class WebGLRenderer implements Renderer {
|
|
|
128
127
|
*/
|
|
129
128
|
domElement: HTMLCanvasElement;
|
|
130
129
|
|
|
131
|
-
/**
|
|
132
|
-
* The HTML5 Canvas's 'webgl' context obtained from the canvas where the renderer will draw.
|
|
133
|
-
*/
|
|
134
|
-
context: WebGLRenderingContext;
|
|
135
|
-
|
|
136
130
|
/**
|
|
137
131
|
* Defines whether the renderer should automatically clear its output before rendering.
|
|
138
132
|
* @default true
|
|
@@ -336,7 +330,7 @@ export class WebGLRenderer implements Renderer {
|
|
|
336
330
|
* A build in function that can be used instead of requestAnimationFrame. For WebXR projects this function must be used.
|
|
337
331
|
* @param callback The function will be called every available frame. If `null` is passed it will stop any already ongoing animation.
|
|
338
332
|
*/
|
|
339
|
-
setAnimationLoop(callback:
|
|
333
|
+
setAnimationLoop(callback: XRFrameRequestCallback | null): void;
|
|
340
334
|
|
|
341
335
|
/**
|
|
342
336
|
* @deprecated Use {@link WebGLRenderer#setAnimationLoop .setAnimationLoop()} instead.
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { Uniform } from '../../core/Uniform';
|
|
2
|
+
import { UniformsGroup } from '../../core/UniformsGroup';
|
|
3
|
+
|
|
1
4
|
export function cloneUniforms(uniforms_src: any): any;
|
|
2
|
-
export function mergeUniforms(uniforms: any
|
|
5
|
+
export function mergeUniforms(uniforms: any): any;
|
|
6
|
+
|
|
7
|
+
export function cloneUniformsGroups(src: UniformsGroup[]): UniformsGroup[];
|
|
3
8
|
|
|
4
9
|
export namespace UniformsUtils {
|
|
5
10
|
export { mergeUniforms as merge, cloneUniforms as clone };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { UniformsGroup } from '../../core/UniformsGroup';
|
|
2
|
+
|
|
3
|
+
import { WebGLCapabilities } from './WebGLCapabilities';
|
|
4
|
+
import { WebGLInfo } from './WebGLInfo';
|
|
5
|
+
import { WebGLProgram } from './WebGLProgram';
|
|
6
|
+
import { WebGLState } from './WebGLState';
|
|
7
|
+
|
|
8
|
+
export function WebGLUniformsGroups(
|
|
9
|
+
gl: WebGLRenderingContext,
|
|
10
|
+
info: WebGLInfo,
|
|
11
|
+
capabilities: WebGLCapabilities,
|
|
12
|
+
state: WebGLState,
|
|
13
|
+
): {
|
|
14
|
+
dispose: () => void;
|
|
15
|
+
update: (uniformsGroup: UniformsGroup, program: WebGLProgram) => void;
|
|
16
|
+
bind: (uniformsGroup: UniformsGroup, program: WebGLProgram) => void;
|
|
17
|
+
};
|
|
@@ -1,14 +1,40 @@
|
|
|
1
1
|
import { Group } from '../../objects/Group';
|
|
2
|
-
import {
|
|
2
|
+
import { Vector3 } from '../../math/Vector3';
|
|
3
3
|
|
|
4
|
-
export type XRControllerEventType =
|
|
4
|
+
export type XRControllerEventType = XRSessionEventType | XRInputSourceEventType | 'disconnected' | 'connected';
|
|
5
|
+
|
|
6
|
+
export type XRHandJoints = Record<XRHandJoint, number>;
|
|
7
|
+
|
|
8
|
+
export interface XRHandInputState {
|
|
9
|
+
pinching: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export class XRHandSpace extends Group {
|
|
13
|
+
readonly joints: Partial<XRHandJoints>;
|
|
14
|
+
readonly inputState: XRHandInputState;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export class XRTargetRaySpace extends Group {
|
|
18
|
+
hasLinearVelocity: boolean;
|
|
19
|
+
readonly linearVelocity: Vector3;
|
|
20
|
+
hasAngularVelocity: boolean;
|
|
21
|
+
readonly angularVelocity: Vector3;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class XRGripSpace extends Group {
|
|
25
|
+
hasLinearVelocity: boolean;
|
|
26
|
+
readonly linearVelocity: Vector3;
|
|
27
|
+
hasAngularVelocity: boolean;
|
|
28
|
+
readonly angularVelocity: Vector3;
|
|
29
|
+
}
|
|
5
30
|
|
|
6
31
|
export class WebXRController {
|
|
7
32
|
constructor();
|
|
8
33
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
34
|
+
getHandSpace(): XRHandSpace;
|
|
35
|
+
getTargetRaySpace(): XRTargetRaySpace;
|
|
36
|
+
getGripSpace(): XRGripSpace;
|
|
37
|
+
dispatchEvent(event: { type: XRControllerEventType; data?: XRInputSource }): this;
|
|
12
38
|
disconnect(inputSource: XRInputSource): this;
|
|
13
39
|
update(inputSource: XRInputSource, frame: XRFrame, referenceSpace: XRReferenceSpace): this;
|
|
14
40
|
}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/// <reference types="webxr" />
|
|
2
|
+
|
|
3
|
+
import { Vector4 } from '../../math/Vector4';
|
|
4
|
+
import { ArrayCamera } from '../../cameras/ArrayCamera';
|
|
5
|
+
import { PerspectiveCamera } from '../../cameras/PerspectiveCamera';
|
|
3
6
|
import { EventDispatcher } from '../../core/EventDispatcher';
|
|
4
|
-
import {
|
|
7
|
+
import { XRTargetRaySpace, XRGripSpace, XRHandSpace } from './WebXRController';
|
|
8
|
+
|
|
9
|
+
export type WebXRCamera = PerspectiveCamera & { viewport: Vector4 };
|
|
10
|
+
export type WebXRArrayCamera = Omit<ArrayCamera, 'cameras'> & { cameras: [WebXRCamera, WebXRCamera] };
|
|
5
11
|
|
|
6
12
|
export class WebXRManager extends EventDispatcher {
|
|
7
13
|
constructor(renderer: any, gl: WebGLRenderingContext);
|
|
@@ -16,15 +22,25 @@ export class WebXRManager extends EventDispatcher {
|
|
|
16
22
|
*/
|
|
17
23
|
isPresenting: boolean;
|
|
18
24
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
/**
|
|
26
|
+
* @default true
|
|
27
|
+
*/
|
|
28
|
+
cameraAutoUpdate: boolean;
|
|
29
|
+
|
|
30
|
+
getController(index: number): XRTargetRaySpace;
|
|
31
|
+
getControllerGrip(index: number): XRGripSpace;
|
|
32
|
+
getHand(index: number): XRHandSpace;
|
|
22
33
|
setFramebufferScaleFactor(value: number): void;
|
|
23
34
|
setReferenceSpaceType(value: XRReferenceSpaceType): void;
|
|
24
35
|
getReferenceSpace(): XRReferenceSpace | null;
|
|
36
|
+
setReferenceSpace(value: XRReferenceSpace): void;
|
|
37
|
+
getBaseLayer(): XRWebGLLayer | XRProjectionLayer;
|
|
38
|
+
getBinding(): XRWebGLBinding;
|
|
39
|
+
getFrame(): XRFrame;
|
|
25
40
|
getSession(): XRSession | null;
|
|
26
41
|
setSession(value: XRSession): Promise<void>;
|
|
27
|
-
getCamera(
|
|
42
|
+
getCamera(): WebXRArrayCamera;
|
|
43
|
+
updateCamera(camera: PerspectiveCamera): void;
|
|
28
44
|
setAnimationLoop(callback: XRFrameRequestCallback | null): void;
|
|
29
45
|
getFoveation(): number | undefined;
|
|
30
46
|
setFoveation(foveation: number): void;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Matrix4, Vector2, IUniform, Texture } from '../../../src/Three';
|
|
2
|
-
|
|
3
|
-
export interface SSRrShader {
|
|
4
|
-
defines: {
|
|
5
|
-
MAX_STEP: number;
|
|
6
|
-
PERSPECTIVE_CAMERA: boolean;
|
|
7
|
-
SPECULAR: boolean;
|
|
8
|
-
FILL_HOLE: boolean;
|
|
9
|
-
INFINITE_THICK: boolean;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
uniforms: {
|
|
13
|
-
tDiffuse: IUniform<Texture | null>;
|
|
14
|
-
tSpecular: IUniform<Texture | null>;
|
|
15
|
-
tNormalSelects: IUniform<Texture | null>;
|
|
16
|
-
tRefractive: IUniform<Texture | null>;
|
|
17
|
-
tDepthSelects: IUniform<Texture | null>;
|
|
18
|
-
cameraNear: IUniform<number | null>;
|
|
19
|
-
cameraFar: IUniform<number | null>;
|
|
20
|
-
resolution: IUniform<Vector2>;
|
|
21
|
-
cameraProjectionMatrix: IUniform<Matrix4>;
|
|
22
|
-
cameraInverseProjectionMatrix: IUniform<Matrix4>;
|
|
23
|
-
ior: IUniform<number>;
|
|
24
|
-
cameraRange: IUniform<number>;
|
|
25
|
-
maxDistance: IUniform<number>;
|
|
26
|
-
surfDist: IUniform<number>;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
vertexShader: string;
|
|
30
|
-
|
|
31
|
-
fragmentShader: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface SSRrDepthShader {
|
|
35
|
-
defines: {
|
|
36
|
-
PERSPECTIVE_CAMERA: number;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
uniforms: {
|
|
40
|
-
tDepth: IUniform<Texture | null>;
|
|
41
|
-
cameraNear: IUniform<number | null>;
|
|
42
|
-
cameraFar: IUniform<number | null>;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
vertexShader: string;
|
|
46
|
-
|
|
47
|
-
fragmentShader: string;
|
|
48
|
-
}
|
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
export type XRSessionMode = 'inline' | 'immersive-vr' | 'immersive-ar';
|
|
2
|
-
|
|
3
|
-
export type XRReferenceSpaceType = 'viewer' | 'local' | 'local-floor' | 'bounded-floor' | 'unbounded';
|
|
4
|
-
|
|
5
|
-
export type XREnvironmentBlendMode = 'opaque' | 'additive' | 'alpha-blend';
|
|
6
|
-
|
|
7
|
-
export type XRVisibilityState = 'visible' | 'visible-blurred' | 'hidden';
|
|
8
|
-
|
|
9
|
-
export type XRHandedness = 'none' | 'left' | 'right';
|
|
10
|
-
|
|
11
|
-
export type XRTargetRayMode = 'gaze' | 'tracked-pointer' | 'screen';
|
|
12
|
-
|
|
13
|
-
export type XREye = 'none' | 'left' | 'right';
|
|
14
|
-
|
|
15
|
-
export type XREventType =
|
|
16
|
-
| 'end'
|
|
17
|
-
| 'select'
|
|
18
|
-
| 'selectstart'
|
|
19
|
-
| 'selectend'
|
|
20
|
-
| 'squeeze'
|
|
21
|
-
| 'squeezestart'
|
|
22
|
-
| 'squeezeend'
|
|
23
|
-
| 'inputsourceschange';
|
|
24
|
-
|
|
25
|
-
export type XRAnimationLoopCallback = (time: number, frame?: XRFrame) => void;
|
|
26
|
-
|
|
27
|
-
export type XRFrameRequestCallback = (time: number, frame: XRFrame) => void;
|
|
28
|
-
|
|
29
|
-
export interface XR extends EventTarget {
|
|
30
|
-
requestSession(mode: XRSessionMode, options?: XRSessionInit): Promise<XRSession>;
|
|
31
|
-
isSessionSupported(mode: XRSessionMode): Promise<boolean>;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface Window {
|
|
35
|
-
XRSession?: Constructor<XRSession> | undefined;
|
|
36
|
-
XR?: Constructor<XR> | undefined;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface Navigator {
|
|
40
|
-
xr?: XR | undefined;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface XRReferenceSpace extends EventTarget {
|
|
44
|
-
getOffsetReferenceSpace(originOffset: XRRigidTransform): XRReferenceSpace;
|
|
45
|
-
}
|
|
46
|
-
export interface XRHitTestOptionsInit {
|
|
47
|
-
space: EventTarget;
|
|
48
|
-
offsetRay?: XRRay | undefined;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface XRTransientInputHitTestOptionsInit {
|
|
52
|
-
profile: string;
|
|
53
|
-
offsetRay?: XRRay | undefined;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export interface XRViewport {
|
|
57
|
-
readonly x: number;
|
|
58
|
-
readonly y: number;
|
|
59
|
-
readonly width: number;
|
|
60
|
-
readonly height: number;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export interface WebGLRenderingContext {
|
|
64
|
-
makeXRCompatible(): Promise<void>;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface XRRenderState {
|
|
68
|
-
readonly depthNear: number;
|
|
69
|
-
readonly depthFar: number;
|
|
70
|
-
readonly inlineVerticalFieldOfView?: number | undefined;
|
|
71
|
-
readonly baseLayer?: XRWebGLLayer | undefined;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface XRRenderStateInit {
|
|
75
|
-
depthNear?: number | undefined;
|
|
76
|
-
depthFar?: number | undefined;
|
|
77
|
-
inlineVerticalFieldOfView?: number | undefined;
|
|
78
|
-
baseLayer?: XRWebGLLayer | undefined;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export interface XRGamepad {
|
|
82
|
-
readonly id: string;
|
|
83
|
-
readonly index: number; // long
|
|
84
|
-
readonly connected: boolean;
|
|
85
|
-
readonly timestamp: DOMHighResTimeStamp;
|
|
86
|
-
readonly mapping: GamepadMappingType;
|
|
87
|
-
readonly axes: Float32Array; // FrozenArray<double>;
|
|
88
|
-
readonly buttons: GamepadButton[]; // FrozenArray<GamepadButton>;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export interface XRInputSource {
|
|
92
|
-
readonly handedness: XRHandedness;
|
|
93
|
-
readonly targetRayMode: XRTargetRayMode;
|
|
94
|
-
readonly targetRaySpace: EventTarget;
|
|
95
|
-
readonly gripSpace?: EventTarget | undefined;
|
|
96
|
-
readonly profiles: string[];
|
|
97
|
-
readonly gamepad: XRGamepad;
|
|
98
|
-
readonly hand?: XRHand | undefined;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export interface XRSessionInit {
|
|
102
|
-
optionalFeatures?: string[] | undefined;
|
|
103
|
-
requiredFeatures?: string[] | undefined;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export interface XRSession extends EventTarget {
|
|
107
|
-
requestReferenceSpace(type: XRReferenceSpaceType): Promise<XRReferenceSpace>;
|
|
108
|
-
updateRenderState(renderStateInit: XRRenderStateInit): Promise<void>;
|
|
109
|
-
requestAnimationFrame(callback: XRFrameRequestCallback): number;
|
|
110
|
-
cancelAnimationFrame(id: number): void;
|
|
111
|
-
end(): Promise<void>;
|
|
112
|
-
renderState: XRRenderState;
|
|
113
|
-
inputSources: XRInputSource[];
|
|
114
|
-
environmentBlendMode: XREnvironmentBlendMode;
|
|
115
|
-
visibilityState: XRVisibilityState;
|
|
116
|
-
|
|
117
|
-
// hit test
|
|
118
|
-
requestHitTestSource(options: XRHitTestOptionsInit): Promise<XRHitTestSource>;
|
|
119
|
-
requestHitTestSourceForTransientInput(
|
|
120
|
-
options: XRTransientInputHitTestOptionsInit,
|
|
121
|
-
): Promise<XRTransientInputHitTestSource>;
|
|
122
|
-
|
|
123
|
-
// legacy AR hit test
|
|
124
|
-
requestHitTest(ray: XRRay, referenceSpace: XRReferenceSpace): Promise<XRHitResult[]>;
|
|
125
|
-
|
|
126
|
-
// legacy plane detection
|
|
127
|
-
updateWorldTrackingState(options: { planeDetectionState?: { enabled: boolean } | undefined }): void;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export interface XRReferenceSpace extends EventTarget {
|
|
131
|
-
getOffsetReferenceSpace(originOffset: XRRigidTransform): XRReferenceSpace;
|
|
132
|
-
onreset: any;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export type XRPlaneSet = Set<XRPlane>;
|
|
136
|
-
export type XRAnchorSet = Set<XRAnchor>;
|
|
137
|
-
|
|
138
|
-
export interface XRFrame {
|
|
139
|
-
readonly session: XRSession;
|
|
140
|
-
getViewerPose(referenceSpace: XRReferenceSpace): XRViewerPose | undefined;
|
|
141
|
-
getPose(space: EventTarget, baseSpace: EventTarget): XRPose | undefined;
|
|
142
|
-
|
|
143
|
-
// AR
|
|
144
|
-
getHitTestResults(hitTestSource: XRHitTestSource): XRHitTestResult[];
|
|
145
|
-
getHitTestResultsForTransientInput(hitTestSource: XRTransientInputHitTestSource): XRTransientInputHitTestResult[];
|
|
146
|
-
// Anchors
|
|
147
|
-
trackedAnchors?: XRAnchorSet | undefined;
|
|
148
|
-
createAnchor(pose: XRRigidTransform, space: EventTarget): Promise<XRAnchor>;
|
|
149
|
-
// Planes
|
|
150
|
-
worldInformation: {
|
|
151
|
-
detectedPlanes?: XRPlaneSet | undefined;
|
|
152
|
-
};
|
|
153
|
-
// Hand tracking
|
|
154
|
-
getJointPose(joint: XRJointSpace, baseSpace: EventTarget): XRJointPose;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
export interface XRViewerPose {
|
|
158
|
-
readonly transform: XRRigidTransform;
|
|
159
|
-
readonly views: XRView[];
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
export interface XRPose {
|
|
163
|
-
readonly emulatedPosition: boolean;
|
|
164
|
-
readonly transform: XRRigidTransform;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
export interface XRWebGLLayerInit {
|
|
168
|
-
antialias?: boolean | undefined;
|
|
169
|
-
depth?: boolean | undefined;
|
|
170
|
-
stencil?: boolean | undefined;
|
|
171
|
-
alpha?: boolean | undefined;
|
|
172
|
-
ignoreDepthValues?: boolean | undefined;
|
|
173
|
-
framebufferScaleFactor?: number | undefined;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
export class XRWebGLLayer {
|
|
177
|
-
constructor(session: XRSession, gl: WebGLRenderingContext | undefined, options?: XRWebGLLayerInit);
|
|
178
|
-
framebuffer: WebGLFramebuffer;
|
|
179
|
-
framebufferWidth: number;
|
|
180
|
-
framebufferHeight: number;
|
|
181
|
-
getViewport(view: XRView): XRViewport;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
export interface DOMPointInit {
|
|
185
|
-
w?: number | undefined;
|
|
186
|
-
x?: number | undefined;
|
|
187
|
-
y?: number | undefined;
|
|
188
|
-
z?: number | undefined;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export class XRRigidTransform {
|
|
192
|
-
constructor(matrix: Float32Array | DOMPointInit, direction?: DOMPointInit);
|
|
193
|
-
position: DOMPointReadOnly;
|
|
194
|
-
orientation: DOMPointReadOnly;
|
|
195
|
-
matrix: Float32Array;
|
|
196
|
-
inverse: XRRigidTransform;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
export interface XRView {
|
|
200
|
-
readonly eye: XREye;
|
|
201
|
-
readonly projectionMatrix: Float32Array;
|
|
202
|
-
readonly viewMatrix: Float32Array;
|
|
203
|
-
readonly transform: XRRigidTransform;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
export interface XRRayDirectionInit {
|
|
207
|
-
x?: number | undefined;
|
|
208
|
-
y?: number | undefined;
|
|
209
|
-
z?: number | undefined;
|
|
210
|
-
w?: number | undefined;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
export class XRRay {
|
|
214
|
-
readonly origin: DOMPointReadOnly;
|
|
215
|
-
readonly direction: XRRayDirectionInit;
|
|
216
|
-
matrix: Float32Array;
|
|
217
|
-
|
|
218
|
-
constructor(transformOrOrigin: XRRigidTransform | DOMPointInit, direction?: XRRayDirectionInit);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
export enum XRHitTestTrackableType {
|
|
222
|
-
'point',
|
|
223
|
-
'plane',
|
|
224
|
-
'mesh',
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
export interface XRHitResult {
|
|
228
|
-
hitMatrix: Float32Array;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
export interface XRTransientInputHitTestResult {
|
|
232
|
-
readonly inputSource: XRInputSource;
|
|
233
|
-
readonly results: XRHitTestResult[];
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
export interface XRHitTestResult {
|
|
237
|
-
getPose(baseSpace: EventTarget): XRPose | undefined | null;
|
|
238
|
-
// When anchor system is enabled
|
|
239
|
-
createAnchor?(pose: XRRigidTransform): Promise<XRAnchor>;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
export interface XRHitTestSource {
|
|
243
|
-
cancel(): void;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
export interface XRTransientInputHitTestSource {
|
|
247
|
-
cancel(): void;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
export interface XRHitTestOptionsInit {
|
|
251
|
-
space: EventTarget;
|
|
252
|
-
entityTypes?: XRHitTestTrackableType[] | undefined;
|
|
253
|
-
offsetRay?: XRRay | undefined;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
export interface XRTransientInputHitTestOptionsInit {
|
|
257
|
-
profile: string;
|
|
258
|
-
entityTypes?: XRHitTestTrackableType[] | undefined;
|
|
259
|
-
offsetRay?: XRRay | undefined;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
export interface XRAnchor {
|
|
263
|
-
anchorSpace: EventTarget;
|
|
264
|
-
delete(): void;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
export interface XRPlane {
|
|
268
|
-
orientation: 'Horizontal' | 'Vertical';
|
|
269
|
-
planeSpace: EventTarget;
|
|
270
|
-
polygon: DOMPointReadOnly[];
|
|
271
|
-
lastChangedTime: number;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
export enum XRHandJoint {
|
|
275
|
-
'wrist',
|
|
276
|
-
'thumb-metacarpal',
|
|
277
|
-
'thumb-phalanx-proximal',
|
|
278
|
-
'thumb-phalanx-distal',
|
|
279
|
-
'thumb-tip',
|
|
280
|
-
'index-finger-metacarpal',
|
|
281
|
-
'index-finger-phalanx-proximal',
|
|
282
|
-
'index-finger-phalanx-intermediate',
|
|
283
|
-
'index-finger-phalanx-distal',
|
|
284
|
-
'index-finger-tip',
|
|
285
|
-
'middle-finger-metacarpal',
|
|
286
|
-
'middle-finger-phalanx-proximal',
|
|
287
|
-
'middle-finger-phalanx-intermediate',
|
|
288
|
-
'middle-finger-phalanx-distal',
|
|
289
|
-
'middle-finger-tip',
|
|
290
|
-
'ring-finger-metacarpal',
|
|
291
|
-
'ring-finger-phalanx-proximal',
|
|
292
|
-
'ring-finger-phalanx-intermediate',
|
|
293
|
-
'ring-finger-phalanx-distal',
|
|
294
|
-
'ring-finger-tip',
|
|
295
|
-
'pinky-finger-metacarpal',
|
|
296
|
-
'pinky-finger-phalanx-proximal',
|
|
297
|
-
'pinky-finger-phalanx-intermediate',
|
|
298
|
-
'pinky-finger-phalanx-distal',
|
|
299
|
-
'pinky-finger-tip',
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
export interface XRJointSpace extends EventTarget {
|
|
303
|
-
readonly jointName: XRHandJoint;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
export interface XRJointPose extends XRPose {
|
|
307
|
-
readonly radius: number | undefined;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
export interface XRHand extends Map<XRHandJoint, XRJointSpace> {
|
|
311
|
-
readonly size: number;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
export interface Constructor<T = object> {
|
|
315
|
-
new (...args: any[]): T;
|
|
316
|
-
prototype: T;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
export interface XRInputSourceChangeEvent {
|
|
320
|
-
session: XRSession;
|
|
321
|
-
removed: XRInputSource[];
|
|
322
|
-
added: XRInputSource[];
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
export interface XRInputSourceEvent extends Event {
|
|
326
|
-
readonly frame: XRFrame;
|
|
327
|
-
readonly inputSource: XRInputSource;
|
|
328
|
-
}
|