Changeset 9919
- Timestamp:
- Dec 16, 2013, 4:05:33 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/wiimote/src/libraries/core/input/WiiMote.cc
r9917 r9919 16 16 IntVector2 o(0,0); 17 17 float r = 0; //roll variable 18 if (p->ExpansionDevice.GetType()!=CExpansionDevice::TYPE_NUNCHUK) 19 { 20 p->UpdateStatus(); 21 PWii->RefreshWiimotes(); 22 } 18 23 for (int i=0; i<4; i++) 19 24 { … … 29 34 CommandExecutor::execute("fire 0", 0, 0); 30 35 } 36 if(p->Buttons.isPressed(CButtons::BUTTON_B)||p->Buttons.isJustPressed(CButtons::BUTTON_B)) 37 CommandExecutor::execute("boost"); 31 38 if(p->ExpansionDevice.GetType()==CExpansionDevice::TYPE_NUNCHUK) 32 39 { … … 54 61 r/=4; 55 62 std::stringstream temp; 56 // temp << "scale "; 57 if (r>0) 58 temp << "HumanController rotateRoll 1,1"; 59 if (r<0) 60 temp << "HumanController rotateRoll -1,-1"; 63 if (r>4.5) 64 temp << "HumanController rotateRoll " << r/6 << ",1"; 65 if (r<-4.5) 66 temp << "HumanController rotateRoll "<< r/6 << ",-1"; 61 67 if (r==0) 62 68 temp << ""; 63 // temp << " rotateRoll";64 65 69 string com = temp.str(); 66 //orxout()<<com<<endl;67 70 CommandExecutor::execute(com, 0, 0); 68 71 … … 71 74 IntVector2 clippingSize(1920, 1080); 72 75 p->IR.GetCursorPosition(o.x, o.y); 73 //orxout() << "y: " << o.y << " x: " << o.x << endl;74 //orxout() << p->IR.GetNumDots() << endl;75 76 rel.x = (o.x-lastCursor.x); 76 77 rel.y = (o.y-lastCursor.y); … … 84 85 lastCursor.x = o.x; 85 86 lastCursor.y = o.y; 86 lastOrientation.roll = r;87 87 88 88 }
Note: See TracChangeset
for help on using the changeset viewer.