PCG-FPS
v2 m0.22.4
Simple First Person Shooter with Procedurally Generated Level
|
Go to the documentation of this file. 1 #ifndef SKR_FPS2_RENDERER_OPENGL_MODEL_H
2 #define SKR_FPS2_RENDERER_OPENGL_MODEL_H
11 #include "..\..\Collision\BoundingBox.h"
54 Model(std::string
const &path, glm::vec3 scale = glm::vec3(1.0f, 1.0f, 1.0f),
float yoffset = 0.0f,
ShaderType shadertype =
ShaderType::Main,
bool gamma =
false);
62 Model(std::vector<skr::pcg::Face> faces, glm::vec3 scale = glm::vec3(1.0f, 1.0f, 1.0f),
float yoffset = 0.0f,
ShaderType shadertype =
ShaderType::Main,
bool gamma =
false);
68 void Draw(
Shader shader, uint32_t depthMap = 0)
const;
81 void DrawBoundingBox(
Shader shader, glm::mat4 view, glm::mat4 proj, glm::mat4 model, glm::vec3 color = glm::vec3(0.0f, 0.0f, 1.0f))
const;
105 void ProcessNode(aiNode* node,
const aiScene* scene);
float _yOffset
offset from center of model if its defined at the bottom
Definition: Model.h:33
glm::vec3 _scale
scale to draw model in
Definition: Model.h:28
holds geometry of a single mesh
Definition: Mesh.h:34
bool _useMaterialTextures
flag indicating if material texture (normal mal, specular map) are used or material parameters
Definition: Model.h:31
std::vector< Mesh > _meshes
list of meshes
Definition: Model.h:27
std::string _directory
path to directory where model data (geometry, texturex) are located
Definition: Model.h:36
Collision::BoundingBox _boundingBox
collision bounding box of the model
Definition: Model.h:32
handles shader loading, compiling and linking. Also provides access to set uniform ids and usage.
Definition: Shader.h:31
bool _gammaCorrection
flag indicating if gamme corection is used
Definition: Model.h:37
holds information of a model
Definition: Model.h:24
ShaderType _shadertype
type of shader the model is drawn with
Definition: Model.h:30
void Draw(Shader shader, uint32_t depthMap=0) const
draw model main drawing function
Definition: Model.cpp:82
std::vector< Texture > _texturesLoaded
list of texture loaded for this model
Definition: Model.h:26
void DrawBoundingBox(Shader shader, glm::mat4 view, glm::mat4 proj, glm::mat4 model, glm::vec3 color=glm::vec3(0.0f, 0.0f, 1.0f)) const
draw bounding box of the model
Definition: Model.cpp:98
ShaderType
shader type identifies. Used as keys in map keeping shaders
Definition: Shader.h:18
Model()
default constructor default constructor is needed since OpenGL Renderer Object is a global object,...
Definition: Model.cpp:14
void LoadModel(std::string const &path)
load model from given path
Definition: Model.cpp:103
void SetYOffset(float yoffset)
set _yOffset to given value
Definition: Model.h:92
void CalculateBoundingBox()
calculates bounding box
Definition: Model.cpp:234
Definition: AssetPath.h:10
std::string _path
path to directory where model file is loaded from
Definition: Model.h:29
specifies bounding box of a geometry
Definition: BoundingBox.h:17
Mesh ProcessMesh(aiMesh *mesh, const aiScene *scene)
process mesh loaded by assimp
Definition: Model.cpp:135
void DrawGeometry() const
Definition: Model.cpp:90
void SetScale(glm::vec3 s)
set _scale to given value
Definition: Model.h:85
void ProcessNode(aiNode *node, const aiScene *scene)
process a node loaded by assimp
Definition: Model.cpp:121