Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9841 for code/branches/wiimote


Ignore:
Timestamp:
Dec 2, 2013, 2:46:02 PM (11 years ago)
Author:
georgr
Message:

trying to get a reaction out of the wiiMote

File:
1 edited

Legend:

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

    r9838 r9841  
    2121                                orxout()<<"ZOMG!!1!"<<endl;
    2222                        Orientation o;
     23                        p->Accelerometer.
    2324                        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());
     25                        int x = (int)(1000*(o.yaw-lastOrientation.yaw)/time.getDeltaTime());
     26                        int y = (int)(1000*(o.pitch-lastOrientation.pitch)/time.getDeltaTime());
    2627                        IntVector2 abs(0, 0);
    2728                        IntVector2 rel(x, y);
    2829                        IntVector2 clippingSize(1920, 1080);
    29                         if(x!=0&&y!=0)
     30                        lastOrientation.pitch = o.pitch;
     31                        lastOrientation.yaw = o.yaw;
     32                        if(x!=0 && y!=0)
    3033                        {
    3134                                for (unsigned int i = 0; i < inputStates_.size(); ++i)
Note: See TracChangeset for help on using the changeset viewer.