diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-12-16 03:59:02 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-12-16 03:59:02 +0400 |
commit | 862dc635ed98c6d1ffc7c755058c682021da4c6b (patch) | |
tree | 11de5533aaae2da3eab2ab63c5d5977aea73dbc4 /source/gameengine | |
parent | d0b70cffaf99321c57045d8dc8ec197b1542395c (diff) | |
parent | 0dbd9ea73f7f86e02d9aae6c65c3ce5e3c4ecd4b (diff) |
svn merge ^/trunk/blender -r42617:42655
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Converter/BL_SkinDeformer.cpp | 16 | ||||
-rw-r--r-- | source/gameengine/Rasterizer/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/gameengine/Rasterizer/RAS_MeshObject.cpp | 22 |
3 files changed, 20 insertions, 19 deletions
diff --git a/source/gameengine/Converter/BL_SkinDeformer.cpp b/source/gameengine/Converter/BL_SkinDeformer.cpp index 0c4806f4bd8..f320df12078 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.cpp +++ b/source/gameengine/Converter/BL_SkinDeformer.cpp @@ -237,12 +237,12 @@ void BL_SkinDeformer::BGEDeformVerts() } } + MDeformVert *dv= dverts; - for (int i=0; i<m_bmesh->totvert; ++i) + for (int i=0; i<m_bmesh->totvert; ++i, dv++) { float contrib = 0.f, weight, max_weight=0.f; bPoseChannel *pchan=NULL; - MDeformVert *dvert; Eigen::Map<Eigen::Vector3f> norm(m_transnors[i]); Eigen::Vector4f vec(0, 0, 0, 1); Eigen::Matrix4f norm_chan_mat; @@ -251,18 +251,18 @@ void BL_SkinDeformer::BGEDeformVerts() m_transverts[i][2], 1.f); - dvert = dverts+i; - - if (!dvert->totweight) + if (!dv->totweight) continue; - for (int j=0; j<dvert->totweight; ++j) + MDeformWeight *dw= dv->dw; + + for (unsigned int j= dv->totweight; j != 0; j--, dw++) { - int index = dvert->dw[j].def_nr; + const int index = dw->def_nr; if (index < defbase_tot && (pchan=m_dfnrToPC[index])) { - weight = dvert->dw[j].weight; + weight = dw->weight; if (weight) { diff --git a/source/gameengine/Rasterizer/CMakeLists.txt b/source/gameengine/Rasterizer/CMakeLists.txt index 08264ce8a67..ddc72c08ea1 100644 --- a/source/gameengine/Rasterizer/CMakeLists.txt +++ b/source/gameengine/Rasterizer/CMakeLists.txt @@ -29,6 +29,7 @@ set(INC ../Ketsji ../SceneGraph ../../blender/makesdna + ../../blender/blenkernel ../../../intern/container ../../../intern/guardedalloc ../../../intern/moto/include diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.cpp b/source/gameengine/Rasterizer/RAS_MeshObject.cpp index 48e9e93b80e..afa62a9a8c6 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.cpp +++ b/source/gameengine/Rasterizer/RAS_MeshObject.cpp @@ -43,6 +43,10 @@ #include <algorithm> +extern "C" { +# include "BKE_deform.h" +} + /* polygon sorting */ struct RAS_MeshObject::polygonSlot @@ -573,8 +577,8 @@ void RAS_MeshObject::CheckWeightCache(Object* obj) { KeyBlock *kb; int kbindex, defindex; - MDeformVert *dvert= NULL; - int totvert, i, j; + MDeformVert *dv= NULL; + int totvert, i; float *weights; if (!m_mesh->key) @@ -598,19 +602,15 @@ void RAS_MeshObject::CheckWeightCache(Object* obj) kb->weights = NULL; } - dvert= m_mesh->dvert; + dv= m_mesh->dvert; totvert= m_mesh->totvert; - weights= (float*)MEM_callocN(totvert*sizeof(float), "weights"); + weights= (float*)MEM_mallocN(totvert*sizeof(float), "weights"); - for (i=0; i < totvert; i++, dvert++) { - for(j=0; j<dvert->totweight; j++) { - if (dvert->dw[j].def_nr == defindex) { - weights[i]= dvert->dw[j].weight; - break; - } - } + for (i=0; i < totvert; i++, dv++) { + weights[i]= defvert_find_weight(dv, defindex); } + kb->weights = weights; m_cacheWeightIndex[kbindex] = defindex; } |