@galacean/engine-core 1.1.0-beta.20 → 1.1.0-beta.22
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 +2 -2
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +2 -2
- package/dist/module.js +2 -2
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/animation/AnimatorLayerMask.d.ts +45 -0
- package/types/animation/LayerPathMask.d.ts +16 -0
- package/types/xr/XRManager.d.ts +29 -31
- package/types/xr/feature/XRFeature.d.ts +46 -15
- package/types/xr/feature/XRFeatureManager.d.ts +1 -1
- package/types/xr/feature/XRFeatureType.d.ts +4 -6
- package/types/xr/feature/camera/XRCameraManager.d.ts +11 -12
- package/types/xr/feature/hitTest/TrackableType.d.ts +12 -0
- package/types/xr/feature/hitTest/XRHitTest.d.ts +41 -0
- package/types/xr/feature/movementTracking/XRMovementTracking.d.ts +18 -0
- package/types/xr/feature/movementTracking/XRMovementTrackingManager.d.ts +4 -2
- package/types/xr/feature/trackable/XRTrackableFeature.d.ts +44 -0
- package/types/xr/feature/trackable/XRTrackableManager.d.ts +1 -1
- package/types/xr/feature/trackable/anchor/XRAnchorTracking.d.ts +29 -0
- package/types/xr/feature/trackable/anchor/XRAnchorTrackingManager.d.ts +5 -7
- package/types/xr/feature/trackable/image/XRImageTracking.d.ts +40 -0
- package/types/xr/feature/trackable/image/XRImageTrackingManager.d.ts +3 -5
- package/types/xr/feature/trackable/image/XRReferenceImage.d.ts +3 -6
- package/types/xr/feature/trackable/plane/XRPlaneTracking.d.ts +20 -0
- package/types/xr/feature/trackable/plane/XRPlaneTrackingManager.d.ts +2 -5
- package/types/xr/index.d.ts +9 -22
- package/types/xr/input/XRCamera.d.ts +0 -2
- package/types/xr/input/XRController.d.ts +0 -2
- package/types/xr/input/XRInputManager.d.ts +0 -1
- package/types/xr/session/XRSessionManager.d.ts +4 -23
- package/types/xr/session/XRSessionMode.d.ts +8 -0
- package/types/2d/data/RenderData2D.d.ts +0 -1
- package/types/RenderPipeline/MeshRenderData.d.ts +0 -17
- package/types/RenderPipeline/MeshRenderElement.d.ts +0 -19
- package/types/RenderPipeline/RenderElementX.d.ts +0 -12
- 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/SafeLoopArray.d.ts +0 -37
- package/types/Ticker.d.ts +0 -30
- package/types/animation/internal/AnimationCurveOwnerLayerData.d.ts +0 -1
- 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/graphic/PrimitiveVertexBinding.d.ts +0 -1
- package/types/mesh/SubModelMesh.d.ts +0 -260
- package/types/particle/ParticleData.d.ts +0 -1
- package/types/particle/ParticleMesh.d.ts +0 -289
- package/types/particle/ParticleShaderDeclaration.d.ts +0 -1
- package/types/particle/ParticleShaderMacro.d.ts +0 -1
- package/types/particle/ParticleShaderProperty.d.ts +0 -1
- package/types/particle/ParticleSystem.d.ts +0 -41
- package/types/particle/ParticleVertexElements.d.ts +0 -1
- package/types/particle/ParticleVertexUtils.d.ts +0 -1
- package/types/particle/enum/ParticleAnimationRowMode.d.ts +0 -9
- package/types/particle/enum/ParticleAnimationType.d.ts +0 -9
- package/types/particle/enum/ParticleCurveMode.d.ts +0 -13
- package/types/particle/enum/ParticleGradientMode.d.ts +0 -13
- package/types/particle/enum/ParticleRenderMode.d.ts +0 -17
- package/types/particle/enum/ParticleScaleMode.d.ts +0 -11
- package/types/particle/enum/ParticleShapeMultiModeValue.d.ts +0 -9
- package/types/particle/enum/ParticleShapeType.d.ts +0 -15
- package/types/particle/enum/ParticleSimulationSpace.d.ts +0 -9
- package/types/particle/enum/index.d.ts +0 -9
- package/types/particle/module/Burst.d.ts +0 -38
- package/types/particle/module/ColorGradient.d.ts +0 -75
- package/types/particle/module/ColorOverLifetimeModule.d.ts +0 -20
- package/types/particle/module/EmissionModule.d.ts +0 -63
- package/types/particle/module/FrameOverTime.d.ts +0 -73
- package/types/particle/module/ParticleCurve.d.ts +0 -37
- package/types/particle/module/RotationOverLifetimeModule.d.ts +0 -21
- package/types/particle/module/RotationVelocityGradient.d.ts +0 -184
- package/types/particle/module/SizeGradient.d.ts +0 -151
- package/types/particle/module/SizeOverLifetimeModule.d.ts +0 -21
- package/types/particle/module/StartFrame.d.ts +0 -46
- package/types/particle/module/TextureSheetAnimationModule.d.ts +0 -37
- package/types/particle/module/VelocityGradient.d.ts +0 -110
- package/types/particle/module/VelocityOverLifetimeModule.d.ts +0 -22
- package/types/particle/module/index.d.ts +0 -15
- package/types/particle/module/shape/BaseShape.d.ts +0 -26
- package/types/particle/module/shape/BoxShape.d.ts +0 -20
- package/types/particle/module/shape/CircleShape.d.ts +0 -27
- package/types/particle/module/shape/ConeShape.d.ts +0 -35
- package/types/particle/module/shape/HemisphereShape.d.ts +0 -23
- package/types/particle/module/shape/ShapeUtils.d.ts +0 -1
- package/types/particle/module/shape/SphereShape.d.ts +0 -23
- package/types/particle/module/shape/index.d.ts +0 -5
- package/types/particle/modules/ShapeModule.d.ts +0 -9
- package/types/particle/modules/shape/enums/ParticleShapeMultiModeValue.d.ts +0 -9
- package/types/particle/moudules/Burst.d.ts +0 -25
- package/types/particle/moudules/Emission.d.ts +0 -47
- package/types/particle/moudules/EmissionModule.d.ts +0 -49
- package/types/particle/moudules/MainModule.d.ts +0 -59
- package/types/particle/moudules/ParticleCurve.d.ts +0 -27
- package/types/particle/moudules/ParticleGradient.d.ts +0 -28
- package/types/particle/moudules/ShapeModule.d.ts +0 -7
- package/types/particle/moudules/shape/BaseShape.d.ts +0 -28
- package/types/particle/moudules/shape/BoxShape.d.ts +0 -20
- package/types/particle/moudules/shape/CircleShape.d.ts +0 -27
- package/types/particle/moudules/shape/ConeShape.d.ts +0 -35
- package/types/particle/moudules/shape/HemisphereShape.d.ts +0 -23
- package/types/particle/moudules/shape/ShapeUtils.d.ts +0 -1
- package/types/particle/moudules/shape/SphereShape.d.ts +0 -23
- package/types/particle/moudules/shape/enums/ParticleShapeMultiModeValue.d.ts +0 -9
- package/types/particle/moudules/shape/enums/ParticleShapeType.d.ts +0 -15
- package/types/particle/moudules/shape/index.d.ts +0 -5
- package/types/physics/PhysicsManager.d.ts +0 -78
- package/types/shadow/PipelinePass.d.ts +0 -16
- package/types/utils/BoolUpdateFlag.d.ts +0 -12
- package/types/utils/DisorderedArray.d.ts +0 -18
- package/types/utils/UpdateFlag.d.ts +0 -20
- package/types/utils/UpdateFlagManager.d.ts +0 -1
- package/types/utils/Utils.d.ts +0 -31
- package/types/xr/IXRDevice.d.ts +0 -26
- package/types/xr/XRModule.d.ts +0 -126
- package/types/xr/component/XRPoseDriver.d.ts +0 -10
- package/types/xr/component/XRTrackingMode.d.ts +0 -15
- package/types/xr/component/trackable/XRAnchor.d.ts +0 -4
- package/types/xr/component/trackable/XRImage.d.ts +0 -6
- package/types/xr/component/trackable/XRPlane.d.ts +0 -7
- package/types/xr/component/trackable/XRTracked.d.ts +0 -13
- package/types/xr/data/XRCamera.d.ts +0 -6
- package/types/xr/data/XRDevice.d.ts +0 -9
- package/types/xr/data/XRHandle.d.ts +0 -10
- package/types/xr/enum/EnumXRButton.d.ts +0 -5
- package/types/xr/enum/EnumXRDevicePhase.d.ts +0 -4
- package/types/xr/enum/EnumXRFeature.d.ts +0 -9
- package/types/xr/enum/EnumXRInputSource.d.ts +0 -8
- package/types/xr/enum/EnumXRMode.d.ts +0 -7
- package/types/xr/enum/EnumXRSubsystem.d.ts +0 -4
- package/types/xr/enum/EnumXRTrackingMode.d.ts +0 -7
- package/types/xr/feature/XRCameraManager.d.ts +0 -21
- package/types/xr/feature/XRImageTrackManager.d.ts +0 -10
- package/types/xr/feature/XRInputManager.d.ts +0 -16
- package/types/xr/feature/XRPlatformFeature.d.ts +0 -17
- package/types/xr/feature/camera/IXRCameraDescriptor.d.ts +0 -7
- package/types/xr/feature/camera/XRPlatformCamera.d.ts +0 -5
- package/types/xr/feature/movementTracking/IXRMovementTrackingDescriptor.d.ts +0 -9
- package/types/xr/feature/movementTracking/XRPlatformMovementTracking.d.ts +0 -10
- package/types/xr/feature/trackable/XRTrackablePlatformFeature.d.ts +0 -29
- package/types/xr/feature/trackable/XRTracked.d.ts +0 -9
- package/types/xr/feature/trackable/XRTrackedUpdateFlag.d.ts +0 -11
- package/types/xr/feature/trackable/XRTrackingState.d.ts +0 -11
- package/types/xr/feature/trackable/anchor/IXRAnchorTrackingDescriptor.d.ts +0 -8
- package/types/xr/feature/trackable/anchor/XRAnchorTrackingMode.d.ts +0 -4
- package/types/xr/feature/trackable/anchor/XRPlatformAnchorTracking.d.ts +0 -12
- package/types/xr/feature/trackable/anchor/XRRequestTrackingAnchor.d.ts +0 -10
- package/types/xr/feature/trackable/image/IXRImageTrackingDescriptor.d.ts +0 -5
- package/types/xr/feature/trackable/image/XRPlatformImageTracking.d.ts +0 -14
- package/types/xr/feature/trackable/image/XRRequestTrackingImage.d.ts +0 -11
- package/types/xr/feature/trackable/image/XRTrackedImage.d.ts +0 -5
- package/types/xr/feature/trackable/plane/IXRPlaneTrackingDescriptor.d.ts +0 -9
- package/types/xr/feature/trackable/plane/XRPlaneDetectionMode.d.ts +0 -13
- package/types/xr/feature/trackable/plane/XRPlatformPlaneTracking.d.ts +0 -11
- package/types/xr/feature/trackable/plane/XRRequestTrackingPlane.d.ts +0 -11
- package/types/xr/feature/trackable/plane/XRTrackedPlane.d.ts +0 -11
- package/types/xr/input/XRInput.d.ts +0 -14
- package/types/xr/provider/XRProvider.d.ts +0 -19
- package/types/xr/session/XRSessionType.d.ts +0 -7
- package/types/xr/subsystem/XRInputSubsystem.d.ts +0 -5
- package/types/xr/subsystem/XRSubsystem.d.ts +0 -30
- /package/types/xr/feature/hitTest/{XRHItTestType.d.ts → XRHitTestType.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-core",
|
|
3
|
-
"version": "1.1.0-beta.
|
|
3
|
+
"version": "1.1.0-beta.22",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"types/**/*"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@galacean/engine-math": "1.1.0-beta.
|
|
18
|
+
"@galacean/engine-math": "1.1.0-beta.22"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@galacean/engine-design": "1.1.0-beta.
|
|
21
|
+
"@galacean/engine-design": "1.1.0-beta.22"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Entity } from "../Entity";
|
|
2
|
+
import { LayerPathMask } from "./LayerPathMask";
|
|
3
|
+
/**
|
|
4
|
+
* AnimatorLayerMask is used to mask out certain entities from being animated by an AnimatorLayer.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AnimatorLayerMask {
|
|
7
|
+
/**
|
|
8
|
+
* Creates an AnimatorLayerMask instance by specifying an entity.
|
|
9
|
+
* This will automatically add path masks for the entity and all its children.
|
|
10
|
+
* @param entity - The root entity to create path masks for
|
|
11
|
+
*/
|
|
12
|
+
static createByEntity(entity: Entity): AnimatorLayerMask;
|
|
13
|
+
private static _addPathMaskWithChildren;
|
|
14
|
+
private _pathMasks;
|
|
15
|
+
private _pathMaskMap;
|
|
16
|
+
/**
|
|
17
|
+
* The list of path masks.
|
|
18
|
+
*/
|
|
19
|
+
get pathMasks(): Readonly<LayerPathMask[]>;
|
|
20
|
+
/**
|
|
21
|
+
* Adds a path mask to the AnimatorLayerMask, the root path is "".
|
|
22
|
+
* @param path - The path to add a mask for
|
|
23
|
+
* @returns The created or existing LayerPathMask
|
|
24
|
+
*/
|
|
25
|
+
addPathMask(path: string): LayerPathMask;
|
|
26
|
+
/**
|
|
27
|
+
* Removes a path mask from the AnimatorLayerMask.
|
|
28
|
+
* @param path - The path of the mask to remove
|
|
29
|
+
*/
|
|
30
|
+
removePathMask(path: any): void;
|
|
31
|
+
/**
|
|
32
|
+
* Get a path mask based on the given path.
|
|
33
|
+
* @param path - The path of the mask to get
|
|
34
|
+
* @returns The LayerPathMask for the given path
|
|
35
|
+
*/
|
|
36
|
+
getPathMask(path: string): LayerPathMask;
|
|
37
|
+
/**
|
|
38
|
+
* Sets the active state of a path mask.
|
|
39
|
+
* If recursive is true, it also sets the active state of all child path masks.
|
|
40
|
+
* @param path - The path of the mask to modify
|
|
41
|
+
* @param active - The active state to set
|
|
42
|
+
* @param withChildren - Whether to apply the active state recursively to child paths
|
|
43
|
+
*/
|
|
44
|
+
setPathMaskActive(path: string, active: boolean, withChildren?: boolean): void;
|
|
45
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LayerPathMask represents a mask for a specific entity in an animation layer.
|
|
3
|
+
* It is used to control the animation whether to be applied to the entity or not.
|
|
4
|
+
*/
|
|
5
|
+
export declare class LayerPathMask {
|
|
6
|
+
/**
|
|
7
|
+
* It identifies a particular entity in the hierarchy.
|
|
8
|
+
* Example: "arm/left/hand" could be a path to the left hand of a character.
|
|
9
|
+
*/
|
|
10
|
+
path: string;
|
|
11
|
+
/**
|
|
12
|
+
* The active property is indicating whether the animation at this path is active or not.
|
|
13
|
+
* When true, the animation for this path is applied; when false, the animation for this path is ignored.
|
|
14
|
+
*/
|
|
15
|
+
active: boolean;
|
|
16
|
+
}
|
package/types/xr/XRManager.d.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { IXRFeatureDescriptor, IXRFeature } from "@galacean/engine-design";
|
|
2
1
|
import { XRInputManager } from "./input/XRInputManager";
|
|
3
|
-
import { XRFeatureType } from "./feature/XRFeatureType";
|
|
4
2
|
import { XRSessionManager } from "./session/XRSessionManager";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { XRCameraManager } from "./feature/camera/XRCameraManager";
|
|
4
|
+
import { XRSessionMode } from "./session/XRSessionMode";
|
|
5
|
+
import { XRFeature } from "./feature/XRFeature";
|
|
7
6
|
import { IXRDevice } from "@galacean/engine-design/src/xr/IXRDevice";
|
|
8
7
|
import { Engine } from "../Engine";
|
|
9
8
|
import { Scene } from "../Scene";
|
|
10
9
|
import { Entity } from "../Entity";
|
|
11
|
-
type
|
|
12
|
-
type TXRFeatureManagerConstructor = new (engine: Engine) => TXRFeatureManager;
|
|
10
|
+
type TConstructor<T extends new (engine: Engine, ...args: any[]) => XRFeature> = T extends new (engine: Engine, ...args: infer P) => XRFeature ? P : never;
|
|
13
11
|
/**
|
|
14
12
|
* XRManager is the entry point of the XR system.
|
|
15
13
|
*/
|
|
@@ -18,12 +16,13 @@ export declare class XRManager {
|
|
|
18
16
|
inputManager: XRInputManager;
|
|
19
17
|
/** Session manager for XR. */
|
|
20
18
|
sessionManager: XRSessionManager;
|
|
19
|
+
/** Camera manager for XR. */
|
|
20
|
+
cameraManager: XRCameraManager;
|
|
21
21
|
private _engine;
|
|
22
22
|
private _scene;
|
|
23
23
|
private _origin;
|
|
24
|
-
private _features;
|
|
25
24
|
private _mode;
|
|
26
|
-
private
|
|
25
|
+
private _features;
|
|
27
26
|
/**
|
|
28
27
|
* The current xr scene.
|
|
29
28
|
*/
|
|
@@ -37,60 +36,59 @@ export declare class XRManager {
|
|
|
37
36
|
/**
|
|
38
37
|
* The current session mode( AR or VR ).
|
|
39
38
|
*/
|
|
40
|
-
get mode():
|
|
41
|
-
/**
|
|
42
|
-
* The requested features.
|
|
43
|
-
*/
|
|
44
|
-
get requestFeatures(): IXRFeatureDescriptor[];
|
|
39
|
+
get mode(): XRSessionMode;
|
|
45
40
|
/**
|
|
46
41
|
* Check if the specified mode is supported.
|
|
47
42
|
* @param mode - The mode to check
|
|
48
43
|
* @returns A promise that resolves if the mode is supported, otherwise rejects
|
|
49
44
|
*/
|
|
50
|
-
|
|
45
|
+
isSupportedSessionMode(mode: XRSessionMode): Promise<void>;
|
|
51
46
|
/**
|
|
52
47
|
* Check if the specified feature is supported.
|
|
53
48
|
* @param descriptors - The feature descriptor to check
|
|
54
49
|
* @returns A promise that resolves if the feature is supported, otherwise rejects
|
|
55
50
|
*/
|
|
56
|
-
isSupportedFeature(
|
|
51
|
+
isSupportedFeature<T extends XRFeature>(type: new (engine: Engine) => T): Promise<void>;
|
|
57
52
|
/**
|
|
58
|
-
*
|
|
53
|
+
* Add feature based on the xr feature type.
|
|
54
|
+
* @param type - The type of the feature
|
|
55
|
+
* @returns The feature which has been added
|
|
59
56
|
*/
|
|
60
|
-
|
|
57
|
+
addFeature<T extends new (engine: Engine, ...args: any[]) => XRFeature>(type: T, ...constructor: TConstructor<T>): XRFeature | null;
|
|
61
58
|
/**
|
|
62
|
-
* Get the
|
|
63
|
-
* @param type - The type of feature
|
|
64
|
-
* @returns
|
|
59
|
+
* Get feature which match the type.
|
|
60
|
+
* @param type - The type of the feature
|
|
61
|
+
* @returns The feature which match type
|
|
65
62
|
*/
|
|
66
|
-
getFeature<T extends
|
|
63
|
+
getFeature<T extends XRFeature>(type: new (engine: Engine, ...args: any[]) => T): T | null;
|
|
64
|
+
/**
|
|
65
|
+
* Disable all features.
|
|
66
|
+
*/
|
|
67
|
+
disableAllFeatures(): void;
|
|
67
68
|
/**
|
|
68
|
-
*
|
|
69
|
-
* @
|
|
70
|
-
* @param requestFeatures - The requested features
|
|
71
|
-
* @returns A promise that resolves if the session is initialized, otherwise rejects
|
|
69
|
+
* Enter the session.
|
|
70
|
+
* @returns A promise that resolves if the session is entered, otherwise rejects
|
|
72
71
|
*/
|
|
73
|
-
|
|
72
|
+
enterXR(mode: XRSessionMode): Promise<void>;
|
|
74
73
|
/**
|
|
75
|
-
*
|
|
74
|
+
* Exit the session.
|
|
76
75
|
* @returns A promise that resolves if the session is destroyed, otherwise rejects
|
|
77
76
|
*/
|
|
78
|
-
|
|
77
|
+
exitXR(): Promise<void>;
|
|
79
78
|
/**
|
|
80
79
|
* Start the session.
|
|
81
80
|
* @returns A promise that resolves if the session is started, otherwise rejects
|
|
82
81
|
*/
|
|
83
|
-
|
|
82
|
+
run(): Promise<void>;
|
|
84
83
|
/**
|
|
85
84
|
* Stop the session.
|
|
86
85
|
* @returns A promise that resolves if the session is stopped, otherwise rejects
|
|
87
86
|
*/
|
|
88
|
-
|
|
87
|
+
stop(): Promise<void>;
|
|
89
88
|
/**
|
|
90
89
|
* Destroy xr module.
|
|
91
90
|
*/
|
|
92
91
|
destroy(): void;
|
|
93
92
|
constructor(engine: Engine, xrDevice: IXRDevice);
|
|
94
93
|
}
|
|
95
|
-
export declare function registerXRFeatureManager(feature: XRFeatureType): (featureManagerConstructor: TXRFeatureManagerConstructor) => void;
|
|
96
94
|
export {};
|
|
@@ -1,29 +1,60 @@
|
|
|
1
|
+
import { IXRFeatureConfig, IXRFeature, IXRPlatformFeature, IXRSession, IXRFrame } from "@galacean/engine-design";
|
|
1
2
|
import { Engine } from "../../Engine";
|
|
2
|
-
|
|
3
|
+
/**
|
|
4
|
+
* The base class of XR feature manager.
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class XRFeature<TConfig extends IXRFeatureConfig = IXRFeatureConfig, TFeature extends IXRPlatformFeature = IXRPlatformFeature> implements IXRFeature {
|
|
3
7
|
protected _engine: Engine;
|
|
8
|
+
_platformFeature: TFeature;
|
|
9
|
+
protected _enabled: boolean;
|
|
10
|
+
protected _config: TConfig;
|
|
4
11
|
/**
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
12
|
+
* Returns whether the feature is enabled.
|
|
13
|
+
*/
|
|
14
|
+
get enabled(): boolean;
|
|
15
|
+
set enabled(value: boolean);
|
|
16
|
+
/**
|
|
17
|
+
* Returns whether the feature is supported.
|
|
18
|
+
* @returns The promise of the feature
|
|
19
|
+
*/
|
|
20
|
+
isSupported(): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Initialize the feature.
|
|
23
|
+
* @returns The promise of the feature
|
|
24
|
+
*/
|
|
25
|
+
initialize(): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Called when be enabled.
|
|
8
28
|
*/
|
|
9
29
|
onEnable(): void;
|
|
10
30
|
/**
|
|
11
|
-
*
|
|
12
|
-
* This method needs to be override.
|
|
13
|
-
* @returns
|
|
31
|
+
* Called when be disabled.
|
|
14
32
|
*/
|
|
15
33
|
onDisable(): void;
|
|
16
34
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* @
|
|
35
|
+
* Called when xr frame is updated.
|
|
36
|
+
* @param session - The xr session
|
|
37
|
+
* @param frame - The xr frame
|
|
38
|
+
*/
|
|
39
|
+
onUpdate(session: IXRSession, frame: IXRFrame): void;
|
|
40
|
+
/**
|
|
41
|
+
* Called when the session is initialized.
|
|
42
|
+
*/
|
|
43
|
+
onSessionInit(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Called when session starts.
|
|
46
|
+
*/
|
|
47
|
+
onSessionStart(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Called when the session is stopped.
|
|
50
|
+
*/
|
|
51
|
+
onSessionStop(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Called when the session is destroyed.
|
|
20
54
|
*/
|
|
21
|
-
|
|
55
|
+
onSessionDestroy(): void;
|
|
22
56
|
/**
|
|
23
|
-
*
|
|
24
|
-
* This method needs to be override.
|
|
25
|
-
* @returns
|
|
57
|
+
* Called when the xr module is destroyed.
|
|
26
58
|
*/
|
|
27
59
|
onDestroy(): void;
|
|
28
|
-
constructor(engine: Engine);
|
|
29
60
|
}
|
|
@@ -5,7 +5,7 @@ import { Engine } from "../../Engine";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare abstract class XRFeatureManager<TDescriptor extends IXRFeatureDescriptor = IXRFeatureDescriptor, TFeature extends IXRFeature = IXRFeature> implements IXRFeatureManager {
|
|
7
7
|
protected _engine: Engine;
|
|
8
|
-
|
|
8
|
+
_platformFeature: TFeature;
|
|
9
9
|
protected _descriptor: TDescriptor;
|
|
10
10
|
protected _enabled: boolean;
|
|
11
11
|
/**
|
|
@@ -4,14 +4,12 @@
|
|
|
4
4
|
export declare enum XRFeatureType {
|
|
5
5
|
/** Movement tracking */
|
|
6
6
|
MovementTracking = 0,
|
|
7
|
-
/** Control camera parameters such as focal length, etc.*/
|
|
8
|
-
CameraDevice = 1,
|
|
9
7
|
/** Anchor tracking */
|
|
10
|
-
AnchorTracking =
|
|
8
|
+
AnchorTracking = 1,
|
|
11
9
|
/** Image tracking */
|
|
12
|
-
ImageTracking =
|
|
10
|
+
ImageTracking = 2,
|
|
13
11
|
/** Plane tracking */
|
|
14
|
-
PlaneTracking =
|
|
12
|
+
PlaneTracking = 3,
|
|
15
13
|
/** Hit test */
|
|
16
|
-
HitTest =
|
|
14
|
+
HitTest = 4
|
|
17
15
|
}
|
|
@@ -1,35 +1,34 @@
|
|
|
1
1
|
import { Camera } from "../../../Camera";
|
|
2
2
|
import { Engine } from "../../../Engine";
|
|
3
3
|
import { XRInputType } from "../../input/XRInputType";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
private
|
|
9
|
-
get enabled(): boolean;
|
|
10
|
-
set enabled(value: boolean);
|
|
4
|
+
/**
|
|
5
|
+
* The manager of XR camera.
|
|
6
|
+
*/
|
|
7
|
+
export declare class XRCameraManager {
|
|
8
|
+
private _engine;
|
|
11
9
|
/**
|
|
12
|
-
* Attach the camera to the specified input type.
|
|
10
|
+
* Attach the camera to the specified input type(Camera, LeftCamera or RightCamera).
|
|
11
|
+
* The camera entity need to be moved to the XROrigin entity.
|
|
13
12
|
* @param type - The input type
|
|
14
13
|
* @param camera - The camera to be attached
|
|
15
14
|
*/
|
|
16
|
-
attachCamera(type: XRInputType, camera: Camera): void;
|
|
15
|
+
attachCamera(type: XRInputType.Camera | XRInputType.LeftCamera | XRInputType.RightCamera, camera: Camera): void;
|
|
17
16
|
/**
|
|
18
17
|
* Detach the camera from the specified input type.
|
|
19
18
|
* @param type - The input type
|
|
20
19
|
* @returns The camera that was detached
|
|
21
20
|
*/
|
|
22
|
-
detachCamera(type: XRInputType): Camera;
|
|
21
|
+
detachCamera(type: XRInputType.Camera | XRInputType.LeftCamera | XRInputType.RightCamera): Camera;
|
|
23
22
|
/**
|
|
24
23
|
* Get the camera by the specified input type.
|
|
25
24
|
* @param type - The input type
|
|
26
25
|
* @returns The camera
|
|
27
26
|
*/
|
|
28
|
-
getCameraByType(type: XRInputType): Camera;
|
|
27
|
+
getCameraByType(type: XRInputType.Camera | XRInputType.LeftCamera | XRInputType.RightCamera): Camera;
|
|
29
28
|
/**
|
|
30
29
|
* Return fixed foveation of the camera.
|
|
31
30
|
*/
|
|
32
31
|
get fixedFoveation(): number;
|
|
33
32
|
set fixedFoveation(value: number);
|
|
34
|
-
constructor(
|
|
33
|
+
constructor(_engine: Engine);
|
|
35
34
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { IXRHitResult } from "@galacean/engine-design";
|
|
2
|
+
import { TrackableType } from "./TrackableType";
|
|
3
|
+
import { Ray } from "@galacean/engine-math";
|
|
4
|
+
import { XRFeature } from "../XRFeature";
|
|
5
|
+
import { Engine } from "../../../Engine";
|
|
6
|
+
/**
|
|
7
|
+
* The manager of XR hit test.
|
|
8
|
+
*/
|
|
9
|
+
export declare class XRHitTest extends XRFeature {
|
|
10
|
+
private _xrCameraManager;
|
|
11
|
+
private _tempRay;
|
|
12
|
+
private _tempVec2;
|
|
13
|
+
private _tempVec30;
|
|
14
|
+
private _tempVec31;
|
|
15
|
+
private _tempVec32;
|
|
16
|
+
private _tempVec33;
|
|
17
|
+
private _tempVec34;
|
|
18
|
+
private _tempVec35;
|
|
19
|
+
/**
|
|
20
|
+
* Hit test.
|
|
21
|
+
* @param ray - The ray to test
|
|
22
|
+
* @param type - The type of hit test
|
|
23
|
+
* @returns The hit result
|
|
24
|
+
*/
|
|
25
|
+
hitTest(ray: Ray, type: TrackableType): IXRHitResult[];
|
|
26
|
+
/**
|
|
27
|
+
* Screen hit test.
|
|
28
|
+
* @param x - The x coordinate of the screen point (normalized)
|
|
29
|
+
* @param y - The y coordinate of the screen point (normalized)
|
|
30
|
+
* @param type - The type of hit test
|
|
31
|
+
* @returns The hit result
|
|
32
|
+
*/
|
|
33
|
+
screenHitTest(x: number, y: number, type: TrackableType): IXRHitResult[];
|
|
34
|
+
private _hitTest;
|
|
35
|
+
/**
|
|
36
|
+
* @param engine - The engine
|
|
37
|
+
*/
|
|
38
|
+
constructor(engine: Engine);
|
|
39
|
+
private _hitTestPlane;
|
|
40
|
+
private _checkPointerWithinPlane;
|
|
41
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IXRMovementTracking, IXRMovementTrackingConfig } from "@galacean/engine-design";
|
|
2
|
+
import { XRMovementTrackingMode } from "./XRMovementTrackingMode";
|
|
3
|
+
import { XRFeature } from "../XRFeature";
|
|
4
|
+
import { Engine } from "../../../Engine";
|
|
5
|
+
/**
|
|
6
|
+
* The manager of XR movement tracking.
|
|
7
|
+
*/
|
|
8
|
+
export declare class XRMovementTracking extends XRFeature<IXRMovementTrackingConfig, IXRMovementTracking> {
|
|
9
|
+
/**
|
|
10
|
+
* Get the tracking mode.
|
|
11
|
+
*/
|
|
12
|
+
get trackingMode(): XRMovementTrackingMode;
|
|
13
|
+
/**
|
|
14
|
+
* @param engine - The engine
|
|
15
|
+
* @param trackingMode - The tracking mode
|
|
16
|
+
*/
|
|
17
|
+
constructor(engine: Engine, trackingMode?: XRMovementTrackingMode);
|
|
18
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { IXRMovementTrackingDescriptor } from "
|
|
1
|
+
import { IXRMovementTracking, IXRMovementTrackingDescriptor } from "@galacean/engine-design";
|
|
2
2
|
import { XRMovementTrackingMode } from "./XRMovementTrackingMode";
|
|
3
3
|
import { XRFeatureManager } from "../XRFeatureManager";
|
|
4
|
-
import { IXRMovementTracking } from "@galacean/engine-design";
|
|
5
4
|
export declare class XRMovementTrackingManager extends XRFeatureManager<IXRMovementTrackingDescriptor, IXRMovementTracking> {
|
|
5
|
+
/**
|
|
6
|
+
* Get the tracking mode.
|
|
7
|
+
*/
|
|
6
8
|
get trackingMode(): XRMovementTrackingMode;
|
|
7
9
|
set trackingMode(value: XRMovementTrackingMode);
|
|
8
10
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { IXRFrame, IXRSession, IXRTracked, IXRFeatureConfig, IXRRequestTracking, IXRTrackableFeature } from "@galacean/engine-design";
|
|
2
|
+
import { XRTrackedUpdateFlag } from "../../input/XRTrackedUpdateFlag";
|
|
3
|
+
import { XRFeature } from "../XRFeature";
|
|
4
|
+
import { XRTrackingState } from "../../input/XRTrackingState";
|
|
5
|
+
import { XRSessionManager } from "../../session/XRSessionManager";
|
|
6
|
+
/**
|
|
7
|
+
* The base class of XR trackable manager.
|
|
8
|
+
*/
|
|
9
|
+
export declare abstract class XRTrackableFeature<TDescriptor extends IXRFeatureConfig, TXRTracked extends IXRTracked, TXRRequestTracking extends IXRRequestTracking<TXRTracked>, TTrackableFeature extends IXRTrackableFeature<TXRTracked, TXRRequestTracking>> extends XRFeature<TDescriptor, TTrackableFeature> {
|
|
10
|
+
protected _sessionManager: XRSessionManager;
|
|
11
|
+
protected _requestTrackings: TXRRequestTracking[];
|
|
12
|
+
protected _trackedObjects: TXRTracked[];
|
|
13
|
+
protected _added: TXRTracked[];
|
|
14
|
+
protected _updated: TXRTracked[];
|
|
15
|
+
protected _removed: TXRTracked[];
|
|
16
|
+
protected _statusSnapshot: Record<number, XRTrackingState>;
|
|
17
|
+
private _trackedUpdateFlag;
|
|
18
|
+
/**
|
|
19
|
+
* Return Request tracking requirements.
|
|
20
|
+
*/
|
|
21
|
+
get requestTrackings(): readonly TXRRequestTracking[];
|
|
22
|
+
/**
|
|
23
|
+
* Returns the tracked objects.
|
|
24
|
+
*/
|
|
25
|
+
get trackedObjects(): readonly TXRTracked[];
|
|
26
|
+
/**
|
|
27
|
+
* Add a listening function to track changes.
|
|
28
|
+
* @param listener - The listening function
|
|
29
|
+
*/
|
|
30
|
+
addListener(listener: (type: XRTrackedUpdateFlag, param: readonly TXRTracked[]) => any): void;
|
|
31
|
+
/**
|
|
32
|
+
* Remove a listening function to track changes.
|
|
33
|
+
* @param listener - The listening function
|
|
34
|
+
*/
|
|
35
|
+
removeListener(listener: (type: XRTrackedUpdateFlag, param: readonly TXRTracked[]) => any): void;
|
|
36
|
+
onUpdate(session: IXRSession, frame: IXRFrame): void;
|
|
37
|
+
onSessionStop(): void;
|
|
38
|
+
onSessionDestroy(): void;
|
|
39
|
+
onDestroy(): void;
|
|
40
|
+
protected _addRequestTracking(requestTracking: TXRRequestTracking): void;
|
|
41
|
+
protected _removeRequestTracking(requestTracking: TXRRequestTracking): void;
|
|
42
|
+
protected _removeAllRequestTrackings(): void;
|
|
43
|
+
private _canModifyRequestTracking;
|
|
44
|
+
}
|
|
@@ -21,7 +21,7 @@ export declare abstract class XRTrackableManager<TDescriptor extends IXRFeatureD
|
|
|
21
21
|
* Returns the tracked objects.
|
|
22
22
|
*/
|
|
23
23
|
get trackedObjects(): readonly TXRTracked[];
|
|
24
|
-
addRequestTracking(
|
|
24
|
+
addRequestTracking(requestTracking: TXRRequestTracking): void;
|
|
25
25
|
removeRequestTracking(remove: TXRRequestTracking): void;
|
|
26
26
|
removeAllRequestTrackings(): void;
|
|
27
27
|
/**
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IXRPose, IXRTracked, IXRAnchorTracking, IXRAnchorTrackingConfig, IXRRequestAnchorTracking } from "@galacean/engine-design";
|
|
2
|
+
import { XRTrackableFeature } from "../XRTrackableFeature";
|
|
3
|
+
import { Engine } from "../../../../Engine";
|
|
4
|
+
/**
|
|
5
|
+
* The manager of XR anchor tracking.
|
|
6
|
+
*/
|
|
7
|
+
export declare class XRAnchorTracking extends XRTrackableFeature<IXRAnchorTrackingConfig, IXRTracked, IXRRequestAnchorTracking, IXRAnchorTracking> {
|
|
8
|
+
/**
|
|
9
|
+
* Add a tracking anchor.
|
|
10
|
+
* @param pose - The pose of anchor to be added
|
|
11
|
+
*/
|
|
12
|
+
addAnchor(pose: IXRPose): IXRRequestAnchorTracking;
|
|
13
|
+
/**
|
|
14
|
+
* Remove a tracking anchor.
|
|
15
|
+
* @param anchor - The anchor to be removed
|
|
16
|
+
*/
|
|
17
|
+
removeAnchor(anchor: IXRRequestAnchorTracking): void;
|
|
18
|
+
/**
|
|
19
|
+
* Remove all tracking anchors.
|
|
20
|
+
*/
|
|
21
|
+
removeAllAnchors(): void;
|
|
22
|
+
/**
|
|
23
|
+
* @param engine - The engine
|
|
24
|
+
* @param anchors - The anchors to be tracked
|
|
25
|
+
*/
|
|
26
|
+
constructor(engine: Engine, anchors?: IXRPose[]);
|
|
27
|
+
_generateConfig(): IXRAnchorTrackingConfig;
|
|
28
|
+
private _createRequestTracking;
|
|
29
|
+
}
|
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import { IXRAnchorTracking,
|
|
2
|
-
import { IXRAnchorTrackingDescriptor } from "./IXRAnchorTrackingDescriptor";
|
|
1
|
+
import { IXRPose, IXRTracked, IXRAnchorTracking, IXRRequestAnchorTracking, IXRAnchorTrackingDescriptor } from "@galacean/engine-design";
|
|
3
2
|
import { XRTrackableManager } from "../XRTrackableManager";
|
|
4
|
-
|
|
5
|
-
import { XRTracked } from "../XRTracked";
|
|
6
|
-
export declare class XRAnchorTrackingManager extends XRTrackableManager<IXRAnchorTrackingDescriptor, XRTracked, XRRequestTrackingAnchor, IXRAnchorTracking> {
|
|
3
|
+
export declare class XRAnchorTrackingManager extends XRTrackableManager<IXRAnchorTrackingDescriptor, IXRTracked, IXRRequestAnchorTracking, IXRAnchorTracking> {
|
|
7
4
|
/**
|
|
8
5
|
* Add a tracking anchor.
|
|
9
6
|
* @param pose - The pose of anchor to be added
|
|
10
7
|
*/
|
|
11
|
-
addAnchor(pose: IXRPose):
|
|
8
|
+
addAnchor(pose: IXRPose): IXRRequestAnchorTracking;
|
|
12
9
|
/**
|
|
13
10
|
* Remove a tracking anchor.
|
|
14
11
|
* @param anchor - The anchor to be removed
|
|
15
12
|
*/
|
|
16
|
-
removeAnchor(
|
|
13
|
+
removeAnchor(anchor: IXRRequestAnchorTracking): void;
|
|
17
14
|
/**
|
|
18
15
|
* Remove all tracking anchors.
|
|
19
16
|
*/
|
|
20
17
|
removeAllAnchors(): void;
|
|
21
18
|
initialize(): Promise<void>;
|
|
19
|
+
private _createRequestTracking;
|
|
22
20
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IXRTrackedImage, IXRImageTracking, IXRImageTrackingConfig, IXRRequestImageTracking, IXRReferenceImage } from "@galacean/engine-design";
|
|
2
|
+
import { XRTrackableFeature } from "../XRTrackableFeature";
|
|
3
|
+
import { XRReferenceImage } from "./XRReferenceImage";
|
|
4
|
+
import { Engine } from "../../../../Engine";
|
|
5
|
+
/**
|
|
6
|
+
* The manager of XR image tracking.
|
|
7
|
+
*/
|
|
8
|
+
export declare class XRImageTracking extends XRTrackableFeature<IXRImageTrackingConfig, IXRTrackedImage, IXRRequestImageTracking, IXRImageTracking> {
|
|
9
|
+
/**
|
|
10
|
+
* Add a tracking image
|
|
11
|
+
* @param image - xr reference image
|
|
12
|
+
*/
|
|
13
|
+
addImage(image: XRReferenceImage): void;
|
|
14
|
+
/**
|
|
15
|
+
* Add tracking images
|
|
16
|
+
* @param images - xr reference images
|
|
17
|
+
*/
|
|
18
|
+
addImage(images: XRReferenceImage[]): void;
|
|
19
|
+
/**
|
|
20
|
+
* Remove a tracking image
|
|
21
|
+
* @param image - xr reference image
|
|
22
|
+
*/
|
|
23
|
+
removeImage(image: XRReferenceImage): void;
|
|
24
|
+
/**
|
|
25
|
+
* Remove tracking images
|
|
26
|
+
* @param images - xr reference images
|
|
27
|
+
*/
|
|
28
|
+
removeImage(images: XRReferenceImage[]): void;
|
|
29
|
+
/**
|
|
30
|
+
* Remove all tracking images
|
|
31
|
+
*/
|
|
32
|
+
removeAllImages(): void;
|
|
33
|
+
/**
|
|
34
|
+
* @param engine - The engine
|
|
35
|
+
* @param images - The images to be tracked
|
|
36
|
+
*/
|
|
37
|
+
constructor(engine: Engine, images: IXRReferenceImage[]);
|
|
38
|
+
_generateConfig(): IXRImageTrackingConfig;
|
|
39
|
+
private _createRequestTracking;
|
|
40
|
+
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { IXRImageTracking } from "@galacean/engine-design";
|
|
2
|
-
import { IXRImageTrackingDescriptor } from "./IXRImageTrackingDescriptor";
|
|
1
|
+
import { IXRImageTracking, IXRRequestImageTracking, IXRTrackedImage, IXRImageTrackingDescriptor } from "@galacean/engine-design";
|
|
3
2
|
import { XRTrackableManager } from "../XRTrackableManager";
|
|
4
3
|
import { XRReferenceImage } from "./XRReferenceImage";
|
|
5
|
-
|
|
6
|
-
import { XRRequestTrackingImage } from "./XRRequestTrackingImage";
|
|
7
|
-
export declare class XRImageTrackingManager extends XRTrackableManager<IXRImageTrackingDescriptor, XRTrackedImage, XRRequestTrackingImage, IXRImageTracking> {
|
|
4
|
+
export declare class XRImageTrackingManager extends XRTrackableManager<IXRImageTrackingDescriptor, IXRTrackedImage, IXRRequestImageTracking, IXRImageTracking> {
|
|
8
5
|
/**
|
|
9
6
|
* Add a tracking image
|
|
10
7
|
* @param image - xr reference image
|
|
@@ -30,4 +27,5 @@ export declare class XRImageTrackingManager extends XRTrackableManager<IXRImageT
|
|
|
30
27
|
*/
|
|
31
28
|
removeAllImages(): void;
|
|
32
29
|
initialize(): Promise<void>;
|
|
30
|
+
private _createRequestTracking;
|
|
33
31
|
}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
+
import { IXRReferenceImage } from "@galacean/engine-design";
|
|
1
2
|
/**
|
|
2
3
|
* A reference image is an image to look for in the physical environment.
|
|
3
4
|
*/
|
|
4
|
-
export declare class XRReferenceImage {
|
|
5
|
+
export declare class XRReferenceImage implements IXRReferenceImage {
|
|
5
6
|
name: string;
|
|
6
7
|
src: string | HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | Blob | ImageData | ImageBitmap | OffscreenCanvas;
|
|
7
|
-
private _id;
|
|
8
8
|
physicalWidth: number;
|
|
9
9
|
physicalHeight: number;
|
|
10
|
-
|
|
11
|
-
constructor(name: string, src: string | HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | Blob | ImageData | ImageBitmap | OffscreenCanvas, _id?: number, physicalWidth?: number, physicalHeight?: number);
|
|
12
|
-
get id(): number;
|
|
13
|
-
dispose(): void;
|
|
10
|
+
constructor(name: string, src: string | HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | Blob | ImageData | ImageBitmap | OffscreenCanvas, physicalWidth?: number, physicalHeight?: number);
|
|
14
11
|
}
|