summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRay <[email protected]>2023-10-30 20:41:33 +0100
committerRay <[email protected]>2023-10-30 20:41:33 +0100
commit7677e4b92842a317f883c91ce9ad0cd6963d9341 (patch)
treebceed2d36c0cc6e7a10b945516d85371db9bcd2e /src
parentb8fce54c0fc443c76dcac7c7e1adba9fd7e2a4df (diff)
downloadraylib-7677e4b92842a317f883c91ce9ad0cd6963d9341.tar.gz
raylib-7677e4b92842a317f883c91ce9ad0cd6963d9341.zip
REVIEWED: `GetModelBoundingBox()` #3485
Diffstat (limited to 'src')
-rw-r--r--src/rmodels.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rmodels.c b/src/rmodels.c
index f9018eaa..0a997f85 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;
}