-
-
Notifications
You must be signed in to change notification settings - Fork 338
Add xr
module and support webxr
#1787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
168 commits
Select commit
Hold shift + click to select a range
5b77ccd
feat: add xr
cptbtptpbcptdtptp 88d800f
feat: add xr
cptbtptpbcptdtptp d0fb73a
feat: add xr
cptbtptpbcptdtptp 8d71286
feat: add xr
cptbtptpbcptdtptp d5de917
feat: add xr
cptbtptpbcptdtptp 3b29d4f
feat: add xr
cptbtptpbcptdtptp 83044b7
feat: add xr
cptbtptpbcptdtptp 4bcaae6
feat: add xr
cptbtptpbcptdtptp 95931ce
feat: add xr
cptbtptpbcptdtptp d88145c
feat: add xr
cptbtptpbcptdtptp 120b3ec
feat: add xr
cptbtptpbcptdtptp a7ec554
feat: add xr
cptbtptpbcptdtptp 470f390
feat: add xr
cptbtptpbcptdtptp 71c9b21
feat: add xr
8493052
feat: add xr
d02945a
feat: merge code
e0d9991
feat: add xr
cptbtptpbcptdtptp cf48b9d
feat: add xr
cptbtptpbcptdtptp 69f44a9
feat: add xr
cptbtptpbcptdtptp e50cc67
feat: add xr
cptbtptpbcptdtptp afbffad
feat: add xr
cptbtptpbcptdtptp debcf11
feat: add xr
cptbtptpbcptdtptp 982042e
feat: add xr
cptbtptpbcptdtptp 69b5fc1
fix: script delete bug when looping
cptbtptpbcptdtptp 142bd30
fix: script delete bug when looping
cptbtptpbcptdtptp 741528d
fix: script delete bug when looping
cptbtptpbcptdtptp 7b42800
feat: merge code
cptbtptpbcptdtptp 1d18748
feat: merge code
cptbtptpbcptdtptp bf18ab7
fix: webxr add pointer move
cptbtptpbcptdtptp 8d44c21
feat: format code
cptbtptpbcptdtptp 5d41013
feat: update code
cptbtptpbcptdtptp 4f15d55
feat: update code
cptbtptpbcptdtptp cc1bef2
feat: update code
cptbtptpbcptdtptp 70ea83d
feat: update code
cptbtptpbcptdtptp 9790a16
feat: update code
cptbtptpbcptdtptp 28bf14f
feat: update code
cptbtptpbcptdtptp ff76ad1
feat: update code
cptbtptpbcptdtptp e1c4247
feat: merge code
cptbtptpbcptdtptp 8c9800d
feat: update code
cptbtptpbcptdtptp 18dcaa5
feat: update image tracking
cptbtptpbcptdtptp 8832e64
feat: update code
cptbtptpbcptdtptp 915f494
feat: update code
cptbtptpbcptdtptp dfabfe4
feat: update code
cptbtptpbcptdtptp def71c2
feat: udpate code
cptbtptpbcptdtptp 590600e
feat: update code
cptbtptpbcptdtptp a092592
feat: update code
cptbtptpbcptdtptp 260027f
feat: merge code
cptbtptpbcptdtptp 5cc20d9
fix: lint error
cptbtptpbcptdtptp d49205f
feat: update code
cptbtptpbcptdtptp 1f86357
feat: add comment
cptbtptpbcptdtptp 2b371e8
feat: add comment
cptbtptpbcptdtptp 56a31ae
feat: update code
cptbtptpbcptdtptp c511a39
feat: update code
cptbtptpbcptdtptp 3df2497
feat: update code
cptbtptpbcptdtptp a84d626
feat: update code
cptbtptpbcptdtptp 3dc863e
feat: add xr
cptbtptpbcptdtptp 6da48da
feat: update code
cptbtptpbcptdtptp 7f338be
feat: update code
cptbtptpbcptdtptp 6d21eeb
feat: update code
cptbtptpbcptdtptp 7f5fdca
feat: update code
cptbtptpbcptdtptp 1fb6280
feat: update code
cptbtptpbcptdtptp b6b482b
feat: update code
cptbtptpbcptdtptp 5e2b8c7
feat: update code
cptbtptpbcptdtptp 4838a03
feat: update code
cptbtptpbcptdtptp e18bb6c
feat: update code
cptbtptpbcptdtptp 5b26544
feat: update code
cptbtptpbcptdtptp e89146c
feat: update code
cptbtptpbcptdtptp 372d429
feat: update code
cptbtptpbcptdtptp 9734f65
feat: update code
cptbtptpbcptdtptp a58a2ac
feat: update code
cptbtptpbcptdtptp ba7f1c6
feat: update code
cptbtptpbcptdtptp fae007c
feat: update code
cptbtptpbcptdtptp e569f12
feat: update code
cptbtptpbcptdtptp b7702af
feat: update code
cptbtptpbcptdtptp 7968063
feat: update code
cptbtptpbcptdtptp 6960977
feat: udpate code
cptbtptpbcptdtptp cb3e0a5
fix: lint error
cptbtptpbcptdtptp c7e3a50
feat: merge code
cptbtptpbcptdtptp 9b64d07
feat: update code
cptbtptpbcptdtptp a38647f
feat: update code
cptbtptpbcptdtptp d717ecb
feat: udpate code
cptbtptpbcptdtptp a7ca65e
feat: update code
cptbtptpbcptdtptp aef3f41
feat: update code
cptbtptpbcptdtptp 03d2434
feat: update code
cptbtptpbcptdtptp f07e0e1
feat: update code
cptbtptpbcptdtptp 2e6adfa
feat: update code
cptbtptpbcptdtptp d2d6f97
feat: update code
cptbtptpbcptdtptp e848d43
feat: update code
cptbtptpbcptdtptp ef2fda0
feat: update code
cptbtptpbcptdtptp f7f68b9
feat: update code
cptbtptpbcptdtptp b4c415b
feat: update code
cptbtptpbcptdtptp 686c20d
feat: update code
cptbtptpbcptdtptp 9c4dd8f
feat: update code
cptbtptpbcptdtptp 794e7f7
feat: update code
cptbtptpbcptdtptp efe2c49
feat: update code
cptbtptpbcptdtptp c4f48e9
feat: update code
cptbtptpbcptdtptp 4b959a9
feat: udpate code
cptbtptpbcptdtptp 0541e9a
feat: update code
cptbtptpbcptdtptp 40bb35f
refactor: opt code
GuoLei1990 5695220
refactor: opt code
GuoLei1990 ea7575e
refactor: fix lint erroe
GuoLei1990 a31b808
feat: update code
cptbtptpbcptdtptp bd9abdd
refator: opt code
GuoLei1990 405e2b4
refactor: opt code
GuoLei1990 881c68b
feat: update code
cptbtptpbcptdtptp 5bdd322
feat: update code
cptbtptpbcptdtptp 9cddb8c
refactor: opt code
GuoLei1990 e1be728
feat: update code
cptbtptpbcptdtptp 73cefcb
feat: update code
cptbtptpbcptdtptp d9c5166
feat: update code
cptbtptpbcptdtptp 4ed26c9
feat: update code
cptbtptpbcptdtptp fc9314b
feat: update code
cptbtptpbcptdtptp 6c83569
feat: update code
cptbtptpbcptdtptp 4b99533
feat: update code
cptbtptpbcptdtptp 71cdc35
feat: update code
cptbtptpbcptdtptp 7a5ccfe
feat: update code
cptbtptpbcptdtptp cd8ae8b
feat:update code
cptbtptpbcptdtptp 93d3657
feat: update code
cptbtptpbcptdtptp 0003a9e
feat: update code
cptbtptpbcptdtptp 3b3e177
feat: update code
cptbtptpbcptdtptp 084080c
feat: update code
cptbtptpbcptdtptp 8746ffb
feat: update code
cptbtptpbcptdtptp 8866db1
feat: update code
cptbtptpbcptdtptp c1bf210
feat: update code
cptbtptpbcptdtptp fd6b6fd
feat: update code
cptbtptpbcptdtptp 1abaed1
feat: udpate code
cptbtptpbcptdtptp 909b0e1
feat: udpate code
cptbtptpbcptdtptp f0bb602
feat: update code
cptbtptpbcptdtptp 21636ff
feat: update code
cptbtptpbcptdtptp 965129e
feat: update code
cptbtptpbcptdtptp 83c91ae
feat: update code
cptbtptpbcptdtptp 1273580
feat: update code
cptbtptpbcptdtptp f528554
feat: update code
cptbtptpbcptdtptp 676e065
feat: update code
cptbtptpbcptdtptp e73b120
feat: update code
cptbtptpbcptdtptp fdda7a0
feat: update code
cptbtptpbcptdtptp c6cf65b
feat: update code
cptbtptpbcptdtptp 2095593
feat: update code
cptbtptpbcptdtptp e75b4de
feat: update code
cptbtptpbcptdtptp cc5369e
feat: update code
cptbtptpbcptdtptp 5bdeeb7
feat: update code
cptbtptpbcptdtptp 4ba2be0
feat: update code
cptbtptpbcptdtptp 0bb1e88
feat: update code
cptbtptpbcptdtptp b0d7dae
feat: update code
cptbtptpbcptdtptp 2deb98b
feat: update code
cptbtptpbcptdtptp fad5ce7
feat: update code
cptbtptpbcptdtptp 8927c46
feat: update code
cptbtptpbcptdtptp 9497b72
feat: update code
cptbtptpbcptdtptp 4f512b7
feat: update code
cptbtptpbcptdtptp c59a0be
feat: update code
cptbtptpbcptdtptp 8e9ccad
feat: update code
cptbtptpbcptdtptp 8c80986
feat: update code
cptbtptpbcptdtptp b5d0cd7
feat: udpate code
cptbtptpbcptdtptp f87173b
feat: update code
cptbtptpbcptdtptp 92663ea
feat: update code
cptbtptpbcptdtptp be96545
feat: update code
cptbtptpbcptdtptp be1a300
feat: update code
cptbtptpbcptdtptp 81d5d9f
feat: update code
cptbtptpbcptdtptp c30afce
feat: update code
cptbtptpbcptdtptp 73a72cb
feat: update code
cptbtptpbcptdtptp 50aa239
feat: update code
cptbtptpbcptdtptp 030f26d
feat: update code
cptbtptpbcptdtptp 4bd44de
feat: update code
cptbtptpbcptdtptp 15f9604
feat: udpate code
cptbtptpbcptdtptp 1256689
feat: update code
cptbtptpbcptdtptp dfbedda
feat: update code
cptbtptpbcptdtptp ce7606f
feat: update code
cptbtptpbcptdtptp f5c4237
feat: update code
cptbtptpbcptdtptp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* @internal | ||
*/ | ||
export enum CameraType { | ||
GuoLei1990 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Normal = 0x0, | ||
XRCenterCamera = 0x1, | ||
XRLeftCamera = 0x2, | ||
XRRightCamera = 0x4 | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { IXRDevice } from "@galacean/engine-design"; | ||
import { Engine } from "../Engine"; | ||
import { CameraClearFlags } from "../enums/CameraClearFlags"; | ||
import { CameraType } from "../enums/CameraType"; | ||
|
||
/** | ||
* XRManager located in the main package, its implementation logic is XRManagerExtended in the sub-package engine-xr. | ||
*/ | ||
export class XRManager { | ||
/** | ||
* @internal | ||
*/ | ||
_initialize(engine: Engine, xrDevice: IXRDevice): void {} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
_update(): void {} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
_destroy(): void {} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
_getRequestAnimationFrame(): (callback: FrameRequestCallback) => number { | ||
return null; | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
_getCancelAnimationFrame(): (id: number) => void { | ||
return null; | ||
} | ||
/** | ||
* @internal | ||
*/ | ||
_getCameraClearFlagsMask(type: CameraType): CameraClearFlags { | ||
return CameraClearFlags.None; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export type { IHardwareRenderer } from "./IHardwareRenderer"; | ||
export type { IPlatformPrimitive } from "./IPlatformPrimitive"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { IHardwareRenderer } from "../renderingHardwareInterface"; | ||
import { IXRSession } from "./IXRSession"; | ||
import { IXRPlatformFeature } from "./feature/IXRPlatformFeature"; | ||
|
||
/** | ||
* The interface of XR device. | ||
*/ | ||
export interface IXRDevice { | ||
/** | ||
* Check if the specified session mode is supported. | ||
* @param mode - The mode of the session. | ||
*/ | ||
isSupportedSessionMode(mode: number): Promise<void>; | ||
|
||
/** | ||
* Check if the specified feature is supported. | ||
* @param mode - The type of the feature. | ||
*/ | ||
isSupportedFeature(type: number): boolean; | ||
|
||
/** | ||
* Get the platform feature instance of this device | ||
* @param engine - The engine. | ||
* @param type - The type of the feature. | ||
*/ | ||
createPlatformFeature(type: number, ...args: any[]): IXRPlatformFeature; | ||
|
||
/** | ||
* Request a session. | ||
* @param engine - The engine | ||
* @param mode - The mode of the session | ||
* @param platformFeatures - The requested platform features | ||
*/ | ||
requestSession(rhi: IHardwareRenderer, mode: number, platformFeatures: IXRPlatformFeature[]): Promise<IXRSession>; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { IXRInput } from "./input/IXRInput"; | ||
|
||
/** | ||
* The base interface of XR frame. | ||
* It can be understood as a snapshot of | ||
* the information of each input in this frame. | ||
*/ | ||
export interface IXRFrame { | ||
/** | ||
* Update xr input information. | ||
* @param inputs - xr input | ||
*/ | ||
updateInputs(inputs: IXRInput[]): void; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* Unified XR input events. | ||
*/ | ||
export interface IXRInputEvent { | ||
/** Interaction type. */ | ||
targetRayMode: number; | ||
/** Specific interactions. */ | ||
type: number; | ||
/** Type of interactive input. */ | ||
input: number; | ||
/** Touch id. (Meaningful when and only when targetRayMode is screen) */ | ||
id?: number; | ||
/** X coordinate on screen. (Meaningful when and only when targetRayMode is screen) */ | ||
x?: number; | ||
/** Y coordinate on screen. (Meaningful when and only when targetRayMode is screen) */ | ||
y?: number; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.