GlistEngine
Loading...
Searching...
No Matches
gBoundingBox Class Reference

#include <gBoundingBox.h>

Inheritance diagram for gBoundingBox:
Collaboration diagram for gBoundingBox:

Public Member Functions

 gBoundingBox ()
 
 gBoundingBox (float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
 
 gBoundingBox (float minX, float minY, float minZ, float maxX, float maxY, float maxZ, glm::mat4 transformationMatrix)
 
 gBoundingBox (const gBoundingBox &b)
 
virtual ~gBoundingBox ()
 
void set (float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
 
void set (const gBoundingBox &b)
 
bool intersects (float minX, float minY, float minZ, float maxX, float maxY, float maxZ) const
 
bool intersects (const gBoundingBox &b) const
 
bool contains (float minX, float minY, float minZ, float maxX, float maxY, float maxZ) const
 
bool contains (const gBoundingBox &b) const
 
bool contains (float x, float y, float z) const
 
gBoundingBox merge (const gBoundingBox &other) const
 
gBoundingBox offset (const glm::vec3 &offset) const
 
bool intersects (gRay &ray) const
 
float distance (gRay &ray) const
 
bool intersects (gRay *ray) const
 
float distance (gRay *ray) const
 
const glm::vec3 & getMin () const
 
const glm::vec3 & getMax () const
 
float minX () const
 
float minY () const
 
float minZ () const
 
float maxX () const
 
float maxY () const
 
float maxZ () const
 
float getWidth () const
 
float getHeight () const
 
float getDepth () const
 
const glm::vec3 & getOrigin () const
 
void setTransformationMatrix (const glm::mat4 &matrix)
 
bool intersectsOBB (gRay *ray) const
 
float distanceOBB (gRay *ray) const
 
void draw () const
 
void drawOBB () const
 
- Public Member Functions inherited from gRenderObject
 gRenderObject ()
 
int getScreenWidth ()
 
int getScreenHeight ()
 
void pushMatrix ()
 
void popMatrix ()
 
- Public Member Functions inherited from gObject
 gObject ()
 
void logi (std::string message)
 
void logd (std::string message)
 
void logw (std::string message)
 
void loge (std::string message)
 
void logi (std::string tag, std::string message)
 
void logd (std::string tag, std::string message)
 
void logw (std::string tag, std::string message)
 
void loge (std::string tag, std::string message)
 

Static Public Member Functions

static bool intersects (float minX1, float minY1, float minZ1, float maxX1, float maxY1, float maxZ1, float minX2, float minY2, float minZ2, float maxX2, float maxY2, float maxZ2)
 
static bool intersects (const gBoundingBox &b1, const gBoundingBox &b2)
 
static bool contains (float minX1, float minY1, float minZ1, float maxX1, float maxY1, float maxZ1, float minX2, float minY2, float minZ2, float maxX2, float maxY2, float maxZ2)
 
static bool contains (const gBoundingBox &b1, const gBoundingBox &b2)
 
- Static Public Member Functions inherited from gRenderObject
static void setScreenSize (int screenWidth, int screenHeight)
 
static void setUnitScreenSize (int unitWidth, int unitHeight)
 
static void setScreenScaling (int screenScaling)
 
static void enableShadowMapping ()
 
static void disableShadowMapping ()
 
static bool isShadowMappingEnabled ()
 
static gRenderergetRenderer ()
 
static void destroyRenderer ()
 
static void createRenderer ()
 
- Static Public Member Functions inherited from gObject
static std::string gGetAppDir ()
 
static std::string gGetAssetsDir ()
 
static void gSetAssetsDir (std::string assetsDir)
 
static std::string gGetFilesDir ()
 
static std::string gGetImagesDir ()
 
static std::string gGetFontsDir ()
 
static std::string gGetModelsDir ()
 
static std::string gGetTexturesDir ()
 
static std::string gGetShadersDir ()
 
static std::string gGetSoundsDir ()
 
static std::string gGetDatabasesDir ()
 
static std::string gGetVideosDir ()
 
static void setCurrentResolution (int scalingNo, int currentResolutionNo)
 

Additional Inherited Members

- Static Public Attributes inherited from gObject
static const int LOGLEVEL_SILENT
 
static const int LOGLEVEL_DEBUG
 
static const int LOGLEVEL_INFO
 
static const int LOGLEVEL_WARNING
 
static const int LOGLEVEL_ERROR
 
- Static Protected Attributes inherited from gRenderObject
static bool isshadowmappingenabled
 
- Static Protected Attributes inherited from gObject
static int renderpassnum
 
static int renderpassno
 
static int releasescaling
 
static int releaseresolution
 

Detailed Description

gBoundingBox represents an axis aligned box (AABB) defined by 6 parameters for the minimum and maximum values of its corners. Abounding box has 3 size parameters: width, height and depth; that are calculated automatically after setting min and max values. One can use gBoundingBox in calculating broad distance intersection(rejection test) of the objects.

Constructor & Destructor Documentation

◆ gBoundingBox() [1/4]

gBoundingBox::gBoundingBox ( )

◆ gBoundingBox() [2/4]

gBoundingBox::gBoundingBox ( float  minX,
float  minY,
float  minZ,
float  maxX,
float  maxY,
float  maxZ 
)

◆ gBoundingBox() [3/4]

gBoundingBox::gBoundingBox ( float  minX,
float  minY,
float  minZ,
float  maxX,
float  maxY,
float  maxZ,
glm::mat4  transformationMatrix 
)

◆ gBoundingBox() [4/4]

gBoundingBox::gBoundingBox ( const gBoundingBox b)

◆ ~gBoundingBox()

virtual gBoundingBox::~gBoundingBox ( )
virtual

Member Function Documentation

◆ contains() [1/5]

bool gBoundingBox::contains ( const gBoundingBox b) const

◆ contains() [2/5]

static bool gBoundingBox::contains ( const gBoundingBox b1,
const gBoundingBox b2 
)
static

◆ contains() [3/5]

bool gBoundingBox::contains ( float  minX,
float  minY,
float  minZ,
float  maxX,
float  maxY,
float  maxZ 
) const

◆ contains() [4/5]

static bool gBoundingBox::contains ( float  minX1,
float  minY1,
float  minZ1,
float  maxX1,
float  maxY1,
float  maxZ1,
float  minX2,
float  minY2,
float  minZ2,
float  maxX2,
float  maxY2,
float  maxZ2 
)
static

◆ contains() [5/5]

bool gBoundingBox::contains ( float  x,
float  y,
float  z 
) const

◆ distance() [1/2]

float gBoundingBox::distance ( gRay ray) const

◆ distance() [2/2]

float gBoundingBox::distance ( gRay ray) const

◆ distanceOBB()

float gBoundingBox::distanceOBB ( gRay ray) const

◆ draw()

void gBoundingBox::draw ( ) const

◆ drawOBB()

void gBoundingBox::drawOBB ( ) const

◆ getDepth()

float gBoundingBox::getDepth ( ) const

◆ getHeight()

float gBoundingBox::getHeight ( ) const

◆ getMax()

const glm::vec3 & gBoundingBox::getMax ( ) const

◆ getMin()

const glm::vec3 & gBoundingBox::getMin ( ) const

◆ getOrigin()

const glm::vec3 & gBoundingBox::getOrigin ( ) const

◆ getWidth()

float gBoundingBox::getWidth ( ) const

◆ intersects() [1/6]

bool gBoundingBox::intersects ( const gBoundingBox b) const

◆ intersects() [2/6]

static bool gBoundingBox::intersects ( const gBoundingBox b1,
const gBoundingBox b2 
)
static

◆ intersects() [3/6]

bool gBoundingBox::intersects ( float  minX,
float  minY,
float  minZ,
float  maxX,
float  maxY,
float  maxZ 
) const

◆ intersects() [4/6]

static bool gBoundingBox::intersects ( float  minX1,
float  minY1,
float  minZ1,
float  maxX1,
float  maxY1,
float  maxZ1,
float  minX2,
float  minY2,
float  minZ2,
float  maxX2,
float  maxY2,
float  maxZ2 
)
static

◆ intersects() [5/6]

bool gBoundingBox::intersects ( gRay ray) const

◆ intersects() [6/6]

bool gBoundingBox::intersects ( gRay ray) const

◆ intersectsOBB()

bool gBoundingBox::intersectsOBB ( gRay ray) const

◆ maxX()

float gBoundingBox::maxX ( ) const

◆ maxY()

float gBoundingBox::maxY ( ) const

◆ maxZ()

float gBoundingBox::maxZ ( ) const

◆ merge()

gBoundingBox gBoundingBox::merge ( const gBoundingBox other) const

◆ minX()

float gBoundingBox::minX ( ) const

◆ minY()

float gBoundingBox::minY ( ) const

◆ minZ()

float gBoundingBox::minZ ( ) const

◆ offset()

gBoundingBox gBoundingBox::offset ( const glm::vec3 &  offset) const

◆ set() [1/2]

void gBoundingBox::set ( const gBoundingBox b)

◆ set() [2/2]

void gBoundingBox::set ( float  minX,
float  minY,
float  minZ,
float  maxX,
float  maxY,
float  maxZ 
)

◆ setTransformationMatrix()

void gBoundingBox::setTransformationMatrix ( const glm::mat4 &  matrix)

The documentation for this class was generated from the following file: