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/Rasterizer/RAS_MaterialBucket.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/Rasterizer/RAS_MaterialBucket.cpp')
-rw-r--r-- | source/gameengine/Rasterizer/RAS_MaterialBucket.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp index 4b5fc6510e0..2078fc99f2e 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp @@ -287,6 +287,16 @@ void RAS_MeshSlot::AddPolygonVertex(int offset) m_endindex++; } +void RAS_MeshSlot::UpdateDisplayArraysOffset() +{ + unsigned int offset = 0; + for (unsigned short i = 0; i < m_displayArrays.size(); ++i) { + RAS_DisplayArray *darray = m_displayArrays[i]; + darray->m_offset = offset; + offset += darray->m_vertex.size(); + } +} + void RAS_MeshSlot::SetDeformer(RAS_Deformer* deformer) { if (deformer && m_pDeformer != deformer) { |