diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2008-08-28 23:37:49 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2008-08-28 23:37:49 +0400 |
commit | 272132888f09b9dd4e0b1e519aab5a38380752b2 (patch) | |
tree | 5d16c68bfdf86fc9c29eea81b67f96492b61e575 /source/blender | |
parent | 9f10007bfb4c87498e67d30a5d2b3b294585b4fc (diff) |
BGE patch: add X-Ray option to ray sensor. The option is effective only if a property is set: the sensor will ignore the objects that don't have the property.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/makesdna/DNA_sensor_types.h | 3 | ||||
-rw-r--r-- | source/blender/src/buttons_logic.c | 9 |
2 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/makesdna/DNA_sensor_types.h b/source/blender/makesdna/DNA_sensor_types.h index b5d8511c698..d508ff3a552 100644 --- a/source/blender/makesdna/DNA_sensor_types.h +++ b/source/blender/makesdna/DNA_sensor_types.h @@ -237,6 +237,9 @@ typedef struct bJoystickSensor { * */ /* #define SENS_COLLISION_PROPERTY 0 */ #define SENS_COLLISION_MATERIAL 1 +/* ray specific mode */ +/* X-Ray means that the ray will traverse objects that don't have the property/material */ +#define SENS_RAY_XRAY 2 /* Some stuff for the mouse sensor Type: */ #define BL_SENS_MOUSE_LEFT_BUTTON 1 diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index b7ce16f50a6..9b41b646bc8 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -1390,9 +1390,14 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short &raySens->propname, 0, 31, 0, 0, "Only look for Objects with this property"); } - + + /* X-Ray option */ + uiDefButBitS(block, TOG, SENS_RAY_XRAY, 1, "X", + xco + 10,yco - 68, 0.10 * (width-20), 19, + &raySens->mode, 0.0, 0.0, 0, 0, + "Toggle X-Ray option (see through objects that don't have the property)"); /* 2. sensing range */ - uiDefButF(block, NUM, 1, "Range", xco+10, yco-68, 0.6 * (width-20), 19, + uiDefButF(block, NUM, 1, "Range", xco+10 + 0.10 * (width-20), yco-68, 0.5 * (width-20), 19, &raySens->range, 0.01, 10000.0, 100, 0, "Sense objects no farther than this distance"); |