|
Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
|
#include <model.hpp>
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 |
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)
| 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
Render the Mesh to the viewport using the provided shader program.
| shader | to use when rendering the program. Determines position of vertices and their color/texture. |
| modelView | determines the scaling/rotation/translation of the mesh |
Implements Renderable.
| Material Mesh::material |
| std::optional<glm::vec3> Mesh::solidColor |