@galacean/engine-core 1.1.0-beta.22 → 1.1.0-beta.24
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 +10 -8
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +11 -9
- package/dist/module.js +10 -8
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/2d/data/RenderData2D.d.ts +1 -0
- package/types/RenderPipeline/MeshRenderData.d.ts +17 -0
- package/types/RenderPipeline/MeshRenderElement.d.ts +19 -0
- package/types/RenderPipeline/SpriteElement.d.ts +15 -0
- package/types/RenderPipeline/SpriteMaskElement.d.ts +12 -0
- package/types/RenderPipeline/TextRenderElement.d.ts +8 -0
- package/types/asset/IRefObject.d.ts +2 -0
- package/types/asset/RefObject.d.ts +27 -0
- package/types/base/Event.d.ts +24 -0
- package/types/base/Util.d.ts +14 -0
- package/types/physics/PhysicsManager.d.ts +78 -0
- package/types/animation/AnimatorLayerMask.d.ts +0 -45
- package/types/animation/LayerPathMask.d.ts +0 -16
- package/types/xr/XRManager.d.ts +0 -94
- package/types/xr/feature/XRFeature.d.ts +0 -60
- package/types/xr/feature/XRFeatureManager.d.ts +0 -65
- package/types/xr/feature/XRFeatureType.d.ts +0 -15
- package/types/xr/feature/camera/XRCameraManager.d.ts +0 -34
- package/types/xr/feature/hitTest/TrackableType.d.ts +0 -12
- package/types/xr/feature/hitTest/XRHitTest.d.ts +0 -41
- package/types/xr/feature/hitTest/XRHitTestManager.d.ts +0 -38
- package/types/xr/feature/hitTest/XRHitTestType.d.ts +0 -16
- package/types/xr/feature/movementTracking/XRMovementTracking.d.ts +0 -18
- package/types/xr/feature/movementTracking/XRMovementTrackingManager.d.ts +0 -10
- package/types/xr/feature/movementTracking/XRMovementTrackingMode.d.ts +0 -5
- package/types/xr/feature/trackable/XRRequestTrackingState.d.ts +0 -11
- package/types/xr/feature/trackable/XRTrackableFeature.d.ts +0 -44
- package/types/xr/feature/trackable/XRTrackableManager.d.ts +0 -41
- package/types/xr/feature/trackable/anchor/XRAnchorTracking.d.ts +0 -29
- package/types/xr/feature/trackable/anchor/XRAnchorTrackingManager.d.ts +0 -20
- package/types/xr/feature/trackable/image/XRImageTracking.d.ts +0 -40
- package/types/xr/feature/trackable/image/XRImageTrackingManager.d.ts +0 -31
- package/types/xr/feature/trackable/image/XRReferenceImage.d.ts +0 -11
- package/types/xr/feature/trackable/plane/XRPlaneMode.d.ts +0 -13
- package/types/xr/feature/trackable/plane/XRPlaneTracking.d.ts +0 -20
- package/types/xr/feature/trackable/plane/XRPlaneTrackingManager.d.ts +0 -11
- package/types/xr/index.d.ts +0 -26
- package/types/xr/input/XRCamera.d.ts +0 -26
- package/types/xr/input/XRController.d.ts +0 -36
- package/types/xr/input/XRControllerPoseMode.d.ts +0 -9
- package/types/xr/input/XRInputButton.d.ts +0 -19
- package/types/xr/input/XRInputEvent.d.ts +0 -24
- package/types/xr/input/XRInputEventType.d.ts +0 -11
- package/types/xr/input/XRInputManager.d.ts +0 -57
- package/types/xr/input/XRInputType.d.ts +0 -23
- package/types/xr/input/XRTargetRayMode.d.ts +0 -12
- package/types/xr/input/XRTrackedUpdateFlag.d.ts +0 -11
- package/types/xr/input/XRTrackingState.d.ts +0 -11
- package/types/xr/session/XRSessionManager.d.ts +0 -57
- package/types/xr/session/XRSessionMode.d.ts +0 -8
- package/types/xr/session/XRSessionState.d.ts +0 -13
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.24",
|
|
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.24"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@galacean/engine-design": "1.1.0-beta.
|
|
21
|
+
"@galacean/engine-design": "1.1.0-beta.24"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
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 { IPoolElement } from "./IPoolElement";
|
|
6
|
+
import { RenderData } from "./RenderData";
|
|
7
|
+
/**
|
|
8
|
+
* Render element.
|
|
9
|
+
*/
|
|
10
|
+
export declare class MeshRenderData extends RenderData implements IPoolElement {
|
|
11
|
+
/** Mesh. */
|
|
12
|
+
mesh: Mesh;
|
|
13
|
+
/** Sub mesh. */
|
|
14
|
+
subMesh: SubMesh;
|
|
15
|
+
set(component: Renderer, material: Material, mesh: Mesh, subMesh: SubMesh): void;
|
|
16
|
+
dispose(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IPoolElement } from "./IPoolElement";
|
|
2
|
+
import { RenderElement } from "./RenderElement";
|
|
3
|
+
import { SpriteElement } from "./SpriteElement";
|
|
4
|
+
export declare class TextRenderElement extends RenderElement implements IPoolElement {
|
|
5
|
+
charElements: SpriteElement[];
|
|
6
|
+
constructor();
|
|
7
|
+
dispose(): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { EngineObject } from "../base/EngineObject";
|
|
2
|
+
import { Engine } from "../Engine";
|
|
3
|
+
import { IRefObject } from "./IRefObject";
|
|
4
|
+
/**
|
|
5
|
+
* The base class of assets, with reference counting capability.
|
|
6
|
+
*/
|
|
7
|
+
export declare abstract class RefObject extends EngineObject implements IRefObject {
|
|
8
|
+
/** Whether to ignore the garbage collection check, if it is true, it will not be affected by ResourceManager.gc(). */
|
|
9
|
+
isGCIgnored: boolean;
|
|
10
|
+
private _refCount;
|
|
11
|
+
/**
|
|
12
|
+
* Counted by valid references.
|
|
13
|
+
*/
|
|
14
|
+
get refCount(): number;
|
|
15
|
+
protected constructor(engine: Engine);
|
|
16
|
+
/**
|
|
17
|
+
* Destroy self.
|
|
18
|
+
* @param force - Whether to force the destruction, if it is false, refCount = 0 can be released successfully.
|
|
19
|
+
* @returns Whether the release was successful.
|
|
20
|
+
*/
|
|
21
|
+
destroy(force?: boolean): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Called when the resource is destroyed.
|
|
24
|
+
* Subclasses can override this function.
|
|
25
|
+
*/
|
|
26
|
+
protected abstract _onDestroy(): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { EventDispatcher } from "./EventDispatcher";
|
|
2
|
+
export type Listener = ((e: Event) => any) & {
|
|
3
|
+
once?: boolean;
|
|
4
|
+
};
|
|
5
|
+
/** Event Object. * @class */
|
|
6
|
+
export declare class Event {
|
|
7
|
+
get propagationStopped(): boolean;
|
|
8
|
+
get target(): EventDispatcher;
|
|
9
|
+
set target(t: EventDispatcher);
|
|
10
|
+
get timeStamp(): number;
|
|
11
|
+
get currentTarget(): EventDispatcher;
|
|
12
|
+
set currentTarget(t: EventDispatcher);
|
|
13
|
+
get bubbles(): boolean;
|
|
14
|
+
get type(): string | number;
|
|
15
|
+
data: any;
|
|
16
|
+
private _timeStamp;
|
|
17
|
+
private _target;
|
|
18
|
+
private _currentTarget;
|
|
19
|
+
private _bubbles;
|
|
20
|
+
private _propagationStopped;
|
|
21
|
+
private _type;
|
|
22
|
+
constructor(type: string | number, target?: EventDispatcher, data?: any, bubbles?: boolean);
|
|
23
|
+
stopPropagation(): void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const Util: {
|
|
2
|
+
isArray: (value: any) => boolean;
|
|
3
|
+
isArrayLike(x: any): boolean;
|
|
4
|
+
clone<T>(obj: T): T;
|
|
5
|
+
downloadBlob(blob: Blob, fileName?: string): void;
|
|
6
|
+
};
|
|
7
|
+
export declare const isArrayLike: <T>(x: any) => x is ArrayLike<T>;
|
|
8
|
+
/**
|
|
9
|
+
* Fastly remove an element from array.
|
|
10
|
+
* @param array - Array
|
|
11
|
+
* @param item - Element
|
|
12
|
+
*/
|
|
13
|
+
export declare function removeFromArray(array: any[], item: any): boolean;
|
|
14
|
+
export declare function ObjectValues(obj: any): any[];
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Ray, Vector3 } from "@galacean/engine-math";
|
|
2
|
+
import { Engine } from "../Engine";
|
|
3
|
+
import { Layer } from "../Layer";
|
|
4
|
+
import { HitResult } from "./HitResult";
|
|
5
|
+
/**
|
|
6
|
+
* A physics manager is a collection of colliders and constraints which can interact.
|
|
7
|
+
*/
|
|
8
|
+
export declare class PhysicsManager {
|
|
9
|
+
private static _collision;
|
|
10
|
+
private _engine;
|
|
11
|
+
private _restTime;
|
|
12
|
+
private _fixedTimeStep;
|
|
13
|
+
private _colliders;
|
|
14
|
+
private _gravity;
|
|
15
|
+
private _nativePhysicsManager;
|
|
16
|
+
private _physicalObjectsMap;
|
|
17
|
+
private _onContactEnter;
|
|
18
|
+
private _onContactExit;
|
|
19
|
+
private _onContactStay;
|
|
20
|
+
private _onTriggerEnter;
|
|
21
|
+
private _onTriggerExit;
|
|
22
|
+
private _onTriggerStay;
|
|
23
|
+
/**
|
|
24
|
+
* The gravity of physics scene.
|
|
25
|
+
*/
|
|
26
|
+
get gravity(): Vector3;
|
|
27
|
+
set gravity(value: Vector3);
|
|
28
|
+
/** The fixed time step in seconds at which physics are performed. */
|
|
29
|
+
get fixedTimeStep(): number;
|
|
30
|
+
set fixedTimeStep(value: number);
|
|
31
|
+
constructor(engine: Engine);
|
|
32
|
+
/**
|
|
33
|
+
* Casts a ray through the Scene and returns the first hit.
|
|
34
|
+
* @param ray - The ray
|
|
35
|
+
* @returns Returns True if the ray intersects with a collider, otherwise false
|
|
36
|
+
*/
|
|
37
|
+
raycast(ray: Ray): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Casts a ray through the Scene and returns the first hit.
|
|
40
|
+
* @param ray - The ray
|
|
41
|
+
* @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
|
|
42
|
+
* @returns Returns True if the ray intersects with a collider, otherwise false
|
|
43
|
+
*/
|
|
44
|
+
raycast(ray: Ray, outHitResult: HitResult): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Casts a ray through the Scene and returns the first hit.
|
|
47
|
+
* @param ray - The ray
|
|
48
|
+
* @param distance - The max distance the ray should check
|
|
49
|
+
* @returns Returns True if the ray intersects with a collider, otherwise false
|
|
50
|
+
*/
|
|
51
|
+
raycast(ray: Ray, distance: number): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Casts a ray through the Scene and returns the first hit.
|
|
54
|
+
* @param ray - The ray
|
|
55
|
+
* @param distance - The max distance the ray should check
|
|
56
|
+
* @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
|
|
57
|
+
* @returns Returns True if the ray intersects with a collider, otherwise false
|
|
58
|
+
*/
|
|
59
|
+
raycast(ray: Ray, distance: number, outHitResult: HitResult): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Casts a ray through the Scene and returns the first hit.
|
|
62
|
+
* @param ray - The ray
|
|
63
|
+
* @param distance - The max distance the ray should check
|
|
64
|
+
* @param layerMask - Layer mask that is used to selectively ignore Colliders when casting
|
|
65
|
+
* @returns Returns True if the ray intersects with a collider, otherwise false
|
|
66
|
+
*/
|
|
67
|
+
raycast(ray: Ray, distance: number, layerMask: Layer): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Casts a ray through the Scene and returns the first hit.
|
|
70
|
+
* @param ray - The ray
|
|
71
|
+
* @param distance - The max distance the ray should check
|
|
72
|
+
* @param layerMask - Layer mask that is used to selectively ignore Colliders when casting
|
|
73
|
+
* @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
|
|
74
|
+
* @returns Returns True if the ray intersects with a collider, otherwise false.
|
|
75
|
+
*/
|
|
76
|
+
raycast(ray: Ray, distance: number, layerMask: Layer, outHitResult: HitResult): boolean;
|
|
77
|
+
private _setGravity;
|
|
78
|
+
}
|
|
@@ -1,45 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { XRInputManager } from "./input/XRInputManager";
|
|
2
|
-
import { XRSessionManager } from "./session/XRSessionManager";
|
|
3
|
-
import { XRCameraManager } from "./feature/camera/XRCameraManager";
|
|
4
|
-
import { XRSessionMode } from "./session/XRSessionMode";
|
|
5
|
-
import { XRFeature } from "./feature/XRFeature";
|
|
6
|
-
import { IXRDevice } from "@galacean/engine-design/src/xr/IXRDevice";
|
|
7
|
-
import { Engine } from "../Engine";
|
|
8
|
-
import { Scene } from "../Scene";
|
|
9
|
-
import { Entity } from "../Entity";
|
|
10
|
-
type TConstructor<T extends new (engine: Engine, ...args: any[]) => XRFeature> = T extends new (engine: Engine, ...args: infer P) => XRFeature ? P : never;
|
|
11
|
-
/**
|
|
12
|
-
* XRManager is the entry point of the XR system.
|
|
13
|
-
*/
|
|
14
|
-
export declare class XRManager {
|
|
15
|
-
/** Input manager for XR. */
|
|
16
|
-
inputManager: XRInputManager;
|
|
17
|
-
/** Session manager for XR. */
|
|
18
|
-
sessionManager: XRSessionManager;
|
|
19
|
-
/** Camera manager for XR. */
|
|
20
|
-
cameraManager: XRCameraManager;
|
|
21
|
-
private _engine;
|
|
22
|
-
private _scene;
|
|
23
|
-
private _origin;
|
|
24
|
-
private _mode;
|
|
25
|
-
private _features;
|
|
26
|
-
/**
|
|
27
|
-
* The current xr scene.
|
|
28
|
-
*/
|
|
29
|
-
get scene(): Scene;
|
|
30
|
-
set scene(value: Scene);
|
|
31
|
-
/**
|
|
32
|
-
* The current xr origin.
|
|
33
|
-
*/
|
|
34
|
-
get origin(): Entity;
|
|
35
|
-
set origin(value: Entity);
|
|
36
|
-
/**
|
|
37
|
-
* The current session mode( AR or VR ).
|
|
38
|
-
*/
|
|
39
|
-
get mode(): XRSessionMode;
|
|
40
|
-
/**
|
|
41
|
-
* Check if the specified mode is supported.
|
|
42
|
-
* @param mode - The mode to check
|
|
43
|
-
* @returns A promise that resolves if the mode is supported, otherwise rejects
|
|
44
|
-
*/
|
|
45
|
-
isSupportedSessionMode(mode: XRSessionMode): Promise<void>;
|
|
46
|
-
/**
|
|
47
|
-
* Check if the specified feature is supported.
|
|
48
|
-
* @param descriptors - The feature descriptor to check
|
|
49
|
-
* @returns A promise that resolves if the feature is supported, otherwise rejects
|
|
50
|
-
*/
|
|
51
|
-
isSupportedFeature<T extends XRFeature>(type: new (engine: Engine) => T): Promise<void>;
|
|
52
|
-
/**
|
|
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
|
|
56
|
-
*/
|
|
57
|
-
addFeature<T extends new (engine: Engine, ...args: any[]) => XRFeature>(type: T, ...constructor: TConstructor<T>): XRFeature | null;
|
|
58
|
-
/**
|
|
59
|
-
* Get feature which match the type.
|
|
60
|
-
* @param type - The type of the feature
|
|
61
|
-
* @returns The feature which match type
|
|
62
|
-
*/
|
|
63
|
-
getFeature<T extends XRFeature>(type: new (engine: Engine, ...args: any[]) => T): T | null;
|
|
64
|
-
/**
|
|
65
|
-
* Disable all features.
|
|
66
|
-
*/
|
|
67
|
-
disableAllFeatures(): void;
|
|
68
|
-
/**
|
|
69
|
-
* Enter the session.
|
|
70
|
-
* @returns A promise that resolves if the session is entered, otherwise rejects
|
|
71
|
-
*/
|
|
72
|
-
enterXR(mode: XRSessionMode): Promise<void>;
|
|
73
|
-
/**
|
|
74
|
-
* Exit the session.
|
|
75
|
-
* @returns A promise that resolves if the session is destroyed, otherwise rejects
|
|
76
|
-
*/
|
|
77
|
-
exitXR(): Promise<void>;
|
|
78
|
-
/**
|
|
79
|
-
* Start the session.
|
|
80
|
-
* @returns A promise that resolves if the session is started, otherwise rejects
|
|
81
|
-
*/
|
|
82
|
-
run(): Promise<void>;
|
|
83
|
-
/**
|
|
84
|
-
* Stop the session.
|
|
85
|
-
* @returns A promise that resolves if the session is stopped, otherwise rejects
|
|
86
|
-
*/
|
|
87
|
-
stop(): Promise<void>;
|
|
88
|
-
/**
|
|
89
|
-
* Destroy xr module.
|
|
90
|
-
*/
|
|
91
|
-
destroy(): void;
|
|
92
|
-
constructor(engine: Engine, xrDevice: IXRDevice);
|
|
93
|
-
}
|
|
94
|
-
export {};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { IXRFeatureConfig, IXRFeature, IXRPlatformFeature, IXRSession, IXRFrame } from "@galacean/engine-design";
|
|
2
|
-
import { Engine } from "../../Engine";
|
|
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 {
|
|
7
|
-
protected _engine: Engine;
|
|
8
|
-
_platformFeature: TFeature;
|
|
9
|
-
protected _enabled: boolean;
|
|
10
|
-
protected _config: TConfig;
|
|
11
|
-
/**
|
|
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.
|
|
28
|
-
*/
|
|
29
|
-
onEnable(): void;
|
|
30
|
-
/**
|
|
31
|
-
* Called when be disabled.
|
|
32
|
-
*/
|
|
33
|
-
onDisable(): void;
|
|
34
|
-
/**
|
|
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.
|
|
54
|
-
*/
|
|
55
|
-
onSessionDestroy(): void;
|
|
56
|
-
/**
|
|
57
|
-
* Called when the xr module is destroyed.
|
|
58
|
-
*/
|
|
59
|
-
onDestroy(): void;
|
|
60
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { IXRFeatureDescriptor, IXRFeatureManager, IXRFeature, IXRSession, IXRFrame } from "@galacean/engine-design";
|
|
2
|
-
import { Engine } from "../../Engine";
|
|
3
|
-
/**
|
|
4
|
-
* The base class of XR feature manager.
|
|
5
|
-
*/
|
|
6
|
-
export declare abstract class XRFeatureManager<TDescriptor extends IXRFeatureDescriptor = IXRFeatureDescriptor, TFeature extends IXRFeature = IXRFeature> implements IXRFeatureManager {
|
|
7
|
-
protected _engine: Engine;
|
|
8
|
-
_platformFeature: TFeature;
|
|
9
|
-
protected _descriptor: TDescriptor;
|
|
10
|
-
protected _enabled: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Return the descriptor of the feature.
|
|
13
|
-
*/
|
|
14
|
-
get descriptor(): TDescriptor;
|
|
15
|
-
set descriptor(value: TDescriptor);
|
|
16
|
-
/**
|
|
17
|
-
* Returns whether the feature is enabled.
|
|
18
|
-
*/
|
|
19
|
-
get enabled(): boolean;
|
|
20
|
-
set enabled(value: boolean);
|
|
21
|
-
/**
|
|
22
|
-
* Returns whether the feature is supported.
|
|
23
|
-
* @param descriptor - The descriptor of the feature
|
|
24
|
-
* @returns The promise of the feature
|
|
25
|
-
*/
|
|
26
|
-
isSupported(descriptor?: IXRFeatureDescriptor): Promise<void>;
|
|
27
|
-
/**
|
|
28
|
-
* Initialize the feature.
|
|
29
|
-
* @returns The promise of the feature
|
|
30
|
-
*/
|
|
31
|
-
initialize(): Promise<void>;
|
|
32
|
-
/**
|
|
33
|
-
* Called when be enabled.
|
|
34
|
-
*/
|
|
35
|
-
onEnable(): void;
|
|
36
|
-
/**
|
|
37
|
-
* Called when be disabled.
|
|
38
|
-
*/
|
|
39
|
-
onDisable(): void;
|
|
40
|
-
/**
|
|
41
|
-
* Called when xr frame is updated.
|
|
42
|
-
*/
|
|
43
|
-
onUpdate(session: IXRSession, frame: IXRFrame): void;
|
|
44
|
-
/**
|
|
45
|
-
* Called when the session is initialized.
|
|
46
|
-
*/
|
|
47
|
-
onSessionInit(): void;
|
|
48
|
-
/**
|
|
49
|
-
* Called when session starts.
|
|
50
|
-
*/
|
|
51
|
-
onSessionStart(): void;
|
|
52
|
-
/**
|
|
53
|
-
* Called when the session is stopped.
|
|
54
|
-
*/
|
|
55
|
-
onSessionStop(): void;
|
|
56
|
-
/**
|
|
57
|
-
* Called when the session is destroyed.
|
|
58
|
-
*/
|
|
59
|
-
onSessionDestroy(): void;
|
|
60
|
-
/**
|
|
61
|
-
* Called when the xr module is destroyed.
|
|
62
|
-
*/
|
|
63
|
-
onDestroy(): void;
|
|
64
|
-
constructor(_engine: Engine);
|
|
65
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enum for XR feature type.
|
|
3
|
-
*/
|
|
4
|
-
export declare enum XRFeatureType {
|
|
5
|
-
/** Movement tracking */
|
|
6
|
-
MovementTracking = 0,
|
|
7
|
-
/** Anchor tracking */
|
|
8
|
-
AnchorTracking = 1,
|
|
9
|
-
/** Image tracking */
|
|
10
|
-
ImageTracking = 2,
|
|
11
|
-
/** Plane tracking */
|
|
12
|
-
PlaneTracking = 3,
|
|
13
|
-
/** Hit test */
|
|
14
|
-
HitTest = 4
|
|
15
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Camera } from "../../../Camera";
|
|
2
|
-
import { Engine } from "../../../Engine";
|
|
3
|
-
import { XRInputType } from "../../input/XRInputType";
|
|
4
|
-
/**
|
|
5
|
-
* The manager of XR camera.
|
|
6
|
-
*/
|
|
7
|
-
export declare class XRCameraManager {
|
|
8
|
-
private _engine;
|
|
9
|
-
/**
|
|
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.
|
|
12
|
-
* @param type - The input type
|
|
13
|
-
* @param camera - The camera to be attached
|
|
14
|
-
*/
|
|
15
|
-
attachCamera(type: XRInputType.Camera | XRInputType.LeftCamera | XRInputType.RightCamera, camera: Camera): void;
|
|
16
|
-
/**
|
|
17
|
-
* Detach the camera from the specified input type.
|
|
18
|
-
* @param type - The input type
|
|
19
|
-
* @returns The camera that was detached
|
|
20
|
-
*/
|
|
21
|
-
detachCamera(type: XRInputType.Camera | XRInputType.LeftCamera | XRInputType.RightCamera): Camera;
|
|
22
|
-
/**
|
|
23
|
-
* Get the camera by the specified input type.
|
|
24
|
-
* @param type - The input type
|
|
25
|
-
* @returns The camera
|
|
26
|
-
*/
|
|
27
|
-
getCameraByType(type: XRInputType.Camera | XRInputType.LeftCamera | XRInputType.RightCamera): Camera;
|
|
28
|
-
/**
|
|
29
|
-
* Return fixed foveation of the camera.
|
|
30
|
-
*/
|
|
31
|
-
get fixedFoveation(): number;
|
|
32
|
-
set fixedFoveation(value: number);
|
|
33
|
-
constructor(_engine: Engine);
|
|
34
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
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
|
-
}
|