Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2009-12-08 11:58:24 +0300
committerBenoit Bolsee <benoit.bolsee@online.be>2009-12-08 11:58:24 +0300
commitd765068fca979efece01bf124141d4df56fca9ef (patch)
treed479a85fcfbee95432738a2f1c9348328d37cb24 /source/gameengine/Ketsji/KX_MouseFocusSensor.h
parent2318886f7029cef4c0890d3ae9c56b86cc49d7ad (diff)
BGE: add hitUV property to mouse focus sensor to return UV coordinates under mouse pointer. Useful for texture painting. More details in PyDoc.
Diffstat (limited to 'source/gameengine/Ketsji/KX_MouseFocusSensor.h')
-rw-r--r--source/gameengine/Ketsji/KX_MouseFocusSensor.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.h b/source/gameengine/Ketsji/KX_MouseFocusSensor.h
index e3f0e2b34f5..b107b54434b 100644
--- a/source/gameengine/Ketsji/KX_MouseFocusSensor.h
+++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.h
@@ -92,6 +92,7 @@ class KX_MouseFocusSensor : public SCA_MouseSensor
const MT_Point3& RayTarget() const;
const MT_Point3& HitPosition() const;
const MT_Vector3& HitNormal() const;
+ const MT_Vector2& HitUV() const;
#ifndef DISABLE_PYTHON
@@ -106,6 +107,7 @@ class KX_MouseFocusSensor : public SCA_MouseSensor
static PyObject* pyattr_get_hit_object(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_hit_position(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static PyObject* pyattr_get_hit_normal(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static PyObject* pyattr_get_hit_uv(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
#endif // DISABLE_PYTHON
@@ -165,6 +167,11 @@ class KX_MouseFocusSensor : public SCA_MouseSensor
MT_Vector3 m_hitNormal;
/**
+ * UV texture coordinate of the hit point if any, (0,0) otherwise
+ */
+ MT_Vector2 m_hitUV;
+
+ /**
* The KX scene that holds the camera. The camera position
* determines a part of the start location of the picking ray. */
KX_Scene* m_kxscene;