This commit is contained in:
Howard Stearns 2015-07-30 17:03:06 -07:00
commit 51ed912f5e

View file

@ -1625,15 +1625,21 @@ void Model::renderPart(RenderArgs* args, int meshIndex, int partIndex, bool tran
} }
if (isSkinned) { if (isSkinned) {
const float* bones = (const float*)state.clusterMatrices.constData(); const float* bones;
if (_cauterizeBones) { if (_cauterizeBones) {
bones = (const float*)state.cauterizedClusterMatrices.constData(); bones = (const float*)state.cauterizedClusterMatrices.constData();
} else {
bones = (const float*)state.clusterMatrices.constData();
} }
batch._glUniformMatrix4fv(locations->clusterMatrices, state.clusterMatrices.size(), false, bones); batch._glUniformMatrix4fv(locations->clusterMatrices, state.clusterMatrices.size(), false, bones);
_transforms[0] = Transform(); _transforms[0] = Transform();
_transforms[0].preTranslate(_translation); _transforms[0].preTranslate(_translation);
} else { } else {
_transforms[0] = Transform(state.clusterMatrices[0]); if (_cauterizeBones) {
_transforms[0] = Transform(state.cauterizedClusterMatrices[0]);
} else {
_transforms[0] = Transform(state.clusterMatrices[0]);
}
_transforms[0].preTranslate(_translation); _transforms[0].preTranslate(_translation);
} }
batch.setModelTransform(_transforms[0]); batch.setModelTransform(_transforms[0]);