[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14339] trunk/blender/source: Patch #8740: enable negative axis radar sensor

Benoit Bolsee benoit.bolsee at online.be
Sun Apr 6 00:08:15 CEST 2008


Revision: 14339
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14339
Author:   ben2610
Date:     2008-04-06 00:08:15 +0200 (Sun, 06 Apr 2008)

Log Message:
-----------
Patch #8740: enable negative axis radar sensor

Modified Paths:
--------------
    trunk/blender/source/blender/src/buttons_logic.c
    trunk/blender/source/gameengine/Ketsji/KX_RadarSensor.cpp

Modified: trunk/blender/source/blender/src/buttons_logic.c
===================================================================
--- trunk/blender/source/blender/src/buttons_logic.c	2008-04-05 21:33:06 UTC (rev 14338)
+++ trunk/blender/source/blender/src/buttons_logic.c	2008-04-05 22:08:15 UTC (rev 14339)
@@ -1096,18 +1096,13 @@
 					 (short)(10+xco),(short)(yco-44), (short)(0.7 * (width-20)), 19,
 					 &rs->name, 0, 31, 0, 0,
 					 "Only look for Objects with this property");
-			uiDefButS(block, ROW, 1, "X",
-					 (short)(10+xco+0.7 * (width-20)),(short)(yco-44), (short)(0.1 * (width-22)),19,
-					 &rs->axis, 2.0, 0, 0, 0,
-					 "Cast the cone along the object's positive x-axis");
-			uiDefButS(block, ROW, 1, "Y",
-					 (short)(10+xco+0.8 * (width-20)),(short)(yco-44),(short)(0.1 * (width-22)), 19,
-					 &rs->axis, 2.0, 1, 0, 0,
-					 "Cast the cone along the object's positive y-axis");
-			uiDefButS(block, ROW, 1, "Z",
-					 (short)(10+xco+0.9 * (width-20)), (short)(yco-44), (short)(0.1 * (width-22)), 19,
-					 &rs->axis, 2.0, 2, 0, 0,
-					 "Cast the cone along the object's positive z-axis");
+
+			str = "Type %t|+X axis %x0|+Y axis %x1|+Z axis %x2|-X axis %x3|-Y axis %x4|-Z axis %x5"; 
+			uiDefButS(block, MENU, B_REDR, str,
+				(short)(10+xco+0.7 * (width-20)), (short)(yco-44), (short)(0.3 * (width-22)), 19,
+				&rs->axis, 2.0, 31, 0, 0,
+				"Specify along which axis the radar cone is cast.");
+				
 			uiDefButF(block, NUM, 1, "Ang:",
 					 (short)(10+xco), (short)(yco-68), (short)((width-20)/2), 19,
 					 &rs->angle, 0.0, 179.9, 10, 0,

Modified: trunk/blender/source/gameengine/Ketsji/KX_RadarSensor.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_RadarSensor.cpp	2008-04-05 21:33:06 UTC (rev 14338)
+++ trunk/blender/source/gameengine/Ketsji/KX_RadarSensor.cpp	2008-04-05 22:08:15 UTC (rev 14339)
@@ -127,27 +127,48 @@
 	// depends on the radar 'axis'
 	switch (m_axis)
 	{
-	case 0: // X Axis
+	case 0: // +X Axis
 		{
 			MT_Quaternion rotquatje(MT_Vector3(0,0,1),MT_radians(90));
 			trans.rotate(rotquatje);
 			trans.translate(MT_Vector3 (0, -m_coneheight/2.0 ,0));
 			break;
 		};
-	case 1: // Y Axis
+	case 1: // +Y Axis
 		{
 			MT_Quaternion rotquatje(MT_Vector3(1,0,0),MT_radians(-180));
 			trans.rotate(rotquatje);
 			trans.translate(MT_Vector3 (0, -m_coneheight/2.0 ,0));
 			break;
 		};
-	case 2: // Z Axis
+	case 2: // +Z Axis
 		{
 			MT_Quaternion rotquatje(MT_Vector3(1,0,0),MT_radians(-90));
 			trans.rotate(rotquatje);
 			trans.translate(MT_Vector3 (0, -m_coneheight/2.0 ,0));
 			break;
 		};
+	case 3: // -X Axis
+		{
+			MT_Quaternion rotquatje(MT_Vector3(0,0,1),MT_radians(90));
+			trans.rotate(rotquatje);
+			trans.translate(MT_Vector3 (0, m_coneheight/2.0 ,0));
+			break;
+		};
+	case 4: // -Y Axis
+		{
+			MT_Quaternion rotquatje(MT_Vector3(1,0,0),MT_radians(-180));
+			trans.rotate(rotquatje);
+			trans.translate(MT_Vector3 (0, m_coneheight/2.0 ,0));
+			break;
+		};
+	case 5: // -Z Axis
+		{
+			MT_Quaternion rotquatje(MT_Vector3(1,0,0),MT_radians(-90));
+			trans.rotate(rotquatje);
+			trans.translate(MT_Vector3 (0, m_coneheight/2.0 ,0));
+			break;
+		};
 	default:
 		{
 		}





More information about the Bf-blender-cvs mailing list