VRPose

实验性: 这是一项实验性技术
在将其用于生产之前,请仔细检查浏览器兼容性表格

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.timestampVRDisplay 的位置信息。

VRPose.linearVelocity 只读

返回当前时间戳 VRPose.timestampVRDisplay 的线速度,单位为米/秒。

VRPose.linearAcceleration 只读

返回当前时间戳 VRPose.timestampVRDisplay 的线加速度,单位为米/平方秒。

VRPose.orientation 只读

以四元数的形式返回当前时间戳 VRPose.timestamp 时传感器的方向,

VRPose.angularVelocity 只读

返回当前时间戳 VRPose.timestampVRDisplay 的角速度,单位为弧度/秒。

VRPose.angularAcceleration 只读

返回当前时间戳 VRPose.timestampVRDisplay 的角加速度,单位为弧度/平方秒。

Examples

TBD.

Specifications

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

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

Browser compatibility

BCD tables only load in the browser

See also