[Orxonox-commit 5181] r9846 - code/branches/wiimote/src/libraries/core/input

georgr at orxonox.net georgr at orxonox.net
Mon Dec 2 14:57:38 CET 2013


Author: georgr
Date: 2013-12-02 14:57:38 +0100 (Mon, 02 Dec 2013)
New Revision: 9846

Modified:
   code/branches/wiimote/src/libraries/core/input/WiiMote.cc
Log:
trying to get a reaction out of the wiiMote, 5th try

Modified: code/branches/wiimote/src/libraries/core/input/WiiMote.cc
===================================================================
--- code/branches/wiimote/src/libraries/core/input/WiiMote.cc	2013-12-02 13:53:38 UTC (rev 9845)
+++ code/branches/wiimote/src/libraries/core/input/WiiMote.cc	2013-12-02 13:57:38 UTC (rev 9846)
@@ -22,15 +22,15 @@
 			Orientation o;
 			p->SetMotionSensingMode(CWiimote::ON);
 			p->Accelerometer.GetOrientation(o.pitch, o.roll, o.yaw);
-			int x = (int)(1000*(o.yaw-lastOrientation.yaw)/time.getDeltaTime());
-			int y = (int)(1000*(o.pitch-lastOrientation.pitch)/time.getDeltaTime());
+			int x = (int)((o.yaw-lastOrientation.yaw)/time.getDeltaTime());
+			int y = (int)((o.pitch-lastOrientation.pitch)/time.getDeltaTime());
 			IntVector2 abs(0, 0);
 			IntVector2 rel(x, y);
 			IntVector2 clippingSize(1920, 1080);
 			lastOrientation.pitch = o.pitch;
 			lastOrientation.yaw = o.yaw;
 			orxout()<<x<<std::endl<<y<<std::endl;
-			if(x!=0 && y!=0)
+			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