Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9917


Ignore:
Timestamp:
Dec 16, 2013, 3:35:48 PM (10 years ago)
Author:
georgr
Message:

HumanController rotateRoll needs a vector as argument… the moar you know

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/wiimote/src/libraries/core/input/WiiMote.cc

    r9911 r9917  
    2929                                                                CommandExecutor::execute("fire 0", 0, 0);
    3030                                                        }
    31 //                                                      if(p->ExpansionDevice.GetType()==CExpansionDevice::TYPE_NUNCHUK)
    32 //                                                      {
    33 //                                                              if(p->ExpansionDevice.Nunchuk.Buttons.isPressed(CNunchukButtons::BUTTON_C))
    34 //                                                                      CommandExecutor::execute("NewHumanController accelerate");
    35 //                                                              if(p->ExpansionDevice.Nunchuk.Buttons.isPressed(CNunchukButtons::BUTTON_Z))
    36 //                                                                      CommandExecutor::execute("NewHumanController decelerate");
    37 //                                                      }
    38 //                                                      float dummyPitch, dummyYaw, dummyRoll;
    39 //                                                      p->Accelerometer.GetOrientation(dummyPitch, dummyRoll, dummyYaw);
    40 //                                                      r += dummyRoll;
     31                                                        if(p->ExpansionDevice.GetType()==CExpansionDevice::TYPE_NUNCHUK)
     32                                                        {
     33                                                                if(p->ExpansionDevice.Nunchuk.Buttons.isPressed(CNunchukButtons::BUTTON_C))
     34                                                                        CommandExecutor::execute("NewHumanController accelerate");
     35                                                                if(p->ExpansionDevice.Nunchuk.Buttons.isPressed(CNunchukButtons::BUTTON_Z))
     36                                                                        CommandExecutor::execute("NewHumanController decelerate");
     37                                                        }
     38                                                        float dummyPitch, dummyYaw, dummyRoll;
     39                                                        p->Accelerometer.GetOrientation(dummyPitch, dummyRoll, dummyYaw);
     40                                                        r += dummyRoll;
    4141                                                        break;
    4242                                                }
     
    5252                                }
    5353                }
    54 //              r/=4;
    55 //              std::stringstream temp;
     54                r/=4;
     55                std::stringstream temp;
    5656//              temp << "scale ";
    57 //              temp << (r-lastOrientation.roll);
     57                if (r>0)
     58                        temp << "HumanController rotateRoll 1,1";
     59                if (r<0)
     60                        temp << "HumanController rotateRoll -1,-1";
     61                if (r==0)
     62                        temp << "";
    5863//              temp << " rotateRoll";
    59 //              string com = temp.str();
    60 //              orxout()<<com<<endl;
    61 //              //CommandExecutor::execute(com, 0, 0);
     64
     65                string com = temp.str();
     66                //orxout()<<com<<endl;
     67                CommandExecutor::execute(com, 0, 0);
    6268
    6369                IntVector2 abs(0,0);
     
    6571                IntVector2 clippingSize(1920, 1080);
    6672                p->IR.GetCursorPosition(o.x, o.y);
    67 //              orxout() << "y: " << o.y << " x: " << o.x << endl;
    68 //              orxout() << p->IR.GetNumDots() << endl;
     73                //orxout() << "y: " << o.y << " x: " << o.x << endl;
     74                //orxout() << p->IR.GetNumDots() << endl;
    6975                rel.x = (o.x-lastCursor.x);
    7076                rel.y = (o.y-lastCursor.y);
Note: See TracChangeset for help on using the changeset viewer.