From 73079730638f1f21c04b075839d87377315e8f86 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Thu, 17 Jul 2014 23:00:30 -0700 Subject: 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 --- source/gameengine/Ketsji/KX_MouseFocusSensor.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'source/gameengine/Ketsji/KX_MouseFocusSensor.h') diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.h b/source/gameengine/Ketsji/KX_MouseFocusSensor.h index 1f7809831e7..903c3c03571 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.h +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.h @@ -57,6 +57,9 @@ class KX_MouseFocusSensor : public SCA_MouseSensor short int mousemode, int focusmode, bool bTouchPulse, + const STR_String& propname, + bool bFindMaterial, + bool bXRay, KX_Scene* kxscene, KX_KetsjiEngine* kxengine, SCA_IObject* gameobj); @@ -88,7 +91,7 @@ class KX_MouseFocusSensor : public SCA_MouseSensor }; bool RayHit(KX_ClientObjectInfo* client, KX_RayCast* result, void * const data); - bool NeedRayCast(KX_ClientObjectInfo* client) { return true; } + bool NeedRayCast(KX_ClientObjectInfo* client); const MT_Point3& RaySource() const; const MT_Point3& RayTarget() const; @@ -133,6 +136,21 @@ class KX_MouseFocusSensor : public SCA_MouseSensor */ bool m_bTouchPulse; + /** + * Flags get trought other objects + */ + bool m_bXRay; + + /** + * Flags material + */ + bool m_bFindMaterial; + + /** + * Property or material name + */ + STR_String m_propertyname; + /** * Flags whether the previous test evaluated positive. */ -- cgit v1.2.3