1 #ifndef RAYLIB_CPP_INCLUDE_BOUNDINGBOX_HPP_
2 #define RAYLIB_CPP_INCLUDE_BOUNDINGBOX_HPP_
4 #include "./raylib.hpp"
5 #include "./raylib-cpp-utils.hpp"
31 set(::GetMeshBoundingBox(mesh));
35 BoundingBox(::Vector3 min, ::Vector3 max) : ::BoundingBox{min, max} {}
49 DrawBoundingBox(*
this, color);
57 return CheckCollisionBoxes(*
this, box2);
64 return CheckCollisionBoxSphere(*
this, center, radius);
71 return GetRayCollisionBox(ray, *
this).hit;
78 return GetRayCollisionBox(ray, *
this);
82 void set(const ::BoundingBox& box) {
86 void set(const ::Vector3& _min, const ::Vector3& _max) {
bool CheckCollision(::Vector3 center, float radius) const
Detect collision between box and sphere.
RayCollision GetCollision(const ::Ray &ray) const
Get collision information between ray and bounding box.
BoundingBox(const ::Mesh &mesh)
Compute mesh bounding box limits.
BoundingBox & Draw(::Color color={255, 255, 255, 255})
Draw a bounding box with wires.
bool CheckCollision(const ::BoundingBox &box2) const
Detect collision between two boxes.
bool CheckCollision(const ::Ray &ray) const
Detect collision between ray and bounding box.
All raylib-cpp classes and functions appear in the raylib namespace.