AireEngine
A 3D Open-World Game Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Aire::BoundingBox Class Reference

#include <BoundingBox.h>

Public Member Functions

 BoundingBox (int aID, glm::vec2 aPosition, glm::vec2 size)
 
void addToBox (int id)
 
void removeFromBox (int id)
 
bool boxContains (int id)
 

Public Attributes

int id
 Id of the bounding box.
 
glm::vec2 position
 World position of the bounding box.
 
glm::vec2 size
 Size of the bounding box.
 
std::vector< intrbIDs
 List of rigidbody ids in the bounding box.
 
bool isTopEdge = false
 
bool isBotEdge = false
 

Detailed Description

A class for defining a bounding box that can store a number of rigidbodies

Constructor & Destructor Documentation

◆ BoundingBox()

BoundingBox::BoundingBox ( int aID,
glm::vec2 aPosition,
glm::vec2 size )

Constructor function that defines a bounding box by a given position and 2 dimensional size

Parameters
aIDID to initialise the bounding box with
aPositionPosition of the bounding box from bottom left corner
sizeof the bounding box in x and y

Member Function Documentation

◆ addToBox()

void BoundingBox::addToBox ( int id)

Function to add an id to a box

Parameters
idID to add to the box

◆ boxContains()

bool BoundingBox::boxContains ( int id)

Function to see if box contains an ID

Parameters
idID to check for
Returns
True if present

◆ removeFromBox()

void BoundingBox::removeFromBox ( int id)

Function to remove an id from a box

Parameters
idID to remove from the box

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