Quellcode durchsuchen

Enabled nlerp interpolation in the Test example.
Fixed too high animation update rate in orthographic mode for invisible objects.

Lasse Öörni vor 15 Jahren
Ursprung
Commit
8cdbcab464

+ 1 - 1
Engine/Renderer/AnimatedModel.cpp

@@ -533,7 +533,7 @@ void AnimatedModel::updateNode(const FrameInfo& frame)
         // Multiply the distance by a constant so that invisible nodes don't update that often
         static const Vector3 dotScale(1 / 3.0f, 1 / 3.0f, 1 / 3.0f);
         float scale = getWorldBoundingBox().getSize().dotProduct(dotScale);
-        mAnimationLodDistance = frame.mCamera->getLodDistance(ANIMATION_LOD_INVISIBLE_FACTOR * distance, scale, mLodBias);
+        mAnimationLodDistance = frame.mCamera->getLodDistance(distance, scale, mLodBias) * ANIMATION_LOD_INVISIBLE_FACTOR;
     }
     
     updateAnimation(frame);

+ 1 - 1
Engine/Renderer/RendererDefs.h

@@ -215,7 +215,7 @@ static const unsigned MASK_DEFAULT = 0xffffffff;
 static const unsigned NO_ELEMENT = 0xffffffff;
 
 static const float ANIMATION_LOD_BASESCALE = 2000.0f;
-static const float ANIMATION_LOD_INVISIBLE_FACTOR = 2.0f;
+static const float ANIMATION_LOD_INVISIBLE_FACTOR = 3.0f;
 
 static const unsigned MAX_VERTEX_LIGHTS = 4;
 

+ 1 - 0
Examples/Test/Application.cpp

@@ -399,6 +399,7 @@ void Application::createScene()
         AnimationState* anim = object->addAnimationState(mCache->getResource<Animation>("Models/Jack_Walk.ani"));
         if (anim)
         {
+            anim->setUseNlerp(true);
             anim->setLooped(true);
             anim->setWeight(1.0f);
         }