Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: third_party/WebKit/public/platform/WebGamepad.h

Issue 2300543003: Added Pose attribute to Gamepad (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gamepad_touched
Patch Set: Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (C) 2011, Google Inc. All rights reserved. 1 // Copyright (C) 2011, Google Inc. All rights reserved.
2 // 2 //
3 // Redistribution and use in source and binary forms, with or without 3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are met: 4 // modification, are permitted provided that the following conditions are met:
5 // 5 //
6 // 1. Redistributions of source code must retain the above copyright 6 // 1. Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // 2. Redistributions in binary form must reproduce the above copyright 8 // 2. Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the 9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution. 10 // documentation and/or other materials provided with the distribution.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 : pressed(pressed) 42 : pressed(pressed)
43 , touched(touched) 43 , touched(touched)
44 , value(value) 44 , value(value)
45 { 45 {
46 } 46 }
47 bool pressed; 47 bool pressed;
48 bool touched; 48 bool touched;
49 double value; 49 double value;
50 }; 50 };
51 51
52 class WebGamepadVector {
53 public:
54 WebGamepadVector()
55 : notNull(false)
56 {
57 }
58
59 bool notNull;
60 float x, y, z;
61 };
62
63 class WebGamepadQuaternion {
64 public:
65 WebGamepadQuaternion()
66 : notNull(false)
67 {
68 }
69
70 bool notNull;
71 float x, y, z, w;
72 };
73
74 class WebGamepadPose {
75 public:
76 WebGamepadPose()
77 : notNull(false)
78 {
79 }
80
81 bool notNull;
82
83 bool hasOrientation;
84 bool hasPosition;
85
86 WebGamepadQuaternion orientation;
87 WebGamepadVector position;
88 WebGamepadVector angularVelocity;
89 WebGamepadVector linearVelocity;
90 WebGamepadVector angularAcceleration;
91 WebGamepadVector linearAcceleration;
92 };
93
52 // This structure is intentionally POD and fixed size so that it can be shared 94 // This structure is intentionally POD and fixed size so that it can be shared
53 // memory between hardware polling threads and the rest of the browser. See 95 // memory between hardware polling threads and the rest of the browser. See
54 // also WebGamepads.h. 96 // also WebGamepads.h.
55 class WebGamepad { 97 class WebGamepad {
56 public: 98 public:
57 static const size_t idLengthCap = 128; 99 static const size_t idLengthCap = 128;
58 static const size_t mappingLengthCap = 16; 100 static const size_t mappingLengthCap = 16;
59 static const size_t axesLengthCap = 16; 101 static const size_t axesLengthCap = 16;
60 static const size_t buttonsLengthCap = 32; 102 static const size_t buttonsLengthCap = 32;
61 103
(...skipping 24 matching lines...) Expand all
86 double axes[axesLengthCap]; 128 double axes[axesLengthCap];
87 129
88 // Number of valid entries in the buttons array. 130 // Number of valid entries in the buttons array.
89 unsigned buttonsLength; 131 unsigned buttonsLength;
90 132
91 // Button states 133 // Button states
92 WebGamepadButton buttons[buttonsLengthCap]; 134 WebGamepadButton buttons[buttonsLengthCap];
93 135
94 // Mapping type (for example "standard") 136 // Mapping type (for example "standard")
95 WebUChar mapping[mappingLengthCap]; 137 WebUChar mapping[mappingLengthCap];
138
139 WebGamepadPose pose;
96 }; 140 };
97 141
98 static_assert(sizeof(WebGamepad) == 753, "WebGamepad has wrong size"); 142 static_assert(sizeof(WebGamepad) == 838, "WebGamepad has wrong size");
99 143
100 #pragma pack(pop) 144 #pragma pack(pop)
101 145
102 } 146 }
103 147
104 #endif // WebGamepad_h 148 #endif // WebGamepad_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/modules_idl_files.gni ('k') | third_party/WebKit/public/platform/WebGamepads.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698