diff options
author | Porteries Tristan <republicthunderbolt9@gmail.com> | 2015-06-20 15:21:31 +0300 |
---|---|---|
committer | Porteries Tristan <republicthunderbolt9@gmail.com> | 2015-06-20 15:21:31 +0300 |
commit | 2a305580b2c76af62c129fbca043466ab010c2df (patch) | |
tree | ca2713a78353dc5e0f41915621ef000c2c470b88 /source/gameengine/Ketsji/KX_PolyProxy.cpp | |
parent | 6b3a43ccb4c3d9cc385d1f2acaac2d4d39ce25df (diff) |
BGE: Fix T38030: wrong vertex index returned by KX_PolyProxy
Fix T38030.
In c++ source we use one list for triangles and an other for quads, but KX_PolyProxy doesn't care about that and return the vertex offset in its list. So we just have to compute the offset of each RAS_DisplayArray to its previous to have an absolute vertex index.
Reviewers: moguri, campbellbarton, kupoman, agoose77, brita_, hg1
Reviewed By: agoose77, hg1
Projects: #game_engine
Maniphest Tasks: T38030
Differential Revision: https://developer.blender.org/D1324
Diffstat (limited to 'source/gameengine/Ketsji/KX_PolyProxy.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_PolyProxy.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp index ccc10eb06e3..4454543161b 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.cpp +++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp @@ -140,21 +140,21 @@ PyObject *KX_PolyProxy::pyattr_get_v1(void *self_v, const KX_PYATTRIBUTE_DEF *at { KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); - return PyLong_FromLong(self->m_polygon->GetVertexOffset(0)); + return PyLong_FromLong(self->m_polygon->GetVertexOffsetAbsolute(0)); } PyObject *KX_PolyProxy::pyattr_get_v2(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); - return PyLong_FromLong(self->m_polygon->GetVertexOffset(1)); + return PyLong_FromLong(self->m_polygon->GetVertexOffsetAbsolute(1)); } PyObject *KX_PolyProxy::pyattr_get_v3(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_PolyProxy* self = static_cast<KX_PolyProxy*>(self_v); - return PyLong_FromLong(self->m_polygon->GetVertexOffset(2)); + return PyLong_FromLong(self->m_polygon->GetVertexOffsetAbsolute(2)); } PyObject *KX_PolyProxy::pyattr_get_v4(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -163,7 +163,7 @@ PyObject *KX_PolyProxy::pyattr_get_v4(void *self_v, const KX_PYATTRIBUTE_DEF *at if (3 < self->m_polygon->VertexCount()) { - return PyLong_FromLong(self->m_polygon->GetVertexOffset(3)); + return PyLong_FromLong(self->m_polygon->GetVertexOffsetAbsolute(3)); } return PyLong_FromLong(0); } @@ -243,7 +243,7 @@ KX_PYMETHODDEF_DOC(KX_PolyProxy, getVertexIndex, } if (index < m_polygon->VertexCount()) { - return PyLong_FromLong(m_polygon->GetVertexOffset(index)); + return PyLong_FromLong(m_polygon->GetVertexOffsetAbsolute(index)); } return PyLong_FromLong(0); } |