1 #ifndef RAYLIB_CPP_INCLUDE_BOUNDINGBOX_HPP_
2 #define RAYLIB_CPP_INCLUDE_BOUNDINGBOX_HPP_
4 #include "./raylib.hpp"
5 #include "./raylib-cpp-utils.hpp"
24 set(::GetMeshBoundingBox(mesh));
28 BoundingBox(::Vector3 min, ::Vector3 max) : ::BoundingBox{min, max} {}
41 inline void Draw(::
Color color = {255, 255, 255, 255})
const {
42 ::DrawBoundingBox(*
this, color);
49 return CheckCollisionBoxes(*
this, box2);
56 return CheckCollisionBoxSphere(*
this, center, radius);
63 return GetRayCollisionBox(ray, *
this).hit;
70 return GetRayCollisionBox(ray, *
this);
74 void set(const ::BoundingBox& box) {
78 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.
void Draw(::Color color={255, 255, 255, 255}) const
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.