[Orxonox-commit 5176] r9841 - code/branches/wiimote/src/libraries/core/input
georgr at orxonox.net
georgr at orxonox.net
Mon Dec 2 14:46:02 CET 2013
Author: georgr
Date: 2013-12-02 14:46:02 +0100 (Mon, 02 Dec 2013)
New Revision: 9841
Modified:
code/branches/wiimote/src/libraries/core/input/WiiMote.cc
Log:
trying to get a reaction out of the wiiMote
Modified: code/branches/wiimote/src/libraries/core/input/WiiMote.cc
===================================================================
--- code/branches/wiimote/src/libraries/core/input/WiiMote.cc 2013-12-02 13:38:52 UTC (rev 9840)
+++ code/branches/wiimote/src/libraries/core/input/WiiMote.cc 2013-12-02 13:46:02 UTC (rev 9841)
@@ -20,13 +20,16 @@
if(p->Buttons.isPressed(CButtons::BUTTON_A))
orxout()<<"ZOMG!!1!"<<endl;
Orientation o;
+ p->Accelerometer.
p->Accelerometer.GetOrientation(o.pitch, o.roll, o.yaw);
- int x = (int)((o.yaw-lastOrientation.yaw)*time.getDeltaTime());
- int y = (int)((o.pitch-lastOrientation.pitch)*time.getDeltaTime());
+ int x = (int)(1000*(o.yaw-lastOrientation.yaw)/time.getDeltaTime());
+ int y = (int)(1000*(o.pitch-lastOrientation.pitch)/time.getDeltaTime());
IntVector2 abs(0, 0);
IntVector2 rel(x, y);
IntVector2 clippingSize(1920, 1080);
- if(x!=0&&y!=0)
+ lastOrientation.pitch = o.pitch;
+ lastOrientation.yaw = o.yaw;
+ if(x!=0 && y!=0)
{
for (unsigned int i = 0; i < inputStates_.size(); ++i)
inputStates_[i]->mouseMoved(abs, rel, clippingSize);
More information about the Orxonox-commit
mailing list