Sfoglia il codice sorgente

If AnimatedModel has no bones (has intentionally loaded a non-skinned model), use StaticModel raycast for more accuracy.

Lasse Öörni 11 anni fa
parent
commit
6d3d336057
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 3 3
      Source/Engine/Graphics/AnimatedModel.cpp

+ 3 - 3
Source/Engine/Graphics/AnimatedModel.cpp

@@ -134,11 +134,11 @@ void AnimatedModel::ApplyAttributes()
 
 void AnimatedModel::ProcessRayQuery(const RayOctreeQuery& query, PODVector<RayQueryResult>& results)
 {
-    // If no bones or no bone-level testing, use the Drawable test
+    // If no bones or no bone-level testing, use the StaticModel test
     RayQueryLevel level = query.level_;
-    if (level < RAY_AABB || !skeleton_.GetRootBone() || !skeleton_.GetRootBone()->node_)
+    if (level < RAY_AABB || !skeleton_.GetNumBones())
     {
-        Drawable::ProcessRayQuery(query, results);
+        StaticModel::ProcessRayQuery(query, results);
         return;
     }