- Timestamp:
- Dec 2, 2013, 2:09:41 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/wiimote/src/libraries/core/input/WiiMote.cc
r9819 r9838 14 14 exit(0); 15 15 else 16 orxout(user_warning) << 'pointer is not null, yay' << std::endl; 17 CWiimote::EventTypes e = p->GetEvent(); 18 if(p->Buttons.isPressed(CButtons::BUTTON_A)) 19 orxout()<<"ZOMG!!1!"<<endl; 20 Orientation o; 21 p->Accelerometer.GetOrientation(o.pitch, o.roll, o.yaw); 22 int x = (int)((o.yaw-lastOrientation.yaw)*time.getDeltaTime()); 23 int y = (int)((o.pitch-lastOrientation.pitch)*time.getDeltaTime()); 24 IntVector2 abs(0, 0); 25 IntVector2 rel(x, y); 26 IntVector2 clippingSize(1920, 1080); 27 if(x!=0&&y!=0) 16 orxout(user_warning) << "pointer is not null, yay" << std::endl; 17 if (PWii->Poll()) 28 18 { 29 for (unsigned int i = 0; i < inputStates_.size(); ++i) 30 inputStates_[i]->mouseMoved(abs, rel, clippingSize); 19 CWiimote::EventTypes e = p->GetEvent(); 20 if(p->Buttons.isPressed(CButtons::BUTTON_A)) 21 orxout()<<"ZOMG!!1!"<<endl; 22 Orientation o; 23 p->Accelerometer.GetOrientation(o.pitch, o.roll, o.yaw); 24 int x = (int)((o.yaw-lastOrientation.yaw)*time.getDeltaTime()); 25 int y = (int)((o.pitch-lastOrientation.pitch)*time.getDeltaTime()); 26 IntVector2 abs(0, 0); 27 IntVector2 rel(x, y); 28 IntVector2 clippingSize(1920, 1080); 29 if(x!=0&&y!=0) 30 { 31 for (unsigned int i = 0; i < inputStates_.size(); ++i) 32 inputStates_[i]->mouseMoved(abs, rel, clippingSize); 33 } 31 34 } 32 35 … … 41 44 42 45 } 43 WiiMote::WiiMote(unsigned int id, CWiimote & parent ) : InputDevice(id)46 WiiMote::WiiMote(unsigned int id, CWiimote & parent, CWii & parentWii) : InputDevice(id) 44 47 { 45 48 p = &parent; 46 49 PWii = &parentWii; 47 50 lastOrientation.yaw = 0; 48 51 lastOrientation.roll = 0;
Note: See TracChangeset
for help on using the changeset viewer.