Changeset View
Changeset View
Standalone View
Standalone View
source/gameengine/GameLogic/SCA_MouseFocusSensor.h
- This file was moved from source/gameengine/Ketsji/KX_MouseFocusSensor.h.
| Show All 19 Lines | |||||
| * | * | ||||
| * The Original Code is: all of this file. | * The Original Code is: all of this file. | ||||
| * | * | ||||
| * Contributor(s): none yet. | * Contributor(s): none yet. | ||||
| * | * | ||||
| * ***** END GPL LICENSE BLOCK ***** | * ***** END GPL LICENSE BLOCK ***** | ||||
| */ | */ | ||||
| /** \file KX_MouseFocusSensor.h | /** \file SCA_MouseFocusSensor.h | ||||
| * \ingroup ketsji | * \ingroup gamelogic | ||||
| * \brief KX_MouseFocusSensor determines mouse in/out/over events. | * \brief SCA_MouseFocusSensor determines mouse in/out/over events. | ||||
| */ | */ | ||||
| #ifndef __KX_MOUSEFOCUSSENSOR_H__ | #ifndef __SCA_MOUSEFOCUSSENSOR_H__ | ||||
| #define __KX_MOUSEFOCUSSENSOR_H__ | #define __SCA_MOUSEFOCUSSENSOR_H__ | ||||
| #include "SCA_MouseSensor.h" | #include "SCA_MouseSensor.h" | ||||
| #include "MT_Point3.h" | |||||
| #include "MT_Vector2.h" | |||||
| #include "KX_Camera.h" | |||||
| class KX_RayCast; | class KX_RayCast; | ||||
| /** | /** | ||||
| * The mouse focus sensor extends the basic SCA_MouseSensor. It has | * The mouse focus sensor extends the basic SCA_MouseSensor. | ||||
| * been placed in KX because it needs access to the rasterizer and | |||||
| * SuMO. | |||||
| * | * | ||||
| * - extend the valid modes? | * - extend the valid modes? | ||||
| * - */ | * - */ | ||||
| class KX_MouseFocusSensor : public SCA_MouseSensor | class SCA_MouseFocusSensor : public SCA_MouseSensor | ||||
| { | { | ||||
| Py_Header | Py_Header | ||||
| public: | public: | ||||
| KX_MouseFocusSensor(class SCA_MouseManager* eventmgr, | SCA_MouseFocusSensor(class SCA_MouseManager* eventmgr, | ||||
| int startx, | int startx, | ||||
| int starty, | int starty, | ||||
| short int mousemode, | short int mousemode, | ||||
| int focusmode, | int focusmode, | ||||
| bool bTouchPulse, | bool bTouchPulse, | ||||
| KX_Scene* kxscene, | KX_Scene* kxscene, | ||||
| KX_KetsjiEngine* kxengine, | KX_KetsjiEngine* kxengine, | ||||
| SCA_IObject* gameobj); | SCA_IObject* gameobj); | ||||
| virtual ~KX_MouseFocusSensor() { } | virtual ~SCA_MouseFocusSensor() { } | ||||
| virtual CValue* GetReplica() { | virtual CValue* GetReplica() { | ||||
| CValue* replica = new KX_MouseFocusSensor(*this); | CValue* replica = new SCA_MouseFocusSensor(*this); | ||||
| // this will copy properties and so on... | // this will copy properties and so on... | ||||
| replica->ProcessReplica(); | replica->ProcessReplica(); | ||||
| return replica; | return replica; | ||||
| }; | } | ||||
| virtual void Replace_IScene(SCA_IScene *val) | virtual void Replace_IScene(SCA_IScene *val) | ||||
| { | { | ||||
| m_kxscene= static_cast<KX_Scene *>(val); | m_kxscene= static_cast<KX_Scene *>(val); | ||||
| }; | } | ||||
| /** | /** | ||||
| * \attention Overrides default evaluate. | * \attention Overrides default evaluate. | ||||
| */ | */ | ||||
| virtual bool Evaluate(); | virtual bool Evaluate(); | ||||
| virtual void Init(); | virtual void Init(); | ||||
| virtual bool IsPositiveTrigger() { | virtual bool IsPositiveTrigger() { | ||||
| bool result = m_positive_event; | bool result = m_positive_event; | ||||
| if (m_invert) result = !result; | if (m_invert) result = !result; | ||||
| return result; | return result; | ||||
| }; | } | ||||
| bool RayHit(KX_ClientObjectInfo* client, KX_RayCast* result, void * const data); | bool RayHit(KX_ClientObjectInfo* client, KX_RayCast* result, void * const data); | ||||
| bool NeedRayCast(KX_ClientObjectInfo* client) { return true; } | bool NeedRayCast(KX_ClientObjectInfo* client) { return true; } | ||||
| const MT_Point3& RaySource() const; | const MT_Point3& RaySource() const; | ||||
| const MT_Point3& RayTarget() const; | const MT_Point3& RayTarget() const; | ||||
| const MT_Point3& HitPosition() const; | const MT_Point3& HitPosition() const; | ||||
| const MT_Vector3& HitNormal() const; | const MT_Vector3& HitNormal() const; | ||||
| ▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | private: | ||||
| * determines a part of the start location of the picking ray. */ | * determines a part of the start location of the picking ray. */ | ||||
| KX_Scene* m_kxscene; | KX_Scene* m_kxscene; | ||||
| /** | /** | ||||
| * The KX engine is needed for computing the viewport */ | * The KX engine is needed for computing the viewport */ | ||||
| KX_KetsjiEngine* m_kxengine; | KX_KetsjiEngine* m_kxengine; | ||||
| }; | }; | ||||
| #endif /* __KX_MOUSESENSOR */ | #endif /* __SCA_MOUSESENSOR */ | ||||