8#ifndef ENGINE_GRAPHICS_GMESH_H_
9#define ENGINE_GRAPHICS_GMESH_H_
18#include <unordered_map>
33 gMesh(
const std::vector<gVertex>&
vertices,
const std::vector<gIndex>& indices,
const std::vector<gTexture*>& textures);
35 std::shared_ptr<std::vector<gIndex>> indices,
36 std::vector<gTexture*> textures);
43 void setVertices(std::shared_ptr<std::vector<gVertex>>
vertices, std::shared_ptr<std::vector<gIndex>> indices);
45 void setTextures(
const std::unordered_map<gTexture::TextureType, gTexture*>& textures);
113 std::unique_ptr<gVbo>
vbo;
118 std::shared_ptr<std::vector<gIndex>> indices;
121 std::unordered_map<gTexture::TextureType, gTexture*> textures;
122 std::unordered_map<gTexture::TextureType, std::string> texturenames;
123 std::unordered_map<gTexture::TextureType, int> texturecounters = {
139 bool needsboundingboxrecalculation;
Definition gBoundingBox.h:36
Definition gMaterial.h:18
static const int DRAWMODE_LINELOOP
Definition gMesh.h:29
std::shared_ptr< std::vector< gIndex > > getIndicesPtr()
void recalculateBoundingBox()
void setTexture(gTexture *texture)
static const int DRAWMODE_POINTS
Definition gMesh.h:29
float distanceTriangles(gRay *ray)
gMaterial * getMaterial()
void setName(const std::string &name)
void setTextures(const std::unordered_map< gTexture::TextureType, gTexture * > &textures)
static const int DRAWMODE_TRIANGLES
Definition gMesh.h:30
std::vector< gVertex > & getVertices()
void fillMissingVertexColors(const glm::vec3 &defColor=glm::vec3(1.0f))
bool isprojection2d
Definition gMesh.h:115
int getVerticesNum() const
int getIndicesNum() const
const std::string & getName() const
gTexture * getTexture(gTexture::TextureType type)
static const int DRAWMODE_LINESTRIP
Definition gMesh.h:29
void setVertices(const std::vector< gVertex > &vertices)
void setDrawMode(int drawMode)
void setTextures(const std::vector< gTexture * > &textures)
gMesh(std::shared_ptr< std::vector< gVertex > > vertices, std::shared_ptr< std::vector< gIndex > > indices, std::vector< gTexture * > textures)
void setMaterial(gMaterial *material)
void setVertices(const std::vector< gVertex > &vertices, const std::vector< gIndex > &indices)
static const int DRAWMODE_TRIANGLESTRIP
Definition gMesh.h:30
std::vector< gIndex > & getIndices()
bool intersectsTriangles(gRay *ray)
void setVertices(std::shared_ptr< std::vector< gVertex > > vertices, std::shared_ptr< std::vector< gIndex > > indices)
void setVertices(std::shared_ptr< std::vector< gVertex > > vertices)
void processTransformationMatrix() override
std::unique_ptr< gVbo > vbo
Definition gMesh.h:113
std::shared_ptr< std::vector< gVertex > > vertices
Definition gMesh.h:114
static const int DRAWMODE_LINES
Definition gMesh.h:29
const gBoundingBox & getInitialBoundingBox() const
const gBoundingBox & getBoundingBox()
void applyVertexGradient()
static const int DRAWMODE_TRIANGLEFAN
Definition gMesh.h:30
void setAllVertexColor(const glm::vec3 &color)
gMesh(const std::vector< gVertex > &vertices, const std::vector< gIndex > &indices, const std::vector< gTexture * > &textures)
std::shared_ptr< std::vector< gVertex > > getVerticesPtr()
TextureType
Definition gTexture.h:19
@ TEXTURETYPE_PBR_AO
Definition gTexture.h:28
@ TEXTURETYPE_HEIGHT
Definition gTexture.h:23
@ TEXTURETYPE_NORMAL
Definition gTexture.h:22
@ TEXTURETYPE_PBR_ALBEDO
Definition gTexture.h:24
@ TEXTURETYPE_PBR_METALNESS
Definition gTexture.h:26
@ TEXTURETYPE_DIFFUSE
Definition gTexture.h:20
@ TEXTURETYPE_PBR_ROUGHNESS
Definition gTexture.h:25
@ TEXTURETYPE_PBR_NORMAL
Definition gTexture.h:27
@ TEXTURETYPE_SPECULAR
Definition gTexture.h:21