浏览代码

REVIEWED: `GetModelBoundingBox()` #3485

Ray 1 年之前
父节点
当前提交
7677e4b928
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/rmodels.c

+ 6 - 0
src/rmodels.c

@@ -1170,6 +1170,12 @@ BoundingBox GetModelBoundingBox(Model model)
             bounds.max = temp;
         }
     }
+    
+    // Apply model.transform to bounding box
+    // WARNING: Current BoundingBox structure design does not support rotation transformations,
+    // in those cases is up to the user to calculate the proper box bounds (8 vertices transformed)
+    bounds.min = Vector3Transform(bounds.min, model.transform);
+    bounds.max = Vector3Transform(bounds.max, model.transform);
 
     return bounds;
 }