[Orxonox-commit 5185] r9850 - code/branches/wiimote/src/libraries/core/input

georgr at orxonox.net georgr at orxonox.net
Mon Dec 2 15:35:38 CET 2013


Author: georgr
Date: 2013-12-02 15:35:38 +0100 (Mon, 02 Dec 2013)
New Revision: 9850

Modified:
   code/branches/wiimote/src/libraries/core/input/WiiMote.cc
   code/branches/wiimote/src/libraries/core/input/WiiMote.h
Log:
A should fire main lazors now

Modified: code/branches/wiimote/src/libraries/core/input/WiiMote.cc
===================================================================
--- code/branches/wiimote/src/libraries/core/input/WiiMote.cc	2013-12-02 14:30:55 UTC (rev 9849)
+++ code/branches/wiimote/src/libraries/core/input/WiiMote.cc	2013-12-02 14:35:38 UTC (rev 9850)
@@ -1,8 +1,9 @@
 #include "WiiMote.h"
 #include "core/CoreIncludes.h"
-#include "core/command/ConsoleCommand.h"
+//#include "core/command/ConsoleCommand.h"
 #include <wiicpp/wiicpp/wiicpp.h>
 
+
 namespace orxonox
 {
 
@@ -12,17 +13,19 @@
 		orxout(user_warning) << this->inputStates_.size() << std::endl;
 		if(p == NULL)
 	      exit(0);
-		else
-		  orxout(user_warning) << "pointer is not null, yay" << std::endl;
+		//else
+		  //orxout(user_warning) << "pointer is not null, yay" << std::endl;
 		if (PWii->Poll())
 		{
 			CWiimote::EventTypes e = p->GetEvent();
 			if(p->Buttons.isPressed(CButtons::BUTTON_A))
-				orxout()<<"ZOMG!!1!"<<endl;
+				{
+					CE->execute("fire 0", 0, 0);
+				}
 			Orientation o;
 			p->SetMotionSensingMode(CWiimote::ON);
 			p->Accelerometer.GetOrientation(o.pitch, o.roll, o.yaw);
-			int x = (int)((o.yaw-lastOrientation.yaw)/time.getDeltaTime());
+			int x = (int)(500*(o.yaw-lastOrientation.yaw)/time.getDeltaTime());
 			int y = (int)((o.pitch-lastOrientation.pitch)/time.getDeltaTime());
 			IntVector2 abs(0, 0);
 			IntVector2 rel(x, y);
@@ -54,6 +57,7 @@
 		lastOrientation.yaw = 0;
 		lastOrientation.roll = 0;
 		lastOrientation.pitch = 0;
+		CE = &(CommandExecutor::getInstance());
 
 	}
 }

Modified: code/branches/wiimote/src/libraries/core/input/WiiMote.h
===================================================================
--- code/branches/wiimote/src/libraries/core/input/WiiMote.h	2013-12-02 14:30:55 UTC (rev 9849)
+++ code/branches/wiimote/src/libraries/core/input/WiiMote.h	2013-12-02 14:35:38 UTC (rev 9850)
@@ -41,5 +41,6 @@
 	         void test(int x, int y);
 	         CWiimote * p;
 	         CWii * PWii; //parent "wii" the wiimote is registered to
+	         CommandExecutor * CE;
 	};
 };




More information about the Orxonox-commit mailing list