[Orxonox-commit 5254] r9917 - code/branches/wiimote/src/libraries/core/input

georgr at orxonox.net georgr at orxonox.net
Mon Dec 16 15:35:48 CET 2013


Author: georgr
Date: 2013-12-16 15:35:48 +0100 (Mon, 16 Dec 2013)
New Revision: 9917

Modified:
   code/branches/wiimote/src/libraries/core/input/WiiMote.cc
Log:
HumanController rotateRoll needs a vector as argument... the moar you know

Modified: code/branches/wiimote/src/libraries/core/input/WiiMote.cc
===================================================================
--- code/branches/wiimote/src/libraries/core/input/WiiMote.cc	2013-12-16 14:25:57 UTC (rev 9916)
+++ code/branches/wiimote/src/libraries/core/input/WiiMote.cc	2013-12-16 14:35:48 UTC (rev 9917)
@@ -28,16 +28,16 @@
 								//orxout()<<"fak u dolan"<<endl;
 								CommandExecutor::execute("fire 0", 0, 0);
 							}
-//							if(p->ExpansionDevice.GetType()==CExpansionDevice::TYPE_NUNCHUK)
-//							{
-//								if(p->ExpansionDevice.Nunchuk.Buttons.isPressed(CNunchukButtons::BUTTON_C))
-//									CommandExecutor::execute("NewHumanController accelerate");
-//								if(p->ExpansionDevice.Nunchuk.Buttons.isPressed(CNunchukButtons::BUTTON_Z))
-//									CommandExecutor::execute("NewHumanController decelerate");
-//							}
-//							float dummyPitch, dummyYaw, dummyRoll;
-//							p->Accelerometer.GetOrientation(dummyPitch, dummyRoll, dummyYaw);
-//							r += dummyRoll;
+							if(p->ExpansionDevice.GetType()==CExpansionDevice::TYPE_NUNCHUK)
+							{
+								if(p->ExpansionDevice.Nunchuk.Buttons.isPressed(CNunchukButtons::BUTTON_C))
+									CommandExecutor::execute("NewHumanController accelerate");
+								if(p->ExpansionDevice.Nunchuk.Buttons.isPressed(CNunchukButtons::BUTTON_Z))
+									CommandExecutor::execute("NewHumanController decelerate");
+							}
+							float dummyPitch, dummyYaw, dummyRoll;
+							p->Accelerometer.GetOrientation(dummyPitch, dummyRoll, dummyYaw);
+							r += dummyRoll;
 							break;
 						}
 						case CWiimote::EVENT_STATUS:
@@ -51,21 +51,27 @@
 					}
 				}
 		}
-//		r/=4;
-//		std::stringstream temp;
+		r/=4;
+		std::stringstream temp;
 //		temp << "scale ";
-//		temp << (r-lastOrientation.roll);
+		if (r>0)
+			temp << "HumanController rotateRoll 1,1";
+		if (r<0)
+			temp << "HumanController rotateRoll -1,-1";
+		if (r==0)
+			temp << "";
 //		temp << " rotateRoll";
-//		string com = temp.str();
-//		orxout()<<com<<endl;
-//		//CommandExecutor::execute(com, 0, 0);
 
+		string com = temp.str();
+		//orxout()<<com<<endl;
+		CommandExecutor::execute(com, 0, 0);
+
 		IntVector2 abs(0,0);
 		IntVector2 rel(0,0);
 		IntVector2 clippingSize(1920, 1080);
 		p->IR.GetCursorPosition(o.x, o.y);
-//		orxout() << "y: " << o.y << " x: " << o.x << endl;
-//		orxout() << p->IR.GetNumDots() << endl;
+		//orxout() << "y: " << o.y << " x: " << o.x << endl;
+		//orxout() << p->IR.GetNumDots() << endl;
 		rel.x = (o.x-lastCursor.x);
 		rel.y = (o.y-lastCursor.y);
 		abs.x = o.x;




More information about the Orxonox-commit mailing list