diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2014-07-18 10:00:30 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2014-07-18 10:00:30 +0400 |
commit | 73079730638f1f21c04b075839d87377315e8f86 (patch) | |
tree | cb00518c3e35b0e73ba3998585fa3bd3a8ee33e6 /source/gameengine/Converter | |
parent | 841ade32bee1ce9128b98c11d0fc3ae6d74aaf86 (diff) |
BGE: Add property/material detection and X-Ray for mouse over any sensor
This patch adds a Property/Material detection and a X-Ray mode to the mouse over any sensor like on the ray sensor.
Proposal:
http://blenderartists.org/forum/showthread.php?261847-BGE-proposal-Mouse-Over-Any-sensor-with-Property-and-X-Ray&highlight=proposal
Reviewers: moguri
Reviewed By: moguri
Differential Revision: https://developer.blender.org/D653
Diffstat (limited to 'source/gameengine/Converter')
-rw-r--r-- | source/gameengine/Converter/KX_ConvertSensors.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/gameengine/Converter/KX_ConvertSensors.cpp b/source/gameengine/Converter/KX_ConvertSensors.cpp index 93a5ee11366..0d706fcd924 100644 --- a/source/gameengine/Converter/KX_ConvertSensors.cpp +++ b/source/gameengine/Converter/KX_ConvertSensors.cpp @@ -329,12 +329,19 @@ void BL_ConvertSensors(struct Object* blenderobject, gameobj); } else { /* give us a focus-aware sensor */ + bool bFindMaterial = (bmouse->mode & SENS_COLLISION_MATERIAL); + bool bXRay = (bmouse->flag & SENS_RAY_XRAY); + STR_String checkname = (bFindMaterial? bmouse->matname : bmouse->propname); + gamesensor = new KX_MouseFocusSensor(eventmgr, startx, starty, keytype, trackfocus, (bmouse->flag & SENS_MOUSE_FOCUS_PULSE) ? true:false, + checkname, + bFindMaterial, + bXRay, kxscene, kxengine, gameobj); |