ソースを参照

Add new line at end of file.[ci skip]

aster2013 11 年 前
コミット
eb7cce7b4d

+ 14 - 14
Source/Engine/Scene/AttributeAnimation.cpp

@@ -38,11 +38,11 @@ namespace Urho3D
     AttributeAnimation::AttributeAnimation(Context* context) :
 Resource(context),
     interpolationMethod_(IM_LINEAR),
+    splineTension_(0.5f),
     valueType_(VAR_NONE),
     isInterpolatable_(false),
     beginTime_(M_INFINITY),
     endTime_(-M_INFINITY),
-    splineTension_(0.5f),
     splineTangentsDirty_(false)
 {
 }
@@ -239,18 +239,18 @@ ObjectAnimation* AttributeAnimation::GetObjectAnimation() const
 
 void AttributeAnimation::UpdateAttributeValue(Animatable* animatable, const AttributeInfo& attributeInfo, float scaledTime)
 {
-    unsigned index = 1;
-    for (; index < keyFrames_.Size(); ++index)
-    {
-        if (scaledTime < keyFrames_[index].time_)
-            break;
-    }
-
-    if (index >= keyFrames_.Size() || !isInterpolatable_)
-        animatable->OnSetAttribute(attributeInfo, keyFrames_[index - 1].value_);
-    else
-    {
-        if (interpolationMethod_ == IM_LINEAR)
+    unsigned index = 1;
+    for (; index < keyFrames_.Size(); ++index)
+    {
+        if (scaledTime < keyFrames_[index].time_)
+            break;
+    }
+
+    if (index >= keyFrames_.Size() || !isInterpolatable_)
+        animatable->OnSetAttribute(attributeInfo, keyFrames_[index - 1].value_);
+    else
+    {
+        if (interpolationMethod_ == IM_LINEAR)
             animatable->OnSetAttribute(attributeInfo, LinearInterpolation(index - 1, index, scaledTime));
         else
             animatable->OnSetAttribute(attributeInfo, SplineInterpolation(index - 1, index, scaledTime));
@@ -416,4 +416,4 @@ Variant AttributeAnimation::SubstractAndMultiply(const Variant& value1, const Va
     return Variant::EMPTY;
 }
 
-}
+}

+ 2 - 2
Source/Engine/Scene/AttributeAnimation.h

@@ -135,6 +135,8 @@ protected:
     WeakPtr<ObjectAnimation> objectAnimation_;
     /// Interpolation method.
     InterpolationMethod interpolationMethod_;
+    /// Spline tension.
+    float splineTension_;
     /// Value type.
     VariantType valueType_;
     /// Is interpolatable.
@@ -145,8 +147,6 @@ protected:
     float endTime_;
     /// Key frames.
     Vector<AttributeKeyFrame> keyFrames_;
-    /// Spline tension.
-    float splineTension_;
     /// Spline tangents.
     Vector<Variant> splineTangents_;
     /// Spline tangents dirty.