diff --git a/animation/PlayerAnimation.cpp b/animation/PlayerAnimation.cpp index 1fafee39ab95d51ea75569db1cd9aaf439d81712..a6371b409cedd2cd7867684c61ac67e865716097 100644 --- a/animation/PlayerAnimation.cpp +++ b/animation/PlayerAnimation.cpp @@ -452,7 +452,11 @@ namespace ozz } c1 = candicates0; lastR = r; } - c1.erase(c1.find(track)); + auto itr = c1.find(track); + if (itr != c1.end()) + { + c1.erase(itr); + } } for (std::map::iterator it = c1.begin(); it != c1.end(); ++it) diff --git a/animation/PlayerAnimationInternal.cpp b/animation/PlayerAnimationInternal.cpp index f51147c14d9fd3a34f8e6032dbc52bdc3fd890d3..f16d08ee4da2d7e4eadd36d42a60952ea5d2d89e 100644 --- a/animation/PlayerAnimationInternal.cpp +++ b/animation/PlayerAnimationInternal.cpp @@ -121,9 +121,9 @@ bool OzzAnimation::applyMesh(osg::Geometry& geom, const OzzMesh& mesh) vIndex += count; } - if (!hasNormals) osgUtil::SmoothingVisitor::smooth(geom); + if (!hasNormals) osgUtil::SmoothingVisitor::smooth(geom); else na->dirty(); if (!hasColors && ca->size() > 0) memset(&((*ca)[0]), 255, ca->size() * sizeof(uint8_t) * 4); - va->dirty(); na->dirty(); ta->dirty(); ca->dirty(); + va->dirty(); ta->dirty(); ca->dirty(); geom.dirtyBound(); return true; } @@ -239,10 +239,10 @@ bool OzzAnimation::applySkinningMesh(osg::Geometry& geom, const OzzMesh& mesh) vIndex += count; } - if (!hasNormals) osgUtil::SmoothingVisitor::smooth(geom); + if (!hasNormals) osgUtil::SmoothingVisitor::smooth(geom); else na->dirty(); if (!hasColors && ca->size() > 0) memset(&((*ca)[0]), 255, ca->size() * sizeof(uint8_t) * 4); if (dirtyVA > 0) { ta->dirty(); ca->dirty(); } - va->dirty(); na->dirty(); geom.dirtyBound(); + va->dirty(); geom.dirtyBound(); return true; }