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_MESH_H
2 #define SKR_FPS2_RENDERER_OPENGL_MESH_H
10 #include "pcg\Definitions.h"
56 Mesh(std::vector<Vertex> vertices, std::vector<uint32_t> indices, std::vector<Texture> textures, glm::vec3 drawColor = glm::vec3(1.0f));
61 Mesh(skr::pcg::Face face);
71 void Draw(
Shader shader, uint32_t depthMap = 0,
bool useMaterialTextures =
false)
const;
glm::vec3 _drawColor
Definition: Mesh.h:47
uint32_t _vbo
vertex buffer object
Definition: Mesh.h:40
glm::vec3 Bitangent
bitangent
Definition: Mesh.h:28
std::array< glm::vec3, 2 > CalculateTangentAndBitangentForTriangle(glm::vec3 pos1, glm::vec3 pos2, glm::vec3 pos3, glm::vec2 tex1, glm::vec2 tex2, glm::vec2 tex3, glm::vec3 normal)
calculates tangent and bitangent of given positions and texture coordinates used to prepare mesh for ...
Definition: Mesh.cpp:336
void DrawGeometry() const
draws only geometry without texture or color used to render depthmap for shadow mapping
Definition: Mesh.cpp:153
holds geometry of a single mesh
Definition: Mesh.h:34
vertex information
Definition: Mesh.h:23
void SetDrawColor(glm::vec3 color)
sets _drawColor
Definition: Mesh.cpp:168
glm::vec3 Tangent
tangent
Definition: Mesh.h:27
void DrawPrepareTextures(Shader shader, uint32_t depthMap=0, bool useMaterialTextures=false) const
prepares Textures before drawing them
Definition: Mesh.cpp:204
Mesh(std::vector< Vertex > vertices, std::vector< uint32_t > indices, std::vector< Texture > textures, glm::vec3 drawColor=glm::vec3(1.0f))
draw color. If texture are used, this is ignored
Definition: Mesh.cpp:23
handles shader loading, compiling and linking. Also provides access to set uniform ids and usage.
Definition: Shader.h:31
std::vector< Texture > _textures
element buffer object. If raw vertices are used, this field is not used
Definition: Mesh.h:44
void SetupMeshIndexed()
setup meshes to draw using index buffer
Definition: Mesh.cpp:282
std::vector< Vertex > _vertices
list of vertices
Definition: Mesh.h:36
std::vector< uint32_t > _indices
list of indices. If raw vertices are used, this list is empty
Definition: Mesh.h:37
void Draw(Shader shader, uint32_t depthMap=0, bool useMaterialTextures=false) const
Draw mesh with diven shader "regular" draw function, that should usually be used.
Definition: Mesh.cpp:141
glm::vec3 Position
position
Definition: Mesh.h:24
void SetupMeshRawTriangles()
setup raw meshes to draw
Definition: Mesh.cpp:311
~Mesh()
destructor
Definition: Mesh.cpp:132
glm::vec3 Normal
normal
Definition: Mesh.h:25
Definition: AssetPath.h:10
glm::vec2 TexCoords
texture coordinates
Definition: Mesh.h:26
void GetExtremePositions(glm::vec3 &max, glm::vec3 &min)
calcualtes the extrem positions of the mesh in every direction output parameters should result in opp...
Definition: Mesh.cpp:173
bool _useDrawColor
flag inidicating if color is used to draw mesh instead of textures
Definition: Mesh.h:46
uint32_t _vao
vertex array object
Definition: Mesh.h:39
uint32_t _ebo
Definition: Mesh.h:41