mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
fix custom models shading flag & add more properties to vcm
This commit is contained in:
parent
57a9a26c23
commit
3e59b186d3
6 changed files with 40 additions and 16 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue