]> git.tdb.fi Git - libs/gl.git/commitdiff
Fix applying of single-component scaling curves
authorMikko Rasa <tdb@tdb.fi>
Thu, 7 Jan 2021 22:28:19 +0000 (00:28 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 7 Jan 2021 22:28:19 +0000 (00:28 +0200)
source/animation.cpp

index 94c96809214215aa890797a24a9c774ff0401f74..e568d2217f1ff18f54323509e455c6b61443881a 100644 (file)
@@ -344,12 +344,18 @@ void Animation::ValueCurve<1>::apply(float x, Matrix &matrix) const
        float value = spline(x);
        if(target==POSITION || target==SCALE)
        {
-               Vector3 vec;
-               vec[component] = value;
                if(target==POSITION)
+               {
+                       Vector3 vec;
+                       vec[component] = value;
                        matrix.translate(vec);
+               }
                else
+               {
+                       Vector3 vec(1.0f, 1.0f, 1.0f);
+                       vec[component] = value;
                        matrix.scale(vec);
+               }
        }
        else if(target==EULER)
        {