fix custom models shading flag & add more properties to vcm

This commit is contained in:
MihailRis
2025-07-13 18:51:53 +03:00
parent 57a9a26c23
commit 3e59b186d3
6 changed files with 40 additions and 16 deletions
+5 -5
View File
@@ -16,7 +16,7 @@ namespace model {
struct Mesh {
std::string texture;
std::vector<Vertex> vertices;
bool lighting = true;
bool shading = true;
void addPlane(
const glm::vec3& pos,
@@ -54,14 +54,14 @@ namespace model {
/// @brief Add mesh to the model
/// @param texture texture name
/// @return writeable Mesh
Mesh& addMesh(const std::string& texture) {
Mesh& addMesh(const std::string& texture, bool shading = true) {
for (auto& mesh : meshes) {
if (mesh.texture == texture) {
if (mesh.texture == texture && mesh.shading == shading) {
return mesh;
}
}
meshes.push_back({texture, {}});
return meshes[meshes.size()-1];
meshes.push_back({texture, {}, shading});
return meshes[meshes.size() - 1];
}
/// @brief Remove all empty meshes
void clean();