diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2014-04-10 04:04:17 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2014-04-10 04:04:17 +0400 |
commit | 1ce726adb91ebcc5d51cc017ffd8776ac744a36c (patch) | |
tree | 34c31ccc1c26ba4281eb5129583f19051bcf555c /source/gameengine/Converter/BL_ModifierDeformer.cpp | |
parent | 19413644dac0f56623c520c5da2039ed0294c220 (diff) |
BGE: Allow skinned meshes with modifiers to do skinning updates in parallel.
Diffstat (limited to 'source/gameengine/Converter/BL_ModifierDeformer.cpp')
-rw-r--r-- | source/gameengine/Converter/BL_ModifierDeformer.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/gameengine/Converter/BL_ModifierDeformer.cpp b/source/gameengine/Converter/BL_ModifierDeformer.cpp index 7e64d16d012..71dc1bdec87 100644 --- a/source/gameengine/Converter/BL_ModifierDeformer.cpp +++ b/source/gameengine/Converter/BL_ModifierDeformer.cpp @@ -197,6 +197,15 @@ bool BL_ModifierDeformer::Update(void) } m_lastModifierUpdate=m_gameobj->GetLastFrame(); bShapeUpdate = true; + + int nmat = m_pMeshObject->NumMaterials(); + for (int imat=0; imat<nmat; imat++) { + RAS_MeshMaterial *mmat = m_pMeshObject->GetMeshMaterial(imat); + RAS_MeshSlot **slot = mmat->m_slots[(void*)m_gameobj]; + if (!slot || !*slot) + continue; + (*slot)->m_pDerivedMesh = m_dm; + } } return bShapeUpdate; } @@ -206,14 +215,5 @@ bool BL_ModifierDeformer::Apply(RAS_IPolyMaterial *mat) if (!Update()) return false; - // drawing is based on derived mesh, must set it in the mesh slots - int nmat = m_pMeshObject->NumMaterials(); - for (int imat=0; imat<nmat; imat++) { - RAS_MeshMaterial *mmat = m_pMeshObject->GetMeshMaterial(imat); - RAS_MeshSlot **slot = mmat->m_slots[(void*)m_gameobj]; - if (!slot || !*slot) - continue; - (*slot)->m_pDerivedMesh = m_dm; - } return true; } |