Android XR SDK 現已在開發人員預覽版中推出。敬請提供意見回饋!請前往
支援頁面與我們聯絡。
XR_ANDROID_unbounded_reference_space OpenXR 擴充功能
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
名稱字串
XR_ANDROID_unbounded_reference_space
擴充功能類型
執行個體擴充功能
已註冊的擴充號碼
468
修訂版本
1
擴充功能和版本依附元件
OpenXR 1.0
上次修改日期
2024-09-12
IP 狀態
沒有已知的 IP 版權聲明。
著作人
Spencer Quin,Google
Jared Finder,Google
Fengtao Fan, Google
Lachlan Ford,Google
Nihav Jain,Google
Levana Chen,Google
總覽
這項擴充功能可讓應用程式建立 UNBOUNDED_ANDROID
參照空間。這個參考空間可讓觀眾在複雜的環境中自由移動,通常距離起點有數公尺之遙,同時一律針對觀眾附近的座標系統穩定性進行最佳化。隨著裝置感測更多環境資訊,以建立更佳的場景理解能力,參考空間的來源可能會隨著大幅調整而漂移,以維持裝置追蹤。
如要建立 UNBOUNDED_ANDROID
參考空間,應用程式可以設定 XrReferenceSpaceCreateInfo::referenceSpaceType
XR_REFERENCE_SPACE_TYPE_UNBOUNDED_ANDROID
,並傳遞至 xrCreateReferenceSpace。
XrInstance instance; // previously initialized
XrSession session; // previously initialized
XrPosef pose; // previously initialized
// Use the new reference space type in the create info struct
XrReferenceSpaceCreateInfo createInfo = {
.type = XR_REFERENCE_SPACE_CREATE_INFO;
.next = nullptr;
.referenceSpaceType = XR_REFERENCE_SPACE_TYPE_UNBOUNDED_ANDROID;
.poseInReferenceSpace = pose;
}
XrSpace referenceSpace;
CHK_XR(xrCreateReferenceSpace(session, &createInfo, &referenceSpace));
// After usage
CHK_XR(xrDestroySpace(referenceSpace));
UNBOUNDED_ANDROID
參考空間會在裝置追蹤開始時,建立與世界鎖定的耳機位置原點。它會以重力為基準,排除俯仰和橫滾,並將 +X 指向右側、+Y 指向上方,而 -Z 則是指向前方。
當應用程式需要算繪超出單一 STAGE
邊界範圍的世界規模內容 (例如整棟建築物或多層樓) 時,UNBOUNDED_ANDROID
空間就非常實用。
UNBOUNDED_ANDROID
空間會隨著時間調整其原點,以維持觀眾附近的穩定性。可視需要進行微幅和大幅調整,以維持裝置追蹤。
參照聊天室變更事件
針對由 XrEventDataReferenceSpaceChangePending 結構定義的參數,該結構會在世界變更或最佳化重新定位事件時傳回:
typedef struct XrEventDataReferenceSpaceChangePending {
XrStructureType type;
const void* next;
XrSession session;
XrReferenceSpaceType referenceSpaceType;
XrTime changeTime;
XrBool32 poseValid;
XrPosef poseInPreviousSpace;
} XrEventDataReferenceSpaceChangePending;
成員說明
- 「
referenceSpaceType
」目前狀態:XR_REFERENCE_SPACE_TYPE_UNBOUNDED_ANDROID
。
changeTime
會代表重新定位完成時的 XrTime
。
poseValid
會因為斷線估計值而為 false
,或在重新連線後為 true
。
poseValid
為 false
時,poseInPreviousSpace
將無效。
如果檢視畫面、控制器或其他空間相對於 UNBOUNDED_ANDROID
空間發生追蹤遺失情形,應用程式可以繼續接收推測或最後已知的 position
和 orientation
值。這些推斷姿勢可以根據頸部模型更新、慣性死算法或最後已知位置等資訊進行推斷。應用程式可以假設會繼續設定 XR_SPACE_LOCATION_POSITION_VALID_BIT
和 XR_VIEW_STATE_POSITION_VALID_BIT
,但 XR_SPACE_LOCATION_POSITION_TRACKED_BIT
和 XR_VIEW_STATE_POSITION_TRACKED_BIT
可能會在執行階段清除,以表示位置是透過這種方式推斷或最後已知。
追蹤功能恢復後,執行階段可能會任意重新設定原點,例如將原點移至與檢視器重疊的位置。應用程式可以檢查 XrEventDataReferenceSpaceChangePending 事件傳回的 poseValid
值,判斷是否可供使用。
新物件類型
新旗標類型
新列舉常數
XrReferenceSpaceType 列舉已擴充以下項目:
XR_REFERENCE_SPACE_TYPE_UNBOUNDED_ANDROID
新列舉項目
新結構體
新函式
問題
版本記錄
- 修訂版本 1,2024-09-12 (Levana Chen)
OpenXR™ 和 OpenXR 標誌是 The Khronos Group Inc. 擁有的商標,並已在中國、歐盟、日本和英國註冊為商標。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# XR_ANDROID_unbounded_reference_space OpenXR extension\n\n**Name String**\n\n`XR_ANDROID_unbounded_reference_space`\n\n**Extension Type**\n\nInstance extension\n\n**Registered Extension Number**\n\n468\n\n**Revision**\n\n1\n\n**Extension and Version Dependencies**\n\n[OpenXR 1.0](https://registry.khronos.org/OpenXR/specs/1.0/html/xrspec.html#versions-1.0)\n\n**Last Modified Date**\n\n2024-09-12\n\n**IP Status**\n\nNo known IP claims.\n\n**Contributors**\n\nSpencer Quin, Google\n\nJared Finder, Google\n\nFengtao Fan, Google\n\nLachlan Ford, Google\n\nNihav Jain, Google\n\nLevana Chen, Google\n\nOverview\n--------\n\nThis extension allows applications to create an `UNBOUNDED_ANDROID` reference\nspace. This reference space enables the viewer to move freely through a complex\nenvironment, often many meters from where they started, while always optimizing\nfor coordinate system stability near the viewer. As the device senses more of\nits environment to build a better scene understanding, the origin of the\nreference space **can** drift with **huge adjustments** as necessary to maintain\ndevice tracking.\n\nTo create an `UNBOUNDED_ANDROID` reference space, the application **can** set\n[XrReferenceSpaceCreateInfo::referenceSpaceType](https://registry.khronos.org/OpenXR/specs/1.1/html/xrspec.html#XrReferenceSpaceCreateInfo)\n`XR_REFERENCE_SPACE_TYPE_UNBOUNDED_ANDROID` and pass to\n[xrCreateReferenceSpace](https://registry.khronos.org/OpenXR/specs/1.1/html/xrspec.html#xrCreateReferenceSpace). \n\n XrInstance instance; // previously initialized\n XrSession session; // previously initialized\n XrPosef pose; // previously initialized\n\n // Use the new reference space type in the create info struct\n XrReferenceSpaceCreateInfo createInfo = {\n .type = XR_REFERENCE_SPACE_CREATE_INFO;\n .next = nullptr;\n .referenceSpaceType = XR_REFERENCE_SPACE_TYPE_UNBOUNDED_ANDROID;\n .poseInReferenceSpace = pose;\n }\n XrSpace referenceSpace;\n CHK_XR(xrCreateReferenceSpace(session, &createInfo, &referenceSpace));\n\n // After usage\n CHK_XR(xrDestroySpace(referenceSpace));\n\nThe `UNBOUNDED_ANDROID` reference space establishes a world-locked origin of the\nheadset's position when the device tracking starts. It is gravity-aligned to\nexclude pitch and roll, with +X to the right, +Y up, and -Z forward.\n\n`UNBOUNDED_ANDROID` space is useful when an application needs to render\n**world-scale** content that spans beyond the bounds of a single `STAGE`, for\nexample, an entire floor or multiple floors of a building.\n\nAn `UNBOUNDED_ANDROID` space maintains stability near the viewer by adjusting\nits origin over time. It **can** make **slight** and **huge** adjustments as\nnecessary to maintain device tracking.\n\n- The runtime **should** not queue the [XrEventDataReferenceSpaceChangePending](https://registry.khronos.org/OpenXR/specs/1.1/html/xrspec.html#XrEventDataReferenceSpaceChangePending) event in response to **minor adjustments**.\n- The runtime **should** queue the [XrEventDataReferenceSpaceChangePending](https://registry.khronos.org/OpenXR/specs/1.1/html/xrspec.html#XrEventDataReferenceSpaceChangePending) event in response to **huge adjustments** . For example, the pose in `UNBOUNDED_ANDROID` space is reset due to a tracking loss and the tracking is re-established on a disconnected estimate of the world (a \"new map\").\n- The system is constantly updating its understanding of the world and adjusting device tracking. If an application requires a persisted location regardless of tracking resets, an anchor **can** be used in this case.\n\nReference space change event\n----------------------------\n\nFor parameters defined by\n[XrEventDataReferenceSpaceChangePending](https://registry.khronos.org/OpenXR/specs/1.1/html/xrspec.html#XrEventDataReferenceSpaceChangePending) structure that returned\non world changing or optimizing relocalization events: \n\n typedef struct XrEventDataReferenceSpaceChangePending {\n XrStructureType type;\n const void* next;\n XrSession session;\n XrReferenceSpaceType referenceSpaceType;\n XrTime changeTime;\n XrBool32 poseValid;\n XrPosef poseInPreviousSpace;\n } XrEventDataReferenceSpaceChangePending;\n\n### Member Descriptions\n\n- `referenceSpaceType` is `XR_REFERENCE_SPACE_TYPE_UNBOUNDED_ANDROID`.\n- `changeTime` will represent the [`XrTime`](https://registry.khronos.org/OpenXR/specs/1.1/html/xrspec.html#XrTime) at which relocalization completed.\n- `poseValid` will be `false` due to the disconnected estimate or `true` after reconnected.\n- `poseInPreviousSpace` won't be valid when `poseValid` is `false`.\n\nWhen views, controllers or other spaces experience tracking loss relative to the\n`UNBOUNDED_ANDROID` space, applications **can** continue to receive inferred\nor last-known `position` and `orientation` values. These inferred poses **can** ,\nfor example, be based on neck model updates, inertial dead reckoning, or a\nlast-known position. An application can assume that it will continue to have the\n`XR_SPACE_LOCATION_POSITION_VALID_BIT` and\n`XR_VIEW_STATE_POSITION_VALID_BIT` set, but\n`XR_SPACE_LOCATION_POSITION_TRACKED_BIT` and\n`XR_VIEW_STATE_POSITION_TRACKED_BIT` may be cleared by the runtime to indicate\nthat the position is inferred or last-known in this way.\n\nWhen tracking is recovered, the runtime **may** recenter the origin\narbitrarily, for example moving the origin to coincide with the viewer. An\napplication **can** check the `poseValid` value returned from the\n[XrEventDataReferenceSpaceChangePending](https://registry.khronos.org/OpenXR/specs/1.1/html/xrspec.html#XrEventDataReferenceSpaceChangePending) event to determine if it's ready to\nuse.\n\n**New Object Types**\n\n**New Flag Types**\n\n**New Enum Constants**\n\n[XrReferenceSpaceType](https://registry.khronos.org/OpenXR/specs/1.1/html/xrspec.html#XrReferenceSpaceType) enumeration is extended with:\n\n- `XR_REFERENCE_SPACE_TYPE_UNBOUNDED_ANDROID`\n\n**New Enums**\n\n**New Structures**\n\n**New Functions**\n\n**Issues**\n\n**Version History**\n\n- Revision 1, 2024-09-12 (Levana Chen)\n - Initial extension description\n\n*** ** * ** ***\n\nOpenXR™ and the OpenXR logo are trademarks owned\nby The Khronos Group Inc. and are registered as a trademark in China,\nthe European Union, Japan and the United Kingdom."]]