1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 03:12:36 +01:00

Remove string comparision from getFrameMatrix

This commit is contained in:
Daniel Evans 2014-06-01 20:18:52 +01:00
parent 602218579c
commit 3be84c02c1

View File

@ -99,7 +99,8 @@ glm::mat4 Animator::getFrameMatrix(ModelFrame* frame, float alpha) const
if(it != getAnimation()->bones.end()) {
auto kf = it->second->getInterpolatedKeyframe(getAnimationTime(alpha));
glm::mat4 m;
if(it->second->type == AnimationBone::R00 || frame->getName() == "swaist") {
bool isRoot = frame->getParent() ? !! frame->getParent() : true;
if(it->second->type == AnimationBone::R00 || isRoot ) {
m = glm::translate(m, frame->getDefaultTranslation());
m = m * glm::mat4_cast(kf.rotation);
}