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.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]
浏览器兼容性
Loading…