Added default constructor for BoundingBox

- Also updated it to have set() with vector3.
This commit is contained in:
TokyoSU
2022-07-05 17:45:04 +02:00
parent 56e58d72a5
commit 2209b5c5e0

View File

@@ -9,7 +9,17 @@ namespace raylib {
* Bounding box type
*/
class BoundingBox : public ::BoundingBox {
public:
public:
/*
* Set the bounding box to default: min (0, 0, 0) and max (0, 0, 0).
*/
BoundingBox() {
set(RVector3(0, 0, 0), RVector3(0, 0, 0));
}
/*
* Copy a bounding box from another bounding box.
*/
BoundingBox(const ::BoundingBox& box) {
set(box);
}
@@ -68,11 +78,15 @@ class BoundingBox : public ::BoundingBox {
return GetRayCollisionBox(ray, *this);
}
private:
private:
void set(const ::BoundingBox& box) {
min = box.min;
max = box.max;
}
void set(const Vector3& _min, const Vector3& _max) {
min = _min;
max = _max;
}
};
} // namespace raylib
using RBoundingBox = raylib::BoundingBox;