mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 05:51:51 +00:00
add graphics/core/Model
This commit is contained in:
parent
916d1c1408
commit
6ba38ee167
5 changed files with 112 additions and 5 deletions
33
src/graphics/core/Model.hpp
Normal file
33
src/graphics/core/Model.hpp
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#ifndef GRAPHICS_CORE_MODEL_HPP_
|
||||
#define GRAPHICS_CORE_MODEL_HPP_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
namespace model {
|
||||
struct Vertex {
|
||||
glm::vec3 coord;
|
||||
glm::vec2 uv;
|
||||
glm::vec3 normal;
|
||||
};
|
||||
|
||||
struct Mesh {
|
||||
std::string texture;
|
||||
std::vector<Vertex> vertices;
|
||||
|
||||
void addPlane(glm::vec3 pos, glm::vec3 right, glm::vec3 up, glm::vec3 norm);
|
||||
void addBox(glm::vec3 pos, glm::vec3 size);
|
||||
};
|
||||
|
||||
struct Model {
|
||||
std::vector<Mesh> meshes;
|
||||
|
||||
Mesh& addMesh(const std::string& texture) {
|
||||
meshes.push_back({texture, {}});
|
||||
return meshes[meshes.size()-1];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif // GRAPHICS_CORE_MODEL_HPP_
|
||||
Loading…
Add table
Add a link
Reference in a new issue