@galacean/engine-xr 0.0.0-experimental-1.3-xr.4 → 0.0.0-experimental-1.3-xr.8
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.
- package/dist/browser.js +64 -309
- package/dist/browser.js.map +1 -1
- package/dist/browser.min.js +1 -1
- package/dist/browser.min.js.map +1 -1
- package/dist/main.js +64 -309
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +64 -309
- package/dist/module.js +66 -311
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/types/XRManagerExtended.d.ts +6 -51
- package/types/feature/trackable/XRTrackableFeature.d.ts +1 -1
- package/types/index.d.ts +0 -1
- package/types/session/XRSessionManager.d.ts +2 -2
- package/types/session/XRSessionState.d.ts +5 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-xr",
|
|
3
|
-
"version": "0.0.0-experimental-1.3-xr.
|
|
3
|
+
"version": "0.0.0-experimental-1.3-xr.8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"types/**/*"
|
|
24
24
|
],
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@galacean/engine-design": "0.0.0-experimental-1.3-xr.
|
|
27
|
-
"@galacean/engine": "0.0.0-experimental-1.3-xr.
|
|
26
|
+
"@galacean/engine-design": "0.0.0-experimental-1.3-xr.8",
|
|
27
|
+
"@galacean/engine": "0.0.0-experimental-1.3-xr.8"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@galacean/engine": "0.0.0-experimental-1.3-xr.
|
|
30
|
+
"@galacean/engine": "0.0.0-experimental-1.3-xr.8"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"b:types": "tsc"
|
|
@@ -1,59 +1,12 @@
|
|
|
1
|
-
import { Entity
|
|
1
|
+
import { Entity } from "@galacean/engine";
|
|
2
2
|
import { XRFeature } from "./feature/XRFeature";
|
|
3
3
|
import { XRCameraManager } from "./feature/camera/XRCameraManager";
|
|
4
4
|
import { XRInputManager } from "./input/XRInputManager";
|
|
5
5
|
import { XRSessionManager } from "./session/XRSessionManager";
|
|
6
6
|
import { XRSessionMode } from "./session/XRSessionMode";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export declare class XRManagerExtended extends XRManager {
|
|
11
|
-
/** Input manager for XR. */
|
|
12
|
-
inputManager: XRInputManager;
|
|
13
|
-
/** Session manager for XR. */
|
|
14
|
-
sessionManager: XRSessionManager;
|
|
15
|
-
/** Camera manager for XR. */
|
|
16
|
-
cameraManager: XRCameraManager;
|
|
17
|
-
/** All initialized features at this moment. */
|
|
18
|
-
readonly features: XRFeature[];
|
|
19
|
-
private _origin;
|
|
20
|
-
/**
|
|
21
|
-
* The current origin of XR space.
|
|
22
|
-
* @remarks The connection point between the virtual world and the real world ( XR Space )
|
|
23
|
-
*/
|
|
24
|
-
get origin(): Entity;
|
|
25
|
-
set origin(value: Entity);
|
|
26
|
-
/**
|
|
27
|
-
* Check if the specified feature is supported.
|
|
28
|
-
* @param type - The type of the feature
|
|
29
|
-
* @returns If the feature is supported
|
|
30
|
-
*/
|
|
31
|
-
isSupportedFeature<T extends XRFeature>(feature: TFeatureConstructor<T>): boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Add feature based on the xr feature type.
|
|
34
|
-
* @param type - The type of the feature
|
|
35
|
-
* @param args - The constructor params of the feature
|
|
36
|
-
* @returns The feature which has been added
|
|
37
|
-
*/
|
|
38
|
-
addFeature<T extends new (xrManager: XRManagerExtended, ...args: any[]) => XRFeature>(type: T, ...args: TFeatureConstructorArguments<T>): InstanceType<T> | null;
|
|
39
|
-
/**
|
|
40
|
-
* Get feature which match the type.
|
|
41
|
-
* @param type - The type of the feature
|
|
42
|
-
* @returns The feature which match type
|
|
43
|
-
*/
|
|
44
|
-
getFeature<T extends XRFeature>(type: TFeatureConstructor<T>): T | null;
|
|
45
|
-
/**
|
|
46
|
-
* Enter XR immersive mode, when you call this method, it will initialize and display the XR virtual world.
|
|
47
|
-
* @param sessionMode - The mode of the session
|
|
48
|
-
* @param autoRun - Whether to automatically run the session, when `autoRun` is set to true, xr will start working immediately after initialization. Otherwise, you need to call `sessionManager.run` later to work.
|
|
49
|
-
* @returns A promise that resolves if the XR virtual world is entered, otherwise rejects
|
|
50
|
-
*/
|
|
51
|
-
enterXR(sessionMode: XRSessionMode, autoRun?: boolean): Promise<void>;
|
|
52
|
-
/**
|
|
53
|
-
* Exit XR immersive mode, when you call this method, it will destroy the XR virtual world.
|
|
54
|
-
* @returns A promise that resolves if the XR virtual world is destroyed, otherwise rejects
|
|
55
|
-
*/
|
|
56
|
-
exitXR(): Promise<void>;
|
|
7
|
+
export interface IXRListener {
|
|
8
|
+
fn: (...args: any[]) => any;
|
|
9
|
+
destroyed?: boolean;
|
|
57
10
|
}
|
|
58
11
|
type TFeatureConstructor<T extends XRFeature> = new (xrManager: XRManagerExtended, ...args: any[]) => T;
|
|
59
12
|
type TFeatureConstructorArguments<T extends new (xrManager: XRManagerExtended, ...args: any[]) => XRFeature> = T extends new (xrManager: XRManagerExtended, ...args: infer P) => XRFeature ? P : never;
|
|
@@ -65,6 +18,8 @@ declare module "@galacean/engine" {
|
|
|
65
18
|
sessionManager: XRSessionManager;
|
|
66
19
|
/** Camera manager for XR. */
|
|
67
20
|
cameraManager: XRCameraManager;
|
|
21
|
+
/** Initialized features. */
|
|
22
|
+
readonly features: XRFeature[];
|
|
68
23
|
/**
|
|
69
24
|
* The current origin of XR space.
|
|
70
25
|
* @remarks The connection point between the virtual world and the real world ( XR Space )
|
|
@@ -6,7 +6,7 @@ import { XRTracked } from "./XRTracked";
|
|
|
6
6
|
/**
|
|
7
7
|
* The base class of XR trackable manager.
|
|
8
8
|
*/
|
|
9
|
-
export declare abstract class XRTrackableFeature<T extends XRTracked, K extends XRRequestTracking<T>> extends XRFeature<IXRTrackablePlatformFeature<T, K>> {
|
|
9
|
+
export declare abstract class XRTrackableFeature<T extends XRTracked = XRTracked, K extends XRRequestTracking<T> = XRRequestTracking<T>> extends XRFeature<IXRTrackablePlatformFeature<T, K>> {
|
|
10
10
|
protected static _uuid: number;
|
|
11
11
|
protected _requestTrackings: K[];
|
|
12
12
|
protected _tracked: T[];
|
package/types/index.d.ts
CHANGED
|
@@ -30,4 +30,3 @@ export { XRInputEventType } from "./input/XRInputEventType";
|
|
|
30
30
|
export { XRTargetRayMode } from "./input/XRTargetRayMode";
|
|
31
31
|
export * from "./loader/XRReferenceImageDecoder";
|
|
32
32
|
export * from "./loader/XRReferenceImageLoader";
|
|
33
|
-
export * from "./loader/XRSceneExtendParser";
|
|
@@ -46,11 +46,11 @@ export declare class XRSessionManager {
|
|
|
46
46
|
* Add a listening function for session state changes.
|
|
47
47
|
* @param listener - The listening function
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
addStateChangedListener(listener: (state: XRSessionState) => void): void;
|
|
50
50
|
/**
|
|
51
51
|
* Remove a listening function of session state changes.
|
|
52
52
|
* @param listener - The listening function
|
|
53
53
|
*/
|
|
54
|
-
|
|
54
|
+
removeStateChangedListener(listener: (state: XRSessionState) => void): void;
|
|
55
55
|
private _onSessionExit;
|
|
56
56
|
}
|
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
export declare enum XRSessionState {
|
|
5
5
|
/** Not initialized. */
|
|
6
6
|
None = 0,
|
|
7
|
+
/** Initializing session. */
|
|
8
|
+
Initializing = 1,
|
|
7
9
|
/** Initialized but not started. */
|
|
8
|
-
Initialized =
|
|
10
|
+
Initialized = 2,
|
|
9
11
|
/** Running. */
|
|
10
|
-
Running =
|
|
12
|
+
Running = 3,
|
|
11
13
|
/** Paused. */
|
|
12
|
-
Paused =
|
|
14
|
+
Paused = 4
|
|
13
15
|
}
|