Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1058270 of VRPose

  • Revision slug: Web/API/VRPose
  • Revision title: VRPose
  • Revision id: 1058270
  • Created:
  • Creator: chrisdavidmills
  • Is current revision? No
  • Comment

Revision Content

{{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("VRPositionState.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("VRPositionState.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 return null.
{{domxref("VRPositionState.position")}} {{readonlyInline}}
Returns the current position of the sensor relative to the head mounted display, as a 3D vector ({{domxref("DOMPoint")}} value.)
{{domxref("VRPositionState.linearVelocity")}} {{readonlyInline}}
Returns the current linear velocity of the sensor.
{{domxref("VRPositionState.linearAcceleration")}} {{readonlyInline}}
Returns the current linear acceleration of the sensor.
{{domxref("VRPositionState.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 return null.
{{domxref("VRPositionState.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("VRPositionState.angularVelocity")}} {{readonlyInline}}
Returns the current angular velocity of the sensor.
{{domxref("VRPositionState.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

Revision Source

<div>{{APIRef("WebVR API")}}{{SeeCompatTable}}</div>

<p>The <strong><code>VRPose</code></strong> interface of the <a href="/en-US/docs/Web/API/WebVR_API">WebVR API</a> represents the state of a VR sensor at a given timestamp (which includes orientation, position, velocity, and acceleration information.)</p>

<p>This interface is accessible through the {{domxref("VRDisplay.getPose()")}} and&nbsp;{{domxref("VRDisplay.getImmediatePose()")}} methods.</p>

<h2 id="Properties">Properties</h2>

<dl>
 <dt>{{domxref("VRPositionState.timeStamp")}} {{readonlyInline}}</dt>
 <dd>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.</dd>
 <dt>{{domxref("VRPositionState.hasPosition")}} {{readonlyInline}}</dt>
 <dd>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 <code>false</code>, the position property will return <code>null</code>.</dd>
 <dt>{{domxref("VRPositionState.position")}} {{readonlyInline}}</dt>
 <dd>Returns the current position of the sensor relative to the head mounted display, as a 3D vector ({{domxref("DOMPoint")}} value.)</dd>
 <dt>{{domxref("VRPositionState.linearVelocity")}} {{readonlyInline}}</dt>
 <dd>Returns the current linear velocity of the sensor.</dd>
 <dt>{{domxref("VRPositionState.linearAcceleration")}} {{readonlyInline}}</dt>
 <dd>Returns the current linear acceleration of the sensor.</dd>
 <dt>{{domxref("VRPositionState.hasOrientation")}} {{readonlyInline}}</dt>
 <dd>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 <code>false</code>, the orientation property will return <code>null</code>.</dd>
 <dt>{{domxref("VRPositionState.orientation")}} {{readonlyInline}}</dt>
 <dd>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 <code>DOMQuarternion</code> is implemented.)</dd>
 <dt>{{domxref("VRPositionState.angularVelocity")}} {{readonlyInline}}</dt>
 <dd>Returns the current angular velocity of the sensor.</dd>
 <dt>{{domxref("VRPositionState.angularAcceleration")}} {{readonlyInline}}</dt>
 <dd>Returns the current angular acceleration of the sensor.</dd>
</dl>

<h2 id="Examples">Examples</h2>

<pre>
TBD.</pre>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('WebVR', '#interface-vrpose', 'VRPose')}}</td>
   <td>{{Spec2('WebVR')}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{CompatibilityTable}}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari (WebKit)</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>Firefox OS (Gecko)</th>
   <th>IE Phone</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
   <th>Chrome for Android</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
 </tbody>
</table>
</div>

<h2 id="See_also">See also</h2>

<ul>
 <li><a href="/en-US/docs/Web/API/WebVR_API">WebVR API homepage</a>.</li>
 <li><a href="https://mozvr.com/">MozVr.com</a> — demos, downloads, and other resources from the Mozilla VR team.</li>
</ul>
Revert to this revision