1#ifndef RAYLIB_CPP_INCLUDE_BOUNDINGBOX_HPP_
2#define RAYLIB_CPP_INCLUDE_BOUNDINGBOX_HPP_
5#include "./raylib-cpp-utils.hpp"
6#include "./RayCollision.hpp"
17 BoundingBox(const ::BoundingBox& box) : ::BoundingBox{box.min, box.max} {
25 set(::GetMeshBoundingBox(mesh));
28 BoundingBox(::Vector3 minMax = ::Vector3{0.0f, 0.0f, 0.0f}) : ::BoundingBox{minMax, minMax} {}
29 BoundingBox(::Vector3 min, ::Vector3 max) : ::BoundingBox{min, max} {}
31 GETTERSETTER(::Vector3, Min, min)
42 void Draw(::Color color = {255, 255, 255, 255})
const {
43 ::DrawBoundingBox(*
this, color);
50 return CheckCollisionBoxes(*
this, box2);
57 return CheckCollisionBoxSphere(*
this, center, radius);
64 return GetRayCollisionBox(ray, *
this).hit;
71 return GetRayCollisionBox(ray, *
this);
75 void set(const ::BoundingBox& box) {
79 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.