Changeset 9813 for code/branches/wiimote/src/libraries/core
- Timestamp:
- Nov 25, 2013, 3:38:51 PM (11 years ago)
- Location:
- code/branches/wiimote/src/libraries/core/input
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/wiimote/src/libraries/core/input/InputManager.cc
r9805 r9813 234 234 235 235 // Find and connect to the wiimotes 236 std::vector<CWiimote>& wiimotes = wii.FindAndConnect( );236 std::vector<CWiimote>& wiimotes = wii.FindAndConnect(30); 237 237 if (!wiimotes.size()) 238 238 { 239 239 cout << "No wiimotes found." << endl; 240 return; 240 241 } 241 242 -
code/branches/wiimote/src/libraries/core/input/WiiMote.cc
r9790 r9813 11 11 { 12 12 orxout(user_warning) << this->inputStates_.size() << std::endl; 13 CWiimote::EventTypes e = p->GetEvent(); 14 if(p->Buttons.isPressed(CButtons::BUTTON_A)) 15 orxout()<<"ZOMG!!1!"<<endl; 16 Orientation o; 17 p->Accelerometer.GetOrientation(o.pitch, o.roll, o.yaw); 18 int x = (int)(o.yaw-lastOrientation.yaw)*time.tickDt_; 19 int y = (int)(o.pitch-lastOrientation.pitch)*time.tickDt_; 20 IntVector2 abs(0, 0); 21 IntVector2 rel(x, y); 22 IntVector2 clippingSize(1920, 1080); 23 if(x!=0&&y!=0) 24 { 25 for (unsigned int i = 0; i < inputStates_.size(); ++i) 26 inputStates_[i]->mouseMoved(abs, rel, clippingSize); 27 } 28 29 13 30 } 14 31 void WiiMote::clearBuffers() … … 23 40 { 24 41 p = &parent; 42 43 lastOrientation.yaw = 0; 44 lastOrientation.roll = 0; 45 lastOrientation.pitch = 0; 46 25 47 } 26 48 } -
code/branches/wiimote/src/libraries/core/input/WiiMote.h
r9805 r9813 11 11 12 12 13 13 struct Orientation 14 { 15 float roll, pitch, yaw; 16 }; 14 17 15 18 class WiiMote : public InputDevice … … 30 33 void calibrationStarted() { } 31 34 void calibrationStopped() { } 35 Orientation lastOrientation; 32 36 //! List of all input states that receive events from this device 33 37 //std::vector<InputState*> inputStates_;
Note: See TracChangeset
for help on using the changeset viewer.