Changeset 9838 for code/branches/wiimote
- Timestamp:
- Dec 2, 2013, 2:09:41 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
r9819 r9838 255 255 { 256 256 orxout()<< "Size of devices vector before wiimote insertion:" << devices_.size() << std::endl; 257 devices_.push_back(new WiiMote( devices_.size(), *i));257 devices_.push_back(new WiiMote((unsigned int)devices_.size(), *i, wii)); 258 258 //devices_[2] = new WiiMote(devices_.size(), *(new CWiimote())); 259 259 orxout()<< "Size of devices vector after wiimote insertion:" << devices_.size() << std::endl; -
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; -
code/branches/wiimote/src/libraries/core/input/WiiMote.h
r9813 r9838 21 21 public: 22 22 //! Only resets the members 23 WiiMote(unsigned int id, CWiimote & parent );23 WiiMote(unsigned int id, CWiimote & parent, CWii & parentWii); 24 24 ~WiiMote() { } 25 25 //! Returns the device class (derived) name as string … … 41 41 void test(int x, int y); 42 42 CWiimote * p; 43 CWii * PWii; //parent "wii" the wiimote is registered to 43 44 }; 44 45 };
Note: See TracChangeset
for help on using the changeset viewer.