#include <box.h>
Public Member Functions | |
Box ()=default | |
Box (float width, float height, float depth) | |
Box (float width, float height, float depth, const glm::vec3 &position) | |
Box (const glm::vec2 &xCoordinates, const glm::vec2 &yCoordinates, const glm::vec2 &zCoordinates) | |
Box (const glm::vec3 &min, const glm::vec3 &max) | |
float | getWidth () const |
float | getHeight () const |
float | getDepth () const |
bool | inside (const glm::vec3 &point) const |
const glm::vec3 & | getMin () const |
const glm::vec3 & | getMax () const |
glm::vec3 | getDimensions () const |
glm::vec3 | getCenter () const |
Public Attributes | |
glm::vec3 | mMinCoordinates = { -0.5f, -0.5f, -0.5f } |
Box min coordinates. More... | |
glm::vec3 | mMaxCoordinates = { 0.5f, 0.5f, 0.5f } |
Box max coordinates. More... | |
Simple 3D box. when using the default constructor the box dimensions are 1 unit in every axis normalized around center (0,0,0).
|
default |
Box | ( | float | width, |
float | height, | ||
float | depth | ||
) |
Creates a box around the origin using provided dimensions
width | the width of the box |
height | the height of the box |
depth | the depth of the box |
Box | ( | float | width, |
float | height, | ||
float | depth, | ||
const glm::vec3 & | position | ||
) |
Creates a box at the given position using the provided dimensions
width | the width of the box |
height | the height of the box |
depth | the depth of the box |
position | of the box |
Box | ( | const glm::vec2 & | xCoordinates, |
const glm::vec2 & | yCoordinates, | ||
const glm::vec2 & | zCoordinates | ||
) |
Creates a box using the specified dimensions in every axis
xCoordinates | the min / max horizontal coordinates of the box |
yCoordinates | the min / max vertical coordinates of the box |
zCoordinates | the min / max depth coordinates of the box |
Box | ( | const glm::vec3 & | min, |
const glm::vec3 & | max | ||
) |
Creates a box using the 2 specified min / max coordinates
min | the min point coordinates |
max | the max point coordinates |
glm::vec3 getCenter | ( | ) | const |
float getDepth | ( | ) | const |
glm::vec3 getDimensions | ( | ) | const |
float getHeight | ( | ) | const |
const glm::vec3& getMax | ( | ) | const |
const glm::vec3& getMin | ( | ) | const |
float getWidth | ( | ) | const |
bool inside | ( | const glm::vec3 & | point | ) | const |
glm::vec3 mMaxCoordinates = { 0.5f, 0.5f, 0.5f } |
Box max coordinates.
glm::vec3 mMinCoordinates = { -0.5f, -0.5f, -0.5f } |
Box min coordinates.