mirror of
https://github.com/allankoechke/raylib-cpp.git
synced 2026-11-30 17:19:27 +00:00
Added default constructor for BoundingBox
- Also updated it to have set() with vector3.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user