GamepadPose
Experimental
这是一个实验中的功能
此功能某些浏览器尚在开发中,请参考浏览器兼容性表格以得到在不同浏览器中适合使用的前缀。由于该功能对应的标准文档可能被重新修订,所以在未来版本的浏览器中该功能的语法和行为可能随之改变。
Gamepad API的接口GamepadPose
表示WebVR的控制者在某个给定时间点的姿势, (包括方向、位置、速率、加速度信息)
这个接口通过 Gamepad.pose
(en-US) 属性使用。
属性
GamepadPose.hasOrientation
(en-US) 只读- Returns a boolean indicating whether the gamepad is capable of returning orientation information (
true
) or not (false
). GamepadPose.hasPosition
(en-US) 只读- Returns a boolean indicating whether the gamepad is capable of returning position information (
true
) or not (false
). GamepadPose.position
(en-US) 只读- Returns the position of the
Gamepad
as a 3D vector. GamepadPose.linearVelocity
(en-US) 只读- Returns the linear velocity of the
Gamepad
, in meters per second. GamepadPose.linearAcceleration
(en-US) 只读- Returns the linear acceleration of the
Gamepad
, in meters per second per second. GamepadPose.orientation
(en-US) 只读- Returns the orientation of the
Gamepad
, as a quarternion value. GamepadPose.angularVelocity
(en-US) 只读- Returns the angular velocity of the
Gamepad
, in radians per second. GamepadPose.angularAcceleration
(en-US) 只读- Returns the angular acceleration of the
Gamepad
, in meters per second per second.
Examples
TBD.
Specifications
Specification | Status | Comment |
---|---|---|
Gamepad Extensions GamepadPose |
Editor's Draft | Initial definition |
Browser compatibility
BCD tables only load in the browser