From Sergey Polischuk, "In and Out control points were computed incorrectly for some animation channels with cubic bezier interpolation"

This commit is contained in:
Robert Osfield
2012-02-22 10:50:38 +00:00
parent caceb94db8
commit 949c635d5d

View File

@@ -115,7 +115,7 @@ void readKeys(KFbxAnimCurve* curveX, KFbxAnimCurve* curveY, KFbxAnimCurve* curve
osgAnimation::FloatCubicBezier key(
val * scalar,
(val + leftTangent.mDerivative / 3.0) * scalar,
(val - leftTangent.mDerivative / 3.0) * scalar,
(val + rightTangent.mDerivative / 3.0) * scalar);
curveTimeMap[nCurve][fTime] = key;
@@ -385,8 +385,8 @@ void readFbxRotationAnimation(osgAnimation::Channel* channels[3],
}
osgAnimation::FloatCubicBezier key(
osg::DegreesToRadians(angle),
osg::DegreesToRadians(angle + leftTangent.mDerivative / 3.0),
osg::DegreesToRadians(angle - rightTangent.mDerivative / 3.0));
osg::DegreesToRadians(angle - leftTangent.mDerivative / 3.0),
osg::DegreesToRadians(angle + rightTangent.mDerivative / 3.0));
pKeyFrameCntr->push_back(osgAnimation::FloatCubicBezierKeyframe(
fTime,