Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
Mesh Class Reference

#include <model.hpp>

Inheritance diagram for Mesh:
Renderable

Public Member Functions

 Mesh (const std::vector< Vertex > &vertices, const std::vector< unsigned int > &indices, const std::vector< Texture > &textures, const Material &material)
 
void draw (Shader *shader, glm::vec3 camPos, bool fill) override
 
- Public Member Functions inherited from Renderable
 Renderable ()
 
virtual void draw (Shader *shader, glm::vec3 camPos, bool fill)=0
 
virtual void translateAbsolute (const glm::vec3 &new_pos)
 
virtual void translateRelative (const glm::vec3 &delta)
 
virtual void scaleAbsolute (const float &new_factor)
 
virtual void scaleAbsolute (const glm::vec3 &scale)
 
virtual void scaleRelative (const float &new_factor)
 
virtual void scaleRelative (const glm::vec3 &scale)
 
virtual void rotateAbsolute (const glm::vec3 &dir, bool is_player=false, const glm::vec3 &axis=glm::vec3(0.0f, 1.0f, 0.0f))
 Rotates the item along the specified axis. If no axis is specified, then assumes a rotation on the y-axis. This will not stack upon previous rotations. More...
 
virtual void rotateAbsolute (const float &angle, const glm::vec3 &axis=glm::vec3(0.0f, 1.0f, 0.0f))
 Rotates the item along the specified axis. If no axis is specified, then assumes a rotation on the y-axis. This will not stack upon previous rotations. More...
 
virtual void rotateRelative (const glm::vec3 &dir, const glm::vec3 &axis=glm::vec3(0.0f, 1.0f, 0.0f))
 Rotates the item along the specified axis. If no axis is specified, then assumes a rotation on the y-axis. This will stack upon previous rotations. More...
 
glm::mat4 getModelMat ()
 
virtual void clear ()
 
virtual void clearScale ()
 
virtual void clearPosition ()
 

Data Fields

std::optional< glm::vec3 > solidColor
 
Material material
 

Detailed Description

Mesh holds the data needed to render a mesh (collection of triangles).

A Mesh differs from a Model since a Model is typically made up of multiple, smaller meshes. This is useful for animating parts of model individual (ex: legs, arms, head)

Constructor & Destructor Documentation

◆ Mesh()

Mesh::Mesh ( const std::vector< Vertex > &  vertices,
const std::vector< unsigned int > &  indices,
const std::vector< Texture > &  textures,
const Material material 
)

Creates a new mesh from a collection of vertices, indices and textures

Member Function Documentation

◆ draw()

void Mesh::draw ( Shader shader,
glm::vec3  camPos,
bool  fill 
)
overridevirtual

Render the Mesh to the viewport using the provided shader program.

Parameters
shaderto use when rendering the program. Determines position of vertices and their color/texture.
modelViewdetermines the scaling/rotation/translation of the mesh

Implements Renderable.

Field Documentation

◆ material

Material Mesh::material

◆ solidColor

std::optional<glm::vec3> Mesh::solidColor

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