Browse Source

Add check for editor context before using boundingbox

weinand 9 years ago
parent
commit
5d748aa8b4
1 changed files with 5 additions and 1 deletions
  1. 5 1
      Source/Atomic/Graphics/AnimatedModel.cpp

+ 5 - 1
Source/Atomic/Graphics/AnimatedModel.cpp

@@ -1043,8 +1043,12 @@ void AnimatedModel::OnWorldBoundingBoxUpdate()
 {
     if (isMaster_)
     {
+        // ATOMIC BEGIN
+        // https://github.com/AtomicGameEngine/AtomicGameEngine/issues/1166
         // Note: do not update bone bounding box here, instead do it in either of the threaded updates
-        worldBoundingBox_ = boundingBox_.Transformed(node_->GetWorldTransform());
+        if (context_->GetEditorContext())
+            worldBoundingBox_ = boundingBox_.Transformed(node_->GetWorldTransform());
+        // ATOMIC END
     }
     else
     {