From 7677e4b92842a317f883c91ce9ad0cd6963d9341 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 30 Oct 2023 20:41:33 +0100 Subject: [PATCH] REVIEWED: `GetModelBoundingBox()` #3485 --- src/rmodels.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rmodels.c b/src/rmodels.c index f9018eaaf..0a997f858 100644 --- a/src/rmodels.c +++ b/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; }