--- title: VRPose slug: Web/API/VRPose tags: - VR - VRPose - WebVR - 实验性的 - 虚拟现实 translation_of: Web/API/VRPose ---
{{APIRef("WebVR API")}}{{SeeCompatTable}}

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 {{domxref("VRDisplay.getPose()")}} and {{domxref("VRDisplay.getImmediatePose()")}} methods.

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

Properties

{{domxref("VRPose.timeStamp")}} {{readonlyInline}}
Returns the current time stamp of the system — a monotonically increasing value useful for determining if position data has been updated, and what order updates have occured in.
返回当前系统的时间戳。此单调递增的值可以有助于确定位置数据是否有更新,以及更新的顺序。
{{domxref("VRPose.position")}} {{readonlyInline}}
Returns the position of the {{domxref("VRDisplay")}} at the current {{domxref("VRPose.timestamp")}} as a 3D vector
以三维向量的形式返回当前时间戳 {{domxref("VRPose.timestamp")}}  时 {{domxref("VRDisplay")}}  的位置信息。
{{domxref("VRPose.linearVelocity")}} {{readonlyInline}}
Returns the linear velocity of the {{domxref("VRDisplay")}} at the current {{domxref("VRPose.timestamp")}}, in meters per second.
返回当前时间戳 {{domxref("VRPose.timestamp")}}  时 {{domxref("VRDisplay")}}  的线速度,单位为米/秒。
{{domxref("VRPose.linearAcceleration")}} {{readonlyInline}}
Returns the linear acceleration of the {{domxref("VRDisplay")}} at the current {{domxref("VRPose.timestamp")}}, in meters per second per second.
返回当前时间戳 {{domxref("VRPose.timestamp")}}  时 {{domxref("VRDisplay")}}  的线加速度,单位为米/平方秒。
{{domxref("VRPose.orientation")}} {{readonlyInline}}
Returns the orientation of the sensor at the current {{domxref("VRPose.timestamp")}}, as a quarternion value.
以四元数的形式返回当前时间戳 {{domxref("VRPose.timestamp")}}  时传感器的方向,
{{domxref("VRPose.angularVelocity")}} {{readonlyInline}}
Returns the angular velocity of the {{domxref("VRDisplay")}} at the current {{domxref("VRPose.timestamp")}}, in radians per second.
返回当前时间戳 {{domxref("VRPose.timestamp")}}  时 {{domxref("VRDisplay")}}  的角速度,单位为弧度/秒。
{{domxref("VRPose.angularAcceleration")}} {{readonlyInline}}
Returns the angular acceleration of the {{domxref("VRDisplay")}} at the current {{domxref("VRPose.timestamp")}}, in meters per second per second.
返回当前时间戳 {{domxref("VRPose.timestamp")}}  时 {{domxref("VRDisplay")}}  的角加速度,单位为弧度/平方秒。

Examples

TBD.

Specifications

Specification Status Comment
{{SpecName('WebVR', '#interface-vrpose', 'VRPose')}} {{Spec2('WebVR')}} Initial definition

Browser compatibility

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatNo}} {{CompatNo}} {{CompatNo}}
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile Chrome for Android
Basic support {{CompatNo}} {{CompatVersionUnknown}} {{CompatNo}} {{CompatNo}} {{CompatNo}} {{CompatNo}}

See also