Browse Source

Code cleanup.
Removed debug prints.

Lasse Öörni 15 years ago
parent
commit
61b2af9c14
2 changed files with 3 additions and 10 deletions
  1. 1 4
      Engine/Renderer/AnimatedModel.cpp
  2. 2 6
      Engine/Renderer/AnimationState.cpp

+ 1 - 4
Engine/Renderer/AnimatedModel.cpp

@@ -534,11 +534,8 @@ void AnimatedModel::updateNode(const FrameInfo& frame)
         static const Vector3 dotScale(1 / 3.0f, 1 / 3.0f, 1 / 3.0f);
         static const Vector3 dotScale(1 / 3.0f, 1 / 3.0f, 1 / 3.0f);
         float scale = getWorldBoundingBox().getSize().dotProduct(dotScale);
         float scale = getWorldBoundingBox().getSize().dotProduct(dotScale);
         mAnimationLodDistance = frame.mCamera->getLodDistance(distance, scale, mLodBias) * ANIMATION_LOD_INVISIBLE_FACTOR;
         mAnimationLodDistance = frame.mCamera->getLodDistance(distance, scale, mLodBias) * ANIMATION_LOD_INVISIBLE_FACTOR;
-        LOGINFO("Invisible update");
     }
     }
-    else
-        LOGINFO("Visible update");
-        
+    
     updateAnimation(frame);
     updateAnimation(frame);
 }
 }
 
 

+ 2 - 6
Engine/Renderer/AnimationState.cpp

@@ -325,9 +325,7 @@ void AnimationState::apply()
                 float timeInterval = nextKeyFrame->mTime - keyFrame->mTime;
                 float timeInterval = nextKeyFrame->mTime - keyFrame->mTime;
                 if (timeInterval < 0.0f)
                 if (timeInterval < 0.0f)
                     timeInterval += mAnimation->getLength();
                     timeInterval += mAnimation->getLength();
-                float t = 1.0f;
-                if (timeInterval > 0.0f)
-                    t = (mTime - keyFrame->mTime) / timeInterval;
+                float t = timeInterval > 0.0f ? (mTime - keyFrame->mTime) / timeInterval : 1.0f;
                 
                 
                 // Interpolation, full weight
                 // Interpolation, full weight
                 if (channelMask & CHANNEL_POSITION)
                 if (channelMask & CHANNEL_POSITION)
@@ -395,9 +393,7 @@ void AnimationState::apply()
                 float timeInterval = nextKeyFrame->mTime - keyFrame->mTime;
                 float timeInterval = nextKeyFrame->mTime - keyFrame->mTime;
                 if (timeInterval < 0.0f)
                 if (timeInterval < 0.0f)
                     timeInterval += mAnimation->getLength();
                     timeInterval += mAnimation->getLength();
-                float t = 1.0f;
-                if (timeInterval > 0.0f)
-                    t = (mTime - keyFrame->mTime) / timeInterval;
+                float t = timeInterval > 0.0f ? (mTime - keyFrame->mTime) / timeInterval : 1.0f;
                 
                 
                 // Interpolation, blend between old transform & animation
                 // Interpolation, blend between old transform & animation
                 if (channelMask & CHANNEL_POSITION)
                 if (channelMask & CHANNEL_POSITION)