大网数据广告活动
Web 标准与前端开发

VRPose

· 52CE 我爱测

The **`VRPose`** interface of the WebVR API represents the state of a VR sensor at a given timestamp (which includes orientation, position, velocity, and acceleration information.)

WebVR API

The VRPose interface of the WebVR API represents the state of a VR sensor at a given timestamp (which includes orientation, position, velocity, and acceleration information.)

WebVR API 中的 VRPose 接口表示在一个给定的时间戳中,一个 VR 传感器的状态(包括了方向、位置、速度和加速度信息)。

This interface is accessible through the VRDisplay.getPose() and VRDisplay.getImmediatePose() methods.

这个接口能通过 VRDisplay.getPose() 和 VRDisplay.getImmediatePose() 方法访问

Properties

  • VRPose.timeStamp
    • : 返回当前系统的时间戳。此单调递增的值可以有助于确定位置数据是否有更新,以及更新的顺序。
  • VRPose.position
    • : 以三维向量的形式返回当前时间戳 VRPose.timestamp 时 VRDisplay 的位置信息。
  • VRPose.linearVelocity
    • : 返回当前时间戳 VRPose.timestamp 时 VRDisplay 的线速度,单位为米/秒。
  • VRPose.linearAcceleration
    • : 返回当前时间戳 VRPose.timestamp 时 VRDisplay 的线加速度,单位为米/平方秒。
  • VRPose.orientation
    • : 以四元数的形式返回当前时间戳 VRPose.timestamp 时传感器的方向,
  • VRPose.angularVelocity
    • : 返回当前时间戳 VRPose.timestamp 时 VRDisplay 的角速度,单位为弧度/秒。
  • VRPose.angularAcceleration
    • : 返回当前时间戳 VRPose.timestamp 时 VRDisplay 的角加速度,单位为弧度/平方秒。

示例

参见 VRDisplay.getFrameData() 以获取示例代码。

规范

该 API 在旧的 WebVR API(已被 WebXR Device API 取代)中定义。它不再有望成为标准。

在所有浏览器都实现新的 WebXR API 之前,建议使用框架(如:A-Frame、Babylon.js 或 Three.js)或 polyfill 来开发适用于所有浏览器的 WebXR 应用程序。[1]

浏览器兼容性

参见

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。