Vivid
Loading...
Searching...
No Matches
Vivid::Mesh Class Reference

Contains a Mesh. More...

#include <Mesh.h>

Public Member Functions

 Mesh (Vector< Vertex > &verts, Vector< unsigned int > &inds, VertexBufferLayout layout, glm::mat4 modelMatrix, unsigned int instances=1)
 
 Mesh (Vector< Vertex > &verts, Vector< unsigned int > &inds, unsigned int instances=1)
 
 Mesh (Shape &shape, unsigned int instances=1)
 
 Mesh (const std::string &file_name, unsigned int instances=1)
 
 Mesh (const std::string &file_name, Ptr< Shader > shader, unsigned int instances=1)
 
void Update (const glm::mat4 &modelMatrix)
 
void BindShader (Ref< Shader > shader)
 
Vector< VertexGetVertices ()
 
Vector< unsigned int > GetIndices ()
 
glm::mat4 GetModelMatrix ()
 
ShaderGetShader ()
 
void SetVertices (Vector< Vertex > vertices)
 
void SetIndices (Vector< unsigned int > indices)
 
void Draw (Camera *camera)
 
unsigned int GetID ()
 
void EditMesh ()
 
void ImGuiRender ()
 
void AddTexture (String file_name)
 
Ref< TextureGetTexture (int index)
 

Detailed Description

Contains a Mesh.

Mesh is a class that contains a mesh. It is a derived class from Component. It contains a vector of vertices and indices. These vertices and indices are then rendered in the scene. It also contains a UI for the mesh. From the UI you can add and remove textures, choose the shader, and edit the mesh properties. The mesh properties include the model matrix, shininess, ambient strength, and specular strength. The mesh also contains a function to draw the mesh. This is automatically called by the model component.

Definition at line 31 of file Mesh.h.

Constructor & Destructor Documentation

◆ Mesh() [1/6]

Vivid::Mesh::Mesh ( )

Definition at line 12 of file Mesh.cpp.

◆ Mesh() [2/6]

Vivid::Mesh::Mesh ( Vector< Vertex > &  verts,
Vector< unsigned int > &  inds,
VertexBufferLayout  layout,
glm::mat4  modelMatrix,
unsigned int  instances = 1 
)

Definition at line 19 of file Mesh.cpp.

◆ Mesh() [3/6]

Vivid::Mesh::Mesh ( Vector< Vertex > &  verts,
Vector< unsigned int > &  inds,
unsigned int  instances = 1 
)

Definition at line 36 of file Mesh.cpp.

◆ Mesh() [4/6]

Vivid::Mesh::Mesh ( Shape shape,
unsigned int  instances = 1 
)
explicit

Definition at line 78 of file Mesh.cpp.

◆ Mesh() [5/6]

Vivid::Mesh::Mesh ( const std::string &  file_name,
unsigned int  instances = 1 
)
explicit

Definition at line 59 of file Mesh.cpp.

◆ Mesh() [6/6]

Vivid::Mesh::Mesh ( const std::string &  file_name,
Ptr< Shader shader,
unsigned int  instances = 1 
)
explicit

Definition at line 68 of file Mesh.cpp.

Member Function Documentation

◆ AddTexture()

void Vivid::Mesh::AddTexture ( String  file_name)
inline

Definition at line 98 of file Mesh.h.

◆ BindShader()

void Vivid::Mesh::BindShader ( Ref< Shader shader)

Definition at line 102 of file Mesh.cpp.

◆ Draw()

void Vivid::Mesh::Draw ( Camera camera)

Definition at line 291 of file Mesh.cpp.

◆ EditMesh()

void Vivid::Mesh::EditMesh ( )

Definition at line 346 of file Mesh.cpp.

◆ GetID()

unsigned int Vivid::Mesh::GetID ( )
inline

Definition at line 93 of file Mesh.h.

◆ GetIndices()

Vector< unsigned int > Vivid::Mesh::GetIndices ( )
inline

Definition at line 84 of file Mesh.h.

◆ GetModelMatrix()

glm::mat4 Vivid::Mesh::GetModelMatrix ( )
inline

Definition at line 85 of file Mesh.h.

◆ GetShader()

Shader & Vivid::Mesh::GetShader ( )
inline

Definition at line 86 of file Mesh.h.

◆ GetTexture()

Ref< Texture > Vivid::Mesh::GetTexture ( int  index)
inline

Definition at line 99 of file Mesh.h.

◆ GetVertices()

Vector< Vertex > Vivid::Mesh::GetVertices ( )
inline

Definition at line 83 of file Mesh.h.

◆ ImGuiRender()

void Vivid::Mesh::ImGuiRender ( )

Definition at line 351 of file Mesh.cpp.

◆ SetIndices()

void Vivid::Mesh::SetIndices ( Vector< unsigned int >  indices)

Definition at line 283 of file Mesh.cpp.

◆ SetVertices()

void Vivid::Mesh::SetVertices ( Vector< Vertex vertices)

Definition at line 273 of file Mesh.cpp.

◆ Update()

void Vivid::Mesh::Update ( const glm::mat4 &  modelMatrix)

Definition at line 97 of file Mesh.cpp.


The documentation for this class was generated from the following files: