这是一个实验中的功能
此功能某些浏览器尚在开发中,请参考浏览器兼容性表格以得到在不同浏览器中适合使用的前缀。由于该功能对应的标准文档可能被重新修订,所以在未来版本的浏览器中该功能的语法和行为可能随之改变。
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只读- 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.
- 返回当前系统的时间戳。此单调递增的值可以有助于确定位置数据是否有更新,以及更新的顺序。
VRPose.position只读- Returns the position of the
VRDisplayat the currentVRPose.timestampas a 3D vector - 以三维向量的形式返回当前时间戳
VRPose.timestamp时VRDisplay的位置信息。 VRPose.linearVelocity只读- Returns the linear velocity of the
VRDisplayat the currentVRPose.timestamp, in meters per second. - 返回当前时间戳
VRPose.timestamp时VRDisplay的线速度,单位为米/秒。 VRPose.linearAcceleration只读- Returns the linear acceleration of the
VRDisplayat the currentVRPose.timestamp, in meters per second per second. - 返回当前时间戳
VRPose.timestamp时VRDisplay的线加速度,单位为米/平方秒。 VRPose.orientation只读- Returns the orientation of the sensor at the current
VRPose.timestamp, as a quarternion value. - 以四元数的形式返回当前时间戳
VRPose.timestamp时传感器的方向, VRPose.angularVelocity只读- Returns the angular velocity of the
VRDisplayat the currentVRPose.timestamp, in radians per second. - 返回当前时间戳
VRPose.timestamp时VRDisplay的角速度,单位为弧度/秒。 VRPose.angularAcceleration只读- Returns the angular acceleration of the
VRDisplayat the currentVRPose.timestamp, in meters per second per second. - 返回当前时间戳
VRPose.timestamp时VRDisplay的角加速度,单位为弧度/平方秒。
Examples
TBD.
Specifications
| Specification | Status | Comment |
|---|---|---|
| WebVR VRPose |
Editor's Draft | Initial definition |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
|---|---|---|---|---|---|
| Basic support | (Yes) | (Yes) | 未实现 | 未实现 | 未实现 |
| Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile | Chrome for Android |
|---|---|---|---|---|---|---|
| Basic support | 未实现 | (Yes) | 未实现 | 未实现 | 未实现 | 未实现 |
See also
- WebVR API homepage.
- MozVr.com — demos, downloads, and other resources from the Mozilla VR team.