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
值。例如,这些推断出的姿势可以基于颈部模型更新、惯性死 reckoning 或上次已知位置。应用可以假定它将继续设置 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 年 9 月 12 日(Levana Chen)
OpenXR™ 和 OpenXR 徽标是 Khronos Group Inc. 拥有的商标,已在中国、欧盟、日本和英国注册为商标。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):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."]]