Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2008-04-06 02:08:15 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2008-04-06 02:08:15 +0400
commit9edb6c7510742fb9461be179549552374b8aabc9 (patch)
treeba79990c5dd88eeb1e4438bc52d8167b9c076662 /source
parent6e5984ce399ec18b6d91dcd19f9ae4ac705d9fbf (diff)
Patch #8740: enable negative axis radar sensor
Diffstat (limited to 'source')
-rw-r--r--source/blender/src/buttons_logic.c19
-rw-r--r--source/gameengine/Ketsji/KX_RadarSensor.cpp27
2 files changed, 31 insertions, 15 deletions
diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c
index 6b69a4a8da7..8a3e3472ada 100644
--- a/source/blender/src/buttons_logic.c
+++ b/source/blender/src/buttons_logic.c
@@ -1096,18 +1096,13 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short
(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,
diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp
index 5d56eaabb5a..45379f93b54 100644
--- a/source/gameengine/Ketsji/KX_RadarSensor.cpp
+++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp
@@ -127,27 +127,48 @@ void KX_RadarSensor::SynchronizeTransform()
// 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:
{
}