diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2010-11-26 06:37:08 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2010-11-26 06:37:08 +0300 |
commit | 9d9a88348e2f9d1770e4dd7d44df3491489b3ded (patch) | |
tree | d04254b7294384f8d06e3bf38d103ee24544f68b /source/gameengine/Ketsji/KX_RaySensor.cpp | |
parent | 886e7a7f45b7b662f724092bce42e546e8081397 (diff) |
BGE Bugfix: [#24926] Sensor 'Radar' les axes X+ et Y+ ont été inversé. (oui, a french bug report :)
we were using SENSOR_RAY for the radar sensor axis. However the Ray axis is inverted (God knows why) so I created a set of defines only for radar sensor.
Also I thought it was a good idea to replace some hardcoded values in Radar and Ray codes by their defines in DNA_sensor_types.h (similar to what Benoit did for Armature Sensor, so I see no problem on that).
Diffstat (limited to 'source/gameengine/Ketsji/KX_RaySensor.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_RaySensor.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source/gameengine/Ketsji/KX_RaySensor.cpp b/source/gameengine/Ketsji/KX_RaySensor.cpp index 001c7a290d7..2434c031a6a 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.cpp +++ b/source/gameengine/Ketsji/KX_RaySensor.cpp @@ -42,6 +42,7 @@ #include "PHY_IPhysicsEnvironment.h" #include "KX_IPhysicsController.h" #include "PHY_IPhysicsController.h" +#include "DNA_sensor_types.h" #include <stdio.h> @@ -198,42 +199,42 @@ bool KX_RaySensor::Evaluate() m_reset = false; switch (m_axis) { - case 1: // X + case SENS_RAY_X_AXIS: // X { todir[0] = invmat[0][0]; todir[1] = invmat[0][1]; todir[2] = invmat[0][2]; break; } - case 0: // Y + case SENS_RAY_Y_AXIS: // Y { todir[0] = invmat[1][0]; todir[1] = invmat[1][1]; todir[2] = invmat[1][2]; break; } - case 2: // Z + case SENS_RAY_Z_AXIS: // Z { todir[0] = invmat[2][0]; todir[1] = invmat[2][1]; todir[2] = invmat[2][2]; break; } - case 3: // -X + case SENS_RAY_NEG_X_AXIS: // -X { todir[0] = -invmat[0][0]; todir[1] = -invmat[0][1]; todir[2] = -invmat[0][2]; break; } - case 4: // -Y + case SENS_RAY_NEG_Y_AXIS: // -Y { todir[0] = -invmat[1][0]; todir[1] = -invmat[1][1]; todir[2] = -invmat[1][2]; break; } - case 5: // -Z + case SENS_RAY_NEG_Z_AXIS: // -Z { todir[0] = -invmat[2][0]; todir[1] = -invmat[2][1]; |