{{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.)
This interface is accessible through the {{domxref("VRDisplay.getPose()")}} and {{domxref("VRDisplay.getImmediatePose()")}} methods.
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.hasPosition")}} {{readonlyInline}}
- A boolean indicating whether the {{domxref("VRPositionState.position")}} property is valid (i.e. if the hardware is currently registering a valid position). If it is
false
, the position property will returnnull
. - {{domxref("VRPose.position")}} {{readonlyInline}}
- Returns the current position of the sensor relative to the head mounted display, as a 3D vector ({{domxref("DOMPoint")}} value.)
- {{domxref("VRPose.linearVelocity")}} {{readonlyInline}}
- Returns the current linear velocity of the sensor.
- {{domxref("VRPose.linearAcceleration")}} {{readonlyInline}}
- Returns the current linear acceleration of the sensor.
- {{domxref("VRPose.hasOrientation")}} {{readonlyInline}}
- A boolean indicating whether the {{domxref("VRPositionState.orientation")}} property is valid (i.e. if the hardware is currently registering a valid orientation). If it is
false
, the orientation property will returnnull
. - {{domxref("VRPose.orientation")}} {{readonlyInline}}
- Returns the current orientation of the sensor relative to the head mounted display, as a quarternion value (currently represented by a {{domxref("DOMPoint")}} value, but will be updated when
DOMQuarternion
is implemented.) - {{domxref("VRPose.angularVelocity")}} {{readonlyInline}}
- Returns the current angular velocity of the sensor.
- {{domxref("VRPose.angularAcceleration")}} {{readonlyInline}}
- Returns the current angular acceleration of the sensor.
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) | Firefox OS (Gecko) | IE Phone | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|
Basic support | {{CompatNo}} | {{CompatVersionUnknown}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
See also
- WebVR API homepage.
- MozVr.com — demos, downloads, and other resources from the Mozilla VR team.