这是 实验性技术
检查 浏览器兼容性表格 要小心谨慎在生产中使用这之前。

orientation 只读特性在 GamepadPose interface returns the orientation of the Gamepad , as a quarternion value.

The value is a Float32Array , made up of the following values:

  • pitch — rotation around the X axis.
  • yaw — rotation around the Y axis.
  • roll — rotation around the Z axis.
  • w — the fourth dimension (usually 1).

The orientation yaw (rotation around the y axis) is relative to the initial yaw of the sensor when it was first read.

句法

var myGamepadOrientation = gamepadPoseInstance.orientation;
					

A Float32Array ,或 null if the VR sensor is not able to provide orientation data.

范例

TBD

注意 : An orientation of { x: 0, y: 0, z: 0, w: 1 } is considered to be "forward".

规范

规范 状态 注释
Gamepad Extensions
The definition of 'orientation' in that specification.
编者草案 初始定义

浏览器兼容性

更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
orientation Chrome No Edge 15 — 79 Firefox Yes Disabled
Yes Disabled
The flag is enabled by default in Firefox Nightly and Beta, versions 55 and above.
Disabled ). To change preferences in Firefox, visit about:config.
IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No

图例

完整支持

完整支持

不支持

不支持

实验。期望将来行为有所改变。

实验。期望将来行为有所改变。

见实现注意事项。

用户必须明确启用此特征。

用户必须明确启用此特征。

另请参阅

元数据

  • 最后修改: