Browse Source

For a minor performance improvement, do not mark AnimatedModel skinning dirty if it does not contain bones.

Lasse Öörni 11 years ago
parent
commit
e0fa4d2560
1 changed files with 5 additions and 2 deletions
  1. 5 2
      Source/Engine/Graphics/AnimatedModel.cpp

+ 5 - 2
Source/Engine/Graphics/AnimatedModel.cpp

@@ -873,8 +873,11 @@ void AnimatedModel::OnMarkedDirty(Node* node)
     Drawable::OnMarkedDirty(node);
 
     // If the scene node or any of the bone nodes move, mark skinning and the bone bounding box dirty
-    skinningDirty_ = true;
-    boneBoundingBoxDirty_ = true;
+    if (skeleton_.GetNumBones())
+    {
+        skinningDirty_ = true;
+        boneBoundingBoxDirty_ = true;
+    }
 }
 
 void AnimatedModel::OnWorldBoundingBoxUpdate()