这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
位置
只读特性在
GamepadPose
interface returns the position of the
Gamepad
as a 3D vector.
The coordinate system is as follows:
Positions are measured in meters from an origin point — this point is the position the sensor was first read at.
var myGamepadPosition = gamepadPoseInstance.position;
A
Float32Array
,或
null
if the gamepad is not able to provide position data.
注意
: User agents may provide emulated position values through certain techniques; when doing so they should still report
GamepadPose.hasPosition
as false.
TBD
| 规范 | 状态 | 注释 |
|---|---|---|
|
Gamepad Extensions
The definition of 'position' in that specification. |
编者草案 | 初始定义 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
位置
|
Chrome No | Edge 15 — 79 |
Firefox
Yes
Disabled
|
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 |
完整支持
不支持
实验。期望将来行为有所改变。
见实现注意事项。
用户必须明确启用此特征。