Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9919


Ignore:
Timestamp:
Dec 16, 2013, 4:05:33 PM (10 years ago)
Author:
georgr
Message:

boost mapped to B; roll, steering and acceleration(c/Z) all working.

File:
1 edited

Legend:

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

    r9917 r9919  
    1616                IntVector2 o(0,0);
    1717                float r = 0; //roll variable
     18                if (p->ExpansionDevice.GetType()!=CExpansionDevice::TYPE_NUNCHUK)
     19                        {
     20                                p->UpdateStatus();
     21                                PWii->RefreshWiimotes();
     22                        }
    1823                for (int i=0; i<4; i++)
    1924                {
     
    2934                                                                CommandExecutor::execute("fire 0", 0, 0);
    3035                                                        }
     36                                                        if(p->Buttons.isPressed(CButtons::BUTTON_B)||p->Buttons.isJustPressed(CButtons::BUTTON_B))
     37                                                                CommandExecutor::execute("boost");
    3138                                                        if(p->ExpansionDevice.GetType()==CExpansionDevice::TYPE_NUNCHUK)
    3239                                                        {
     
    5461                r/=4;
    5562                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";
    6167                if (r==0)
    6268                        temp << "";
    63 //              temp << " rotateRoll";
    64 
    6569                string com = temp.str();
    66                 //orxout()<<com<<endl;
    6770                CommandExecutor::execute(com, 0, 0);
    6871
     
    7174                IntVector2 clippingSize(1920, 1080);
    7275                p->IR.GetCursorPosition(o.x, o.y);
    73                 //orxout() << "y: " << o.y << " x: " << o.x << endl;
    74                 //orxout() << p->IR.GetNumDots() << endl;
    7576                rel.x = (o.x-lastCursor.x);
    7677                rel.y = (o.y-lastCursor.y);
     
    8485                lastCursor.x = o.x;
    8586                lastCursor.y = o.y;
    86                 lastOrientation.roll = r;
    8787
    8888        }
Note: See TracChangeset for help on using the changeset viewer.