raylib-cpp
C++ object-oriented wrapper library for raylib.
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
raylib::BoundingBox Class Reference

Bounding box type. More...

#include <BoundingBox.hpp>

Public Member Functions

 BoundingBox (::Vector3 min, ::Vector3 max)
 
 BoundingBox (::Vector3 minMax=::Vector3{0.0f, 0.0f, 0.0f})
 
 BoundingBox (const ::BoundingBox &box)
 
 BoundingBox (const ::Mesh &mesh)
 Compute mesh bounding box limits. More...
 
bool CheckCollision (::Vector3 center, float radius) const
 Detect collision between box and sphere. More...
 
bool CheckCollision (const ::BoundingBox &box2) const
 Detect collision between two boxes. More...
 
bool CheckCollision (const ::Ray &ray) const
 Detect collision between ray and bounding box. More...
 
void Draw (::Color color={255, 255, 255, 255}) const
 Draw a bounding box with wires. More...
 
RayCollision GetCollision (const ::Ray &ray) const
 Get collision information between ray and bounding box. More...
 
::Vector3 GetMax () const
 Retrieves the max value for the object. More...
 
::Vector3 GetMin () const
 Retrieves the min value for the object. More...
 
BoundingBoxoperator= (const ::BoundingBox &box)
 
void SetMax (::Vector3 value)
 Sets the max value for the object. More...
 
void SetMin (::Vector3 value)
 Sets the min value for the object. More...
 

Protected Member Functions

void set (const ::BoundingBox &box)
 
void set (const ::Vector3 &_min, const ::Vector3 &_max)
 

Detailed Description

Bounding box type.

Definition at line 12 of file BoundingBox.hpp.

Constructor & Destructor Documentation

◆ BoundingBox() [1/4]

raylib::BoundingBox::BoundingBox ( const ::BoundingBox &  box)
inline

Definition at line 17 of file BoundingBox.hpp.

◆ BoundingBox() [2/4]

raylib::BoundingBox::BoundingBox ( const ::Mesh &  mesh)
inline

Compute mesh bounding box limits.

Definition at line 24 of file BoundingBox.hpp.

◆ BoundingBox() [3/4]

raylib::BoundingBox::BoundingBox ( ::Vector3  minMax = ::Vector3{0.0f, 0.0f, 0.0f})
inline

Definition at line 28 of file BoundingBox.hpp.

◆ BoundingBox() [4/4]

raylib::BoundingBox::BoundingBox ( ::Vector3  min,
::Vector3  max 
)
inline

Definition at line 29 of file BoundingBox.hpp.

Member Function Documentation

◆ CheckCollision() [1/3]

bool raylib::BoundingBox::CheckCollision ( ::Vector3  center,
float  radius 
) const
inline

Detect collision between box and sphere.

Definition at line 56 of file BoundingBox.hpp.

◆ CheckCollision() [2/3]

bool raylib::BoundingBox::CheckCollision ( const ::BoundingBox &  box2) const
inline

Detect collision between two boxes.

Definition at line 49 of file BoundingBox.hpp.

◆ CheckCollision() [3/3]

bool raylib::BoundingBox::CheckCollision ( const ::Ray &  ray) const
inline

Detect collision between ray and bounding box.

Definition at line 63 of file BoundingBox.hpp.

◆ Draw()

void raylib::BoundingBox::Draw ( ::Color  color = {255, 255, 255, 255}) const
inline

Draw a bounding box with wires.

Definition at line 42 of file BoundingBox.hpp.

◆ GetCollision()

RayCollision raylib::BoundingBox::GetCollision ( const ::Ray &  ray) const
inline

Get collision information between ray and bounding box.

Definition at line 70 of file BoundingBox.hpp.

◆ GetMax()

::Vector3 raylib::BoundingBox::GetMax ( ) const
inline

Retrieves the max value for the object.

Returns
The max value of the object.

Definition at line 32 of file BoundingBox.hpp.

◆ GetMin()

::Vector3 raylib::BoundingBox::GetMin ( ) const
inline

Retrieves the min value for the object.

Returns
The min value of the object.

Definition at line 31 of file BoundingBox.hpp.

◆ operator=()

BoundingBox & raylib::BoundingBox::operator= ( const ::BoundingBox &  box)
inline

Definition at line 34 of file BoundingBox.hpp.

◆ set() [1/2]

void raylib::BoundingBox::set ( const ::BoundingBox &  box)
inlineprotected

Definition at line 75 of file BoundingBox.hpp.

◆ set() [2/2]

void raylib::BoundingBox::set ( const ::Vector3 &  _min,
const ::Vector3 &  _max 
)
inlineprotected

Definition at line 79 of file BoundingBox.hpp.

◆ SetMax()

void raylib::BoundingBox::SetMax ( ::Vector3  value)
inline

Sets the max value for the object.

Parameters
valueThe value of which to set max to.

Definition at line 32 of file BoundingBox.hpp.

◆ SetMin()

void raylib::BoundingBox::SetMin ( ::Vector3  value)
inline

Sets the min value for the object.

Parameters
valueThe value of which to set min to.

Definition at line 31 of file BoundingBox.hpp.