Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 25, 2013, 3:38:51 PM (12 years ago)
Author:
georgr
Message:

Added some simple wobbling action. To be tested.

File:
1 edited

Legend:

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

    r9790 r9813  
    1111        {
    1212                orxout(user_warning) << this->inputStates_.size() << std::endl;
     13                CWiimote::EventTypes e = p->GetEvent();
     14                if(p->Buttons.isPressed(CButtons::BUTTON_A))
     15                        orxout()<<"ZOMG!!1!"<<endl;
     16                Orientation o;
     17                p->Accelerometer.GetOrientation(o.pitch, o.roll, o.yaw);
     18                int x = (int)(o.yaw-lastOrientation.yaw)*time.tickDt_;
     19                int y = (int)(o.pitch-lastOrientation.pitch)*time.tickDt_;
     20                IntVector2 abs(0, 0);
     21                IntVector2 rel(x, y);
     22                IntVector2 clippingSize(1920, 1080);
     23                if(x!=0&&y!=0)
     24                {
     25                        for (unsigned int i = 0; i < inputStates_.size(); ++i)
     26                                        inputStates_[i]->mouseMoved(abs, rel, clippingSize);
     27                }
     28
     29
    1330        }
    1431        void WiiMote::clearBuffers()
     
    2340        {
    2441                p = &parent;
     42
     43                lastOrientation.yaw = 0;
     44                lastOrientation.roll = 0;
     45                lastOrientation.pitch = 0;
     46
    2547        }
    2648}
Note: See TracChangeset for help on using the changeset viewer.