PCG-FPS  v2 m0.22.4
Simple First Person Shooter with Procedurally Generated Level
BoundingBox.h
Go to the documentation of this file.
1 #ifndef SKR_FPS2_COLLISION_BOUNDINGBOX_H
2 #define SKR_FPS2_COLLISION_BOUNDINGBOX_H
3 
4 #include "..\pch.h"
5 
6 #include "..\Renderer\OpenGL\Shader.h"
7 
8 namespace skr
9 {
10 namespace fps2
11 {
12 namespace Collision
13 {
17  {
18  public:
19  glm::vec3 _position;
20  glm::vec3 _size;
21 
22  uint32_t _centerVao;
23  uint32_t _centerVbo;
24  uint32_t _linesVao;
25  uint32_t _linesVbo;
26 
27  public:
30  BoundingBox();
31 
36  BoundingBox(glm::vec3 pos, glm::vec3 size);
37 
40  void UpdatePosition(glm::vec3 pos);
41 
48  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;
49 
50  private:
52  void CreateGeometry();
53  };
54 
55 }
56 }
57 }
58 
59 #endif
60 
skr::fps2::Collision::BoundingBox::_centerVao
uint32_t _centerVao
vertex array object of center point
Definition: BoundingBox.h:22
skr::fps2::Collision::BoundingBox::_centerVbo
uint32_t _centerVbo
vertex buffer object of center point
Definition: BoundingBox.h:23
skr::fps2::Collision::BoundingBox::CreateGeometry
void CreateGeometry()
greates geometry buffer and initializes them for drawing
Definition: BoundingBox.cpp:49
skr::fps2::Collision::BoundingBox::_linesVbo
uint32_t _linesVbo
vertex buffer object for lines visualizating size
Definition: BoundingBox.h:25
skr::fps2::Collision::BoundingBox::UpdatePosition
void UpdatePosition(glm::vec3 pos)
update position
Definition: BoundingBox.cpp:26
skr::fps2::Renderer::OpenGL::Shader
handles shader loading, compiling and linking. Also provides access to set uniform ids and usage.
Definition: Shader.h:31
skr::fps2::Collision::BoundingBox::_position
glm::vec3 _position
position
Definition: BoundingBox.h:19
skr::fps2::Collision::BoundingBox::Draw
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.
Definition: BoundingBox.cpp:31
skr::fps2::Collision::BoundingBox::_size
glm::vec3 _size
size
Definition: BoundingBox.h:20
skr::fps2::Collision::BoundingBox::_linesVao
uint32_t _linesVao
vertex array object for lines visualizing size
Definition: BoundingBox.h:24
skr
Definition: AssetPath.h:10
skr::fps2::Collision::BoundingBox
specifies bounding box of a geometry
Definition: BoundingBox.h:17
skr::fps2::Collision::BoundingBox::BoundingBox
BoundingBox()
default constructor sets all parameters to 0
Definition: BoundingBox.cpp:13