PCG-FPS  v2 m0.22.4
Simple First Person Shooter with Procedurally Generated Level
Public Member Functions | Public Attributes | Private Member Functions | List of all members
skr::fps2::Collision::BoundingBox Class Reference

specifies bounding box of a geometry More...

#include <BoundingBox.h>

Public Member Functions

 BoundingBox ()
 default constructor sets all parameters to 0 More...
 
 BoundingBox (glm::vec3 pos, glm::vec3 size)
 constructor vertex array and buffer objects are initialized to 0, calls CreateGeometry to properly initialize them More...
 
void UpdatePosition (glm::vec3 pos)
 update position More...
 
void Draw (skr::fps2::Renderer::OpenGL::Shader shader, glm::mat4 view, glm::mat4 proj, glm::mat4 model, glm::vec3 color=glm::vec3(1.0f, 0.0f, 0.0f)) const
 Draws bounding box. More...
 

Public Attributes

glm::vec3 _position
 position More...
 
glm::vec3 _size
 size More...
 
uint32_t _centerVao
 vertex array object of center point More...
 
uint32_t _centerVbo
 vertex buffer object of center point More...
 
uint32_t _linesVao
 vertex array object for lines visualizing size More...
 
uint32_t _linesVbo
 vertex buffer object for lines visualizating size More...
 

Private Member Functions

void CreateGeometry ()
 greates geometry buffer and initializes them for drawing More...
 

Detailed Description

specifies bounding box of a geometry

Constructor & Destructor Documentation

◆ BoundingBox() [1/2]

skr::fps2::Collision::BoundingBox::BoundingBox ( )

default constructor sets all parameters to 0

◆ BoundingBox() [2/2]

skr::fps2::Collision::BoundingBox::BoundingBox ( glm::vec3  pos,
glm::vec3  size 
)

constructor vertex array and buffer objects are initialized to 0, calls CreateGeometry to properly initialize them

Parameters
posPosition
sizeSize

Member Function Documentation

◆ CreateGeometry()

void skr::fps2::Collision::BoundingBox::CreateGeometry ( )
private

greates geometry buffer and initializes them for drawing

◆ Draw()

void skr::fps2::Collision::BoundingBox::Draw ( skr::fps2::Renderer::OpenGL::Shader  shader,
glm::mat4  view,
glm::mat4  proj,
glm::mat4  model,
glm::vec3  color = glm::vec3(1.0f, 0.0f, 0.0f) 
) const

Draws bounding box.

Parameters
shaderShader to draw geometry with
viewView matrix
projProjection matrix
modelModel Matrix
colorColor bounding box is drawn in. Default: Red (1,0,0)

◆ UpdatePosition()

void skr::fps2::Collision::BoundingBox::UpdatePosition ( glm::vec3  pos)

update position

Parameters
posnew Position

Member Data Documentation

◆ _centerVao

uint32_t skr::fps2::Collision::BoundingBox::_centerVao

vertex array object of center point

◆ _centerVbo

uint32_t skr::fps2::Collision::BoundingBox::_centerVbo

vertex buffer object of center point

◆ _linesVao

uint32_t skr::fps2::Collision::BoundingBox::_linesVao

vertex array object for lines visualizing size

◆ _linesVbo

uint32_t skr::fps2::Collision::BoundingBox::_linesVbo

vertex buffer object for lines visualizating size

◆ _position

glm::vec3 skr::fps2::Collision::BoundingBox::_position

position

◆ _size

glm::vec3 skr::fps2::Collision::BoundingBox::_size

size


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