@galacean/engine-core 1.2.0-alpha.0 → 1.2.0-alpha.2
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/main.js +664 -566
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +664 -566
- package/dist/module.js +760 -662
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/2d/atlas/types.d.ts +2 -0
- package/types/2d/text/TextRenderer.d.ts +1 -0
- package/types/Camera.d.ts +11 -5
- package/types/Engine.d.ts +4 -2
- package/types/SystemInfo.d.ts +2 -0
- package/types/Utils.d.ts +6 -0
- package/types/asset/AssetType.d.ts +2 -0
- package/types/asset/ResourceManager.d.ts +2 -0
- package/types/input/InputManager.d.ts +0 -2
- package/types/input/interface/IInput.d.ts +0 -8
- package/types/mesh/PrimitiveMesh.d.ts +22 -0
- package/types/shaderlib/ShaderFactory.d.ts +5 -1
- package/types/xr/XRPose.d.ts +15 -0
- package/types/xr/feature/XRFeature.d.ts +16 -0
- package/types/xr/feature/XRFeatureManager.d.ts +65 -0
- package/types/xr/feature/XRFeatureType.d.ts +13 -0
- package/types/xr/feature/camera/XRCameraManager.d.ts +26 -0
- package/types/xr/feature/hitTest/TrackableType.d.ts +10 -0
- package/types/xr/feature/hitTest/XRHitResult.d.ts +19 -0
- package/types/xr/feature/hitTest/XRHitTest.d.ts +39 -0
- package/types/xr/feature/hitTest/XRHitTestManager.d.ts +38 -0
- package/types/xr/feature/hitTest/XRHitTestType.d.ts +16 -0
- package/types/xr/feature/movementTracking/XRMovementTracking.d.ts +18 -0
- package/types/xr/feature/movementTracking/XRMovementTrackingManager.d.ts +10 -0
- package/types/xr/feature/movementTracking/XRMovementTrackingMode.d.ts +5 -0
- package/types/xr/feature/trackable/XRRequestTrackingState.d.ts +11 -0
- package/types/xr/feature/trackable/XRTrackableFeature.d.ts +38 -0
- package/types/xr/feature/trackable/XRTrackableManager.d.ts +41 -0
- package/types/xr/feature/trackable/XRTracked.d.ts +1 -0
- package/types/xr/feature/trackable/anchor/XRAnchor.d.ts +6 -0
- package/types/xr/feature/trackable/anchor/XRAnchorTracking.d.ts +37 -0
- package/types/xr/feature/trackable/anchor/XRAnchorTrackingManager.d.ts +20 -0
- package/types/xr/feature/trackable/anchor/XRRequestAnchor.d.ts +15 -0
- package/types/xr/feature/trackable/image/XRImageTracking.d.ts +24 -0
- package/types/xr/feature/trackable/image/XRImageTrackingManager.d.ts +31 -0
- package/types/xr/feature/trackable/image/XRReferenceImage.d.ts +11 -0
- package/types/xr/feature/trackable/image/XRRequestImage.d.ts +13 -0
- package/types/xr/feature/trackable/image/XRTrackedImage.d.ts +8 -0
- package/types/xr/feature/trackable/plane/XRPlaneMode.d.ts +13 -0
- package/types/xr/feature/trackable/plane/XRPlaneTracking.d.ts +23 -0
- package/types/xr/feature/trackable/plane/XRPlaneTrackingManager.d.ts +11 -0
- package/types/xr/feature/trackable/plane/XRRequestPlane.d.ts +12 -0
- package/types/xr/feature/trackable/plane/XRTrackedPlane.d.ts +20 -0
- package/types/xr/index.d.ts +25 -0
- package/types/xr/input/XRCamera.d.ts +15 -0
- package/types/xr/input/XRController.d.ts +38 -0
- package/types/xr/input/XRControllerPoseMode.d.ts +9 -0
- package/types/xr/input/XRInput.d.ts +8 -0
- package/types/xr/input/XRInputButton.d.ts +19 -0
- package/types/xr/input/XRInputEvent.d.ts +24 -0
- package/types/xr/input/XRInputEventType.d.ts +11 -0
- package/types/xr/input/XRInputManager.d.ts +31 -0
- package/types/xr/input/XRInputType.d.ts +23 -0
- package/types/xr/input/XRTargetRayMode.d.ts +12 -0
- package/types/xr/input/XRTrackedInputDevice.d.ts +21 -0
- package/types/xr/input/XRTrackedUpdateFlag.d.ts +11 -0
- package/types/xr/input/XRTrackingState.d.ts +11 -0
- package/types/xr/session/XRSessionManager.d.ts +45 -0
- package/types/xr/session/XRSessionMode.d.ts +8 -0
- package/types/xr/session/XRSessionState.d.ts +13 -0
- package/types/RenderPipeline/MeshRenderElement.d.ts +0 -19
- package/types/RenderPipeline/SpriteElement.d.ts +0 -15
- package/types/RenderPipeline/SpriteMaskElement.d.ts +0 -12
- package/types/RenderPipeline/TextRenderElement.d.ts +0 -8
- package/types/asset/IRefObject.d.ts +0 -2
- package/types/asset/RefObject.d.ts +0 -27
- package/types/base/Event.d.ts +0 -24
- package/types/base/Util.d.ts +0 -14
- /package/types/{2d/data/RenderData2D.d.ts → xr/feature/trackable/XRRequestTracking.d.ts} +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Quaternion, Vector3 } from "@galacean/engine-math";
|
|
2
|
+
import { XRManager } from "../../../XRManager";
|
|
3
|
+
import { XRTrackableFeature } from "../XRTrackableFeature";
|
|
4
|
+
import { XRAnchor } from "./XRAnchor";
|
|
5
|
+
import { XRRequestAnchor } from "./XRRequestAnchor";
|
|
6
|
+
/**
|
|
7
|
+
* The manager of XR anchor tracking.
|
|
8
|
+
*/
|
|
9
|
+
export declare class XRAnchorTracking extends XRTrackableFeature<XRAnchor, XRRequestAnchor> {
|
|
10
|
+
private _anchors;
|
|
11
|
+
/**
|
|
12
|
+
* The anchors to tracking.
|
|
13
|
+
*/
|
|
14
|
+
get trackingAnchors(): readonly XRAnchor[];
|
|
15
|
+
/**
|
|
16
|
+
* The tracked anchors.
|
|
17
|
+
*/
|
|
18
|
+
get trackedAnchors(): readonly XRAnchor[];
|
|
19
|
+
/**
|
|
20
|
+
* @param xrManager - The xr manager
|
|
21
|
+
*/
|
|
22
|
+
constructor(xrManager: XRManager);
|
|
23
|
+
/**
|
|
24
|
+
* Add a anchor in XR space.
|
|
25
|
+
* @param anchor - The anchor to be added
|
|
26
|
+
*/
|
|
27
|
+
addAnchor(position: Vector3, rotation: Quaternion): XRAnchor;
|
|
28
|
+
/**
|
|
29
|
+
* Remove a anchor in XR space.
|
|
30
|
+
* @param anchor - The anchor to be removed
|
|
31
|
+
*/
|
|
32
|
+
removeAnchor(anchor: XRAnchor): void;
|
|
33
|
+
/**
|
|
34
|
+
* Remove all tracking anchors.
|
|
35
|
+
*/
|
|
36
|
+
clearAnchors(): void;
|
|
37
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IXRPose, IXRTracked, IXRAnchorTracking, IXRRequestAnchorTracking, IXRAnchorTrackingDescriptor } from "@galacean/engine-design";
|
|
2
|
+
import { XRTrackableManager } from "../XRTrackableManager";
|
|
3
|
+
export declare class XRAnchorTrackingManager extends XRTrackableManager<IXRAnchorTrackingDescriptor, IXRTracked, IXRRequestAnchorTracking, IXRAnchorTracking> {
|
|
4
|
+
/**
|
|
5
|
+
* Add a tracking anchor.
|
|
6
|
+
* @param pose - The pose of anchor to be added
|
|
7
|
+
*/
|
|
8
|
+
addAnchor(pose: IXRPose): IXRRequestAnchorTracking;
|
|
9
|
+
/**
|
|
10
|
+
* Remove a tracking anchor.
|
|
11
|
+
* @param anchor - The anchor to be removed
|
|
12
|
+
*/
|
|
13
|
+
removeAnchor(anchor: IXRRequestAnchorTracking): void;
|
|
14
|
+
/**
|
|
15
|
+
* Remove all tracking anchors.
|
|
16
|
+
*/
|
|
17
|
+
removeAllAnchors(): void;
|
|
18
|
+
initialize(): Promise<void>;
|
|
19
|
+
private _createRequestTracking;
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Quaternion, Vector3 } from "@galacean/engine-math";
|
|
2
|
+
import { XRRequestTracking } from "../XRRequestTracking";
|
|
3
|
+
import { XRAnchor } from "./XRAnchor";
|
|
4
|
+
/**
|
|
5
|
+
* The request anchor in XR space.
|
|
6
|
+
*/
|
|
7
|
+
export declare class XRRequestAnchor extends XRRequestTracking<XRAnchor> {
|
|
8
|
+
position: Vector3;
|
|
9
|
+
rotation: Quaternion;
|
|
10
|
+
/**
|
|
11
|
+
* @param position - Requests the position of the anchor to be added
|
|
12
|
+
* @param rotation - Requests the rotation of the anchor to be added
|
|
13
|
+
*/
|
|
14
|
+
constructor(position: Vector3, rotation: Quaternion);
|
|
15
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { XRManager } from "../../../XRManager";
|
|
2
|
+
import { XRTrackableFeature } from "../XRTrackableFeature";
|
|
3
|
+
import { XRReferenceImage } from "./XRReferenceImage";
|
|
4
|
+
import { XRRequestImage } from "./XRRequestImage";
|
|
5
|
+
import { XRTrackedImage } from "./XRTrackedImage";
|
|
6
|
+
/**
|
|
7
|
+
* The manager of XR image tracking.
|
|
8
|
+
*/
|
|
9
|
+
export declare class XRImageTracking extends XRTrackableFeature<XRTrackedImage, XRRequestImage> {
|
|
10
|
+
private _images;
|
|
11
|
+
/**
|
|
12
|
+
* The image to tracking.
|
|
13
|
+
*/
|
|
14
|
+
get images(): readonly XRReferenceImage[];
|
|
15
|
+
/**
|
|
16
|
+
* The tracked images.
|
|
17
|
+
*/
|
|
18
|
+
get trackedImages(): readonly XRTrackedImage[];
|
|
19
|
+
/**
|
|
20
|
+
* @param xrManager - The xr manager
|
|
21
|
+
* @param images - The images to be tracked
|
|
22
|
+
*/
|
|
23
|
+
constructor(xrManager: XRManager, images: XRReferenceImage[]);
|
|
24
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { IXRImageTracking, IXRRequestImageTracking, IXRTrackedImage, IXRImageTrackingDescriptor } from "@galacean/engine-design";
|
|
2
|
+
import { XRTrackableManager } from "../XRTrackableManager";
|
|
3
|
+
import { XRReferenceImage } from "./XRReferenceImage";
|
|
4
|
+
export declare class XRImageTrackingManager extends XRTrackableManager<IXRImageTrackingDescriptor, IXRTrackedImage, IXRRequestImageTracking, IXRImageTracking> {
|
|
5
|
+
/**
|
|
6
|
+
* Add a tracking image
|
|
7
|
+
* @param image - xr reference image
|
|
8
|
+
*/
|
|
9
|
+
addImage(image: XRReferenceImage): void;
|
|
10
|
+
/**
|
|
11
|
+
* Add tracking images
|
|
12
|
+
* @param images - xr reference images
|
|
13
|
+
*/
|
|
14
|
+
addImage(images: XRReferenceImage[]): void;
|
|
15
|
+
/**
|
|
16
|
+
* Remove a tracking image
|
|
17
|
+
* @param image - xr reference image
|
|
18
|
+
*/
|
|
19
|
+
removeImage(image: XRReferenceImage): void;
|
|
20
|
+
/**
|
|
21
|
+
* Remove tracking images
|
|
22
|
+
* @param images - xr reference images
|
|
23
|
+
*/
|
|
24
|
+
removeImage(images: XRReferenceImage[]): void;
|
|
25
|
+
/**
|
|
26
|
+
* Remove all tracking images
|
|
27
|
+
*/
|
|
28
|
+
removeAllImages(): void;
|
|
29
|
+
initialize(): Promise<void>;
|
|
30
|
+
private _createRequestTracking;
|
|
31
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IXRReferenceImage } from "@galacean/engine-design";
|
|
2
|
+
/**
|
|
3
|
+
* A reference image is an image to look for in the physical environment.
|
|
4
|
+
*/
|
|
5
|
+
export declare class XRReferenceImage implements IXRReferenceImage {
|
|
6
|
+
name: string;
|
|
7
|
+
src: string | HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | Blob | ImageData | ImageBitmap | OffscreenCanvas;
|
|
8
|
+
physicalWidth: number;
|
|
9
|
+
physicalHeight: number;
|
|
10
|
+
constructor(name: string, src: string | HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | Blob | ImageData | ImageBitmap | OffscreenCanvas, physicalWidth?: number, physicalHeight?: number);
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { XRRequestTracking } from "../XRRequestTracking";
|
|
2
|
+
import { XRReferenceImage } from "./XRReferenceImage";
|
|
3
|
+
import { XRTrackedImage } from "./XRTrackedImage";
|
|
4
|
+
/**
|
|
5
|
+
* The request image in XR space.
|
|
6
|
+
*/
|
|
7
|
+
export declare class XRRequestImage extends XRRequestTracking<XRTrackedImage> {
|
|
8
|
+
image: XRReferenceImage;
|
|
9
|
+
/**
|
|
10
|
+
* @param image - The image to be tracked
|
|
11
|
+
*/
|
|
12
|
+
constructor(image: XRReferenceImage);
|
|
13
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { XRManager } from "../../../XRManager";
|
|
2
|
+
import { XRTrackableFeature } from "../XRTrackableFeature";
|
|
3
|
+
import { XRPlaneMode } from "./XRPlaneMode";
|
|
4
|
+
import { XRRequestPlane } from "./XRRequestPlane";
|
|
5
|
+
import { XRTrackedPlane } from "./XRTrackedPlane";
|
|
6
|
+
/**
|
|
7
|
+
* The manager of plane tracking feature.
|
|
8
|
+
*/
|
|
9
|
+
export declare class XRPlaneTracking extends XRTrackableFeature<XRTrackedPlane, XRRequestPlane> {
|
|
10
|
+
/**
|
|
11
|
+
* The plane detection mode.
|
|
12
|
+
*/
|
|
13
|
+
get detectionMode(): XRPlaneMode;
|
|
14
|
+
/**
|
|
15
|
+
* The tracked planes.
|
|
16
|
+
*/
|
|
17
|
+
get trackedPlanes(): readonly XRTrackedPlane[];
|
|
18
|
+
/**
|
|
19
|
+
* @param xrManager - The xr manager
|
|
20
|
+
* @param detectionMode - The plane detection mode
|
|
21
|
+
*/
|
|
22
|
+
constructor(xrManager: XRManager, detectionMode?: XRPlaneMode);
|
|
23
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IXRPlaneTracking, IXRPlaneTrackingDescriptor, IXRRequestPlaneTracking, IXRTrackedPlane } from "@galacean/engine-design";
|
|
2
|
+
import { XRPlaneMode } from "./XRPlaneMode";
|
|
3
|
+
import { XRTrackableManager } from "../XRTrackableManager";
|
|
4
|
+
export declare class XRPlaneTrackingManager extends XRTrackableManager<IXRPlaneTrackingDescriptor, IXRTrackedPlane, IXRRequestPlaneTracking, IXRPlaneTracking> {
|
|
5
|
+
/**
|
|
6
|
+
* Return the plane detection mode for XR.
|
|
7
|
+
*/
|
|
8
|
+
get detectionMode(): XRPlaneMode;
|
|
9
|
+
set detectionMode(value: XRPlaneMode);
|
|
10
|
+
initialize(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { XRRequestTracking } from "../XRRequestTracking";
|
|
2
|
+
import { XRTrackedPlane } from "./XRTrackedPlane";
|
|
3
|
+
/**
|
|
4
|
+
* The request plane in XR space.
|
|
5
|
+
*/
|
|
6
|
+
export declare class XRRequestPlane extends XRRequestTracking<XRTrackedPlane> {
|
|
7
|
+
detectionMode: number;
|
|
8
|
+
/**
|
|
9
|
+
* @param detectionMode - The plane detection mode
|
|
10
|
+
*/
|
|
11
|
+
constructor(detectionMode: number);
|
|
12
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Vector3 } from "@galacean/engine-math";
|
|
2
|
+
import { XRTracked } from "../XRTracked";
|
|
3
|
+
import { XRPlaneMode } from "./XRPlaneMode";
|
|
4
|
+
/**
|
|
5
|
+
* The tracked plane in XR space.
|
|
6
|
+
*/
|
|
7
|
+
export declare class XRTrackedPlane extends XRTracked {
|
|
8
|
+
/** Whether the detected plane is horizontal or vertical. */
|
|
9
|
+
planeMode: XRPlaneMode;
|
|
10
|
+
/** The points that make up this plane.
|
|
11
|
+
* Note: These points are in the plane coordinate system,
|
|
12
|
+
* and their Y coordinates are all zero.
|
|
13
|
+
*/
|
|
14
|
+
polygon: Vector3[];
|
|
15
|
+
/**
|
|
16
|
+
* Whether this frame changes the attributes of the plane.
|
|
17
|
+
* Note: Includes `polygon` but no `pose`.
|
|
18
|
+
*/
|
|
19
|
+
attributesDirty: boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export { XRManager, YRManager } from "./XRManager";
|
|
2
|
+
export { XRPose } from "./XRPose";
|
|
3
|
+
export { XRFeature } from "./feature/XRFeature";
|
|
4
|
+
export { XRFeatureType } from "./feature/XRFeatureType";
|
|
5
|
+
export { XRCameraManager } from "./feature/camera/XRCameraManager";
|
|
6
|
+
export { TrackableType } from "./feature/hitTest/TrackableType";
|
|
7
|
+
export { XRHitResult } from "./feature/hitTest/XRHitResult";
|
|
8
|
+
export { XRHitTest } from "./feature/hitTest/XRHitTest";
|
|
9
|
+
export { XRRequestTrackingState } from "./feature/trackable/XRRequestTrackingState";
|
|
10
|
+
export { XRAnchorTracking } from "./feature/trackable/anchor/XRAnchorTracking";
|
|
11
|
+
export { XRImageTracking } from "./feature/trackable/image/XRImageTracking";
|
|
12
|
+
export { XRReferenceImage } from "./feature/trackable/image/XRReferenceImage";
|
|
13
|
+
export { XRPlaneMode } from "./feature/trackable/plane/XRPlaneMode";
|
|
14
|
+
export { XRPlaneTracking } from "./feature/trackable/plane/XRPlaneTracking";
|
|
15
|
+
export { XRCamera } from "./input/XRCamera";
|
|
16
|
+
export { XRController } from "./input/XRController";
|
|
17
|
+
export { XRInputButton } from "./input/XRInputButton";
|
|
18
|
+
export { XRInputEventType } from "./input/XRInputEventType";
|
|
19
|
+
export { XRInputManager } from "./input/XRInputManager";
|
|
20
|
+
export { XRTargetRayMode } from "./input/XRTargetRayMode";
|
|
21
|
+
export { XRTrackedInputDevice } from "./input/XRTrackedInputDevice";
|
|
22
|
+
export { XRTrackingState } from "./input/XRTrackingState";
|
|
23
|
+
export { XRSessionManager } from "./session/XRSessionManager";
|
|
24
|
+
export { XRSessionMode } from "./session/XRSessionMode";
|
|
25
|
+
export { XRSessionState } from "./session/XRSessionState";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IXRCamera } from "@galacean/engine-design";
|
|
2
|
+
import { Matrix, Rect } from "@galacean/engine-math";
|
|
3
|
+
import { XRPose } from "../XRPose";
|
|
4
|
+
import { XRInput } from "./XRInput";
|
|
5
|
+
/**
|
|
6
|
+
* The XR camera.
|
|
7
|
+
*/
|
|
8
|
+
export declare class XRCamera extends XRInput implements IXRCamera {
|
|
9
|
+
/** The pose of the camera in XR space. */
|
|
10
|
+
pose: XRPose;
|
|
11
|
+
/** The viewport of the camera. */
|
|
12
|
+
viewport: Rect;
|
|
13
|
+
/** The projection matrix of the camera. */
|
|
14
|
+
projectionMatrix: Matrix;
|
|
15
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { IXRController } from "@galacean/engine-design";
|
|
2
|
+
import { XRPose } from "../XRPose";
|
|
3
|
+
import { XRInput } from "./XRInput";
|
|
4
|
+
import { XRInputButton } from "./XRInputButton";
|
|
5
|
+
/**
|
|
6
|
+
* The XR controller.
|
|
7
|
+
*/
|
|
8
|
+
export declare class XRController extends XRInput implements IXRController {
|
|
9
|
+
/** The grip space pose of the controller in XR space. */
|
|
10
|
+
gripPose: XRPose;
|
|
11
|
+
/** The target ray space pose of the controller in XR space. */
|
|
12
|
+
targetRayPose: XRPose;
|
|
13
|
+
/** The currently pressed buttons of this controller. */
|
|
14
|
+
pressedButtons: XRInputButton;
|
|
15
|
+
/** Record button lifted. */
|
|
16
|
+
down: XRInputButton;
|
|
17
|
+
/** Record button pressed. */
|
|
18
|
+
up: XRInputButton;
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* Returns whether the button is pressed.
|
|
22
|
+
* @param button - The button to check
|
|
23
|
+
* @returns Whether the button is pressed
|
|
24
|
+
*/
|
|
25
|
+
isButtonDown(button: XRInputButton): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Returns whether the button is lifted.
|
|
28
|
+
* @param button - The button to check
|
|
29
|
+
* @returns Whether the button is lifted
|
|
30
|
+
*/
|
|
31
|
+
isButtonUp(button: XRInputButton): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Returns whether the button is held down.
|
|
34
|
+
* @param button - The button to check
|
|
35
|
+
* @returns Whether the button is held down
|
|
36
|
+
*/
|
|
37
|
+
isButtonHeldDown(button: XRInputButton): boolean;
|
|
38
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IXRInput } from "@galacean/engine-design";
|
|
2
|
+
import { XRTrackedInputDevice } from "./XRTrackedInputDevice";
|
|
3
|
+
import { XRTrackingState } from "./XRTrackingState";
|
|
4
|
+
export declare class XRInput implements IXRInput {
|
|
5
|
+
type: XRTrackedInputDevice;
|
|
6
|
+
/** The tracking state of xr input. */
|
|
7
|
+
trackingState: XRTrackingState;
|
|
8
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum for XR input button.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum XRInputButton {
|
|
5
|
+
/** None */
|
|
6
|
+
None = 0,
|
|
7
|
+
/** Select */
|
|
8
|
+
Select = 1,
|
|
9
|
+
/** Select */
|
|
10
|
+
Trigger = 1,
|
|
11
|
+
/** Squeeze */
|
|
12
|
+
Squeeze = 2,
|
|
13
|
+
/** TouchPad */
|
|
14
|
+
TouchPad = 4,
|
|
15
|
+
/** A */
|
|
16
|
+
AButton = 8,
|
|
17
|
+
/** B */
|
|
18
|
+
BButton = 16
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IXRInputEvent } from "@galacean/engine-design";
|
|
2
|
+
import { XRInputEventType } from "./XRInputEventType";
|
|
3
|
+
import { XRTargetRayMode } from "./XRTargetRayMode";
|
|
4
|
+
import { XRTrackedInputDevice } from "./XRTrackedInputDevice";
|
|
5
|
+
/**
|
|
6
|
+
* XR interaction events.
|
|
7
|
+
*/
|
|
8
|
+
export declare class XRInputEvent implements IXRInputEvent {
|
|
9
|
+
/**
|
|
10
|
+
* TargetRayMode indicates the method by which the target ray for
|
|
11
|
+
* the input source should be generated and how it should be presented to the user.
|
|
12
|
+
*/
|
|
13
|
+
targetRayMode: XRTargetRayMode;
|
|
14
|
+
/** The type of input event. */
|
|
15
|
+
type: XRInputEventType;
|
|
16
|
+
/** The type of input. */
|
|
17
|
+
input: XRTrackedInputDevice;
|
|
18
|
+
/** The unique ID of the touch point. (Appears only when targetRayMode is screen.)*/
|
|
19
|
+
id?: number;
|
|
20
|
+
/** The coordinate x on the screen. (Appears only when targetRayMode is screen.)*/
|
|
21
|
+
x?: number;
|
|
22
|
+
/** The coordinate y on the screen. (Appears only when targetRayMode is screen.) */
|
|
23
|
+
y?: number;
|
|
24
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { XRInput } from "./XRInput";
|
|
2
|
+
import { XRTrackedInputDevice } from "./XRTrackedInputDevice";
|
|
3
|
+
/**
|
|
4
|
+
* The manager of XR input.
|
|
5
|
+
*/
|
|
6
|
+
export declare class XRInputManager {
|
|
7
|
+
private _engine;
|
|
8
|
+
private _added;
|
|
9
|
+
private _removed;
|
|
10
|
+
private _trackedDevices;
|
|
11
|
+
private _statusSnapshot;
|
|
12
|
+
private _listeners;
|
|
13
|
+
/**
|
|
14
|
+
* Returns the tracked device instance.
|
|
15
|
+
* @param type - The tracked input device type
|
|
16
|
+
* @returns The input instance
|
|
17
|
+
*/
|
|
18
|
+
getTrackedDevice<T extends XRInput>(type: XRTrackedInputDevice): T;
|
|
19
|
+
/**
|
|
20
|
+
* Add a listener for tracked device changes.
|
|
21
|
+
* @param listener - The listener to add
|
|
22
|
+
*/
|
|
23
|
+
addTrackedDeviceChangedListener(listener: (added: readonly XRInput[], removed: readonly XRInput[]) => void): void;
|
|
24
|
+
/**
|
|
25
|
+
* Remove a listener of tracked device changes.
|
|
26
|
+
* @param listener - The listener to remove
|
|
27
|
+
*/
|
|
28
|
+
removeTrackedDeviceChangedListener(listener: (added: readonly XRInput[], removed: readonly XRInput[]) => void): void;
|
|
29
|
+
private _handleEvent;
|
|
30
|
+
private _makeUpPointerEvent;
|
|
31
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum for XR input type.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum XRInputType {
|
|
5
|
+
/** Controller */
|
|
6
|
+
Controller = 0,
|
|
7
|
+
/** Left controller */
|
|
8
|
+
LeftController = 1,
|
|
9
|
+
/** Right controller */
|
|
10
|
+
RightController = 2,
|
|
11
|
+
/** Camera */
|
|
12
|
+
Camera = 3,
|
|
13
|
+
/** Left camera */
|
|
14
|
+
LeftCamera = 4,
|
|
15
|
+
/** Right camera */
|
|
16
|
+
RightCamera = 5,
|
|
17
|
+
/** Head */
|
|
18
|
+
LeftHand = 6,
|
|
19
|
+
/** Right hand */
|
|
20
|
+
RightHand = 7,
|
|
21
|
+
/** Length of input type */
|
|
22
|
+
Length = 8
|
|
23
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TargetRayMode indicates the method by which the target ray for
|
|
3
|
+
* the input source should be generated and how it should be presented to the user.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum XRTargetRayMode {
|
|
6
|
+
/** Eye */
|
|
7
|
+
Gaze = 0,
|
|
8
|
+
/** Controller */
|
|
9
|
+
TrackedPointer = 1,
|
|
10
|
+
/** Game pad */
|
|
11
|
+
Screen = 2
|
|
12
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enumerates some input devices that can be tracked.(including status, posture and other information)
|
|
3
|
+
*/
|
|
4
|
+
export declare enum XRTrackedInputDevice {
|
|
5
|
+
/** Controller */
|
|
6
|
+
Controller = 0,
|
|
7
|
+
/** Left controller */
|
|
8
|
+
LeftController = 1,
|
|
9
|
+
/** Right controller */
|
|
10
|
+
RightController = 2,
|
|
11
|
+
/** Camera */
|
|
12
|
+
Camera = 3,
|
|
13
|
+
/** Left camera */
|
|
14
|
+
LeftCamera = 4,
|
|
15
|
+
/** Right camera */
|
|
16
|
+
RightCamera = 5,
|
|
17
|
+
/** Head */
|
|
18
|
+
LeftHand = 6,
|
|
19
|
+
/** Right hand */
|
|
20
|
+
RightHand = 7
|
|
21
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum for XR tracked update flag.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum XRTrackedUpdateFlag {
|
|
5
|
+
/** The object that was not tracked in the previous frame was tracked in this frame. */
|
|
6
|
+
Added = 0,
|
|
7
|
+
/** Both the previous frame and this frame are tracked */
|
|
8
|
+
Updated = 1,
|
|
9
|
+
/** The object that was tracked in the previous frame is not tracked in this frame. */
|
|
10
|
+
Removed = 2
|
|
11
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Engine } from "../../Engine";
|
|
2
|
+
import { XRSessionMode } from "./XRSessionMode";
|
|
3
|
+
import { XRSessionState } from "./XRSessionState";
|
|
4
|
+
/**
|
|
5
|
+
* XRSessionManager manages the life cycle of XR sessions.
|
|
6
|
+
*/
|
|
7
|
+
export declare class XRSessionManager {
|
|
8
|
+
protected _engine: Engine;
|
|
9
|
+
private _mode;
|
|
10
|
+
private _state;
|
|
11
|
+
private _rhi;
|
|
12
|
+
private _raf;
|
|
13
|
+
private _caf;
|
|
14
|
+
/**
|
|
15
|
+
* The current session mode( AR or VR ).
|
|
16
|
+
*/
|
|
17
|
+
get mode(): XRSessionMode;
|
|
18
|
+
/**
|
|
19
|
+
* Return the current session state.
|
|
20
|
+
*/
|
|
21
|
+
get state(): XRSessionState;
|
|
22
|
+
/**
|
|
23
|
+
* Return a list of supported frame rates.(only available in-session)
|
|
24
|
+
*/
|
|
25
|
+
get supportedFrameRate(): Float32Array;
|
|
26
|
+
/**
|
|
27
|
+
* Return the current frame rate as reported by the device.
|
|
28
|
+
*/
|
|
29
|
+
get frameRate(): number;
|
|
30
|
+
/**
|
|
31
|
+
* Check if the specified mode is supported.
|
|
32
|
+
* @param mode - The mode to check
|
|
33
|
+
* @returns A promise that resolves if the mode is supported, otherwise rejects
|
|
34
|
+
*/
|
|
35
|
+
isSupportedMode(mode: XRSessionMode): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Run the session.
|
|
38
|
+
*/
|
|
39
|
+
run(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Stop the session.
|
|
42
|
+
*/
|
|
43
|
+
stop(): void;
|
|
44
|
+
private _onSessionExit;
|
|
45
|
+
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Mesh } from "../graphic/Mesh";
|
|
2
|
-
import { SubMesh } from "../graphic/SubMesh";
|
|
3
|
-
import { Material } from "../material/Material";
|
|
4
|
-
import { Renderer } from "../Renderer";
|
|
5
|
-
import { ShaderPass } from "../shader/ShaderPass";
|
|
6
|
-
import { RenderState } from "../shader/state/RenderState";
|
|
7
|
-
import { IPoolElement } from "./IPoolElement";
|
|
8
|
-
import { RenderElement } from "./RenderElement";
|
|
9
|
-
/**
|
|
10
|
-
* Render element.
|
|
11
|
-
*/
|
|
12
|
-
export declare class MeshRenderElement extends RenderElement implements IPoolElement {
|
|
13
|
-
/** Mesh. */
|
|
14
|
-
mesh: Mesh;
|
|
15
|
-
/** Sub mesh. */
|
|
16
|
-
subMesh: SubMesh;
|
|
17
|
-
setValue(component: Renderer, mesh: Mesh, subMesh: SubMesh, material: Material, renderState: RenderState, shaderPass: ShaderPass): void;
|
|
18
|
-
dispose(): void;
|
|
19
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { RenderData2D } from "../2d/data/RenderData2D";
|
|
2
|
-
import { Material } from "../material/Material";
|
|
3
|
-
import { Renderer } from "../Renderer";
|
|
4
|
-
import { ShaderPass } from "../shader";
|
|
5
|
-
import { RenderState } from "../shader/state/RenderState";
|
|
6
|
-
import { Texture2D } from "../texture";
|
|
7
|
-
import { IPoolElement } from "./IPoolElement";
|
|
8
|
-
import { RenderElement } from "./RenderElement";
|
|
9
|
-
export declare class SpriteElement extends RenderElement implements IPoolElement {
|
|
10
|
-
renderData: RenderData2D;
|
|
11
|
-
texture: Texture2D;
|
|
12
|
-
constructor();
|
|
13
|
-
setValue(component: Renderer, renderDate: RenderData2D, material: Material, texture: Texture2D, renderState: RenderState, shaderPass: ShaderPass): void;
|
|
14
|
-
dispose(): void;
|
|
15
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { RenderData2D } from "../2d/data/RenderData2D";
|
|
2
|
-
import { Material } from "../material/Material";
|
|
3
|
-
import { Renderer } from "../Renderer";
|
|
4
|
-
import { IPoolElement } from "./IPoolElement";
|
|
5
|
-
import { RenderElement } from "./RenderElement";
|
|
6
|
-
export declare class SpriteMaskElement extends RenderElement implements IPoolElement {
|
|
7
|
-
renderData: RenderData2D;
|
|
8
|
-
isAdd: boolean;
|
|
9
|
-
constructor();
|
|
10
|
-
setValue(component: Renderer, renderData: RenderData2D, material: Material): void;
|
|
11
|
-
dispose(): void;
|
|
12
|
-
}
|