Program Listing for File AABB.hpp

Return to documentation for file (Src/GraphicsEngineOpenGL/scene/AABB.hpp)

#pragma once

// clang-format off
// you must include glad before glfw!
// therefore disable clang-format for this section
#include <glad/glad.h>
#include <GLFW/glfw3.h>
// clang-format on

#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <memory>
#include <vector>

#include "scene/Mesh.hpp"

class AABB
{
  public:
    AABB();

    std::vector<glm::vec3> get_corners(glm::mat4 model);

    void init(GLfloat minX, GLfloat maxX, GLfloat minY, GLfloat maxY, GLfloat minZ, GLfloat maxZ);

    glm::vec3 get_radius();

    void render();

    ~AABB();

  private:
    std::vector<Vertex> vertices;
    std::vector<unsigned int> indices;

    std::shared_ptr<Mesh> mesh;

    std::vector<glm::vec3> corners;

    GLfloat minX, maxX, minY, maxY, minZ, maxZ;
};