Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 module device.mojom; | |
| 6 | |
| 7 struct GamepadQuaternion { | |
| 8 float x; | |
| 9 float y; | |
| 10 float z; | |
| 11 float w; | |
| 12 }; | |
| 13 | |
| 14 struct GamepadVector { | |
| 15 float x; | |
| 16 float y; | |
| 17 float z; | |
| 18 }; | |
| 19 | |
| 20 struct GamepadButton { | |
| 21 bool pressed; | |
| 22 bool touched; | |
| 23 double value; | |
| 24 }; | |
| 25 | |
| 26 struct GamepadPose { | |
| 27 GamepadQuaternion? orientation; | |
| 28 GamepadVector? position; | |
| 29 GamepadVector? angular_velocity; | |
| 30 GamepadVector? linear_velocity; | |
| 31 GamepadVector? angular_acceleration; | |
| 32 GamepadVector? linear_acceleration; | |
| 33 }; | |
| 34 | |
| 35 enum GamepadHand { | |
| 36 GamepadHandNone = 0, | |
| 37 GamepadHandLeft = 1, | |
| 38 GamepadHandRight = 2 | |
| 39 }; | |
| 40 | |
| 41 struct Gamepad { | |
| 42 bool connected; | |
| 43 array<uint16, 128> id; //blink::WebGamepad::idLengthCap = 128 | |
| 44 uint64 timestamp; | |
| 45 uint32 axes_length; | |
|
yzshen1
2016/11/15 19:17:33
If axes length is variable, how about making |axes
ke.he
2016/11/16 09:51:40
Yes, to avoid passing unnecessary bytes, |axes_len
| |
| 46 array<double, 16> axes; //blink::WebGamepad::axesLengthCap = 16 | |
| 47 uint32 buttons_length; | |
| 48 array<GamepadButton, 32> buttons; //blink::WebGamepad::buttonLengthCap = 32 | |
| 49 array<uint16, 16> mapping; //blink::WebGamepad::mappingLengthCap = 16 | |
| 50 GamepadPose? pose; | |
| 51 GamepadHand hand; | |
| 52 uint32 display_id; | |
| 53 }; | |
| OLD | NEW |