mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 21:11:50 +00:00
feat: process external custom block models for variable textures
This commit is contained in:
parent
43c76c92ff
commit
9a0f6b23b0
4 changed files with 81 additions and 21 deletions
|
|
@ -31,11 +31,19 @@ namespace model {
|
|||
const glm::vec3& norm,
|
||||
const UVRegion& region
|
||||
);
|
||||
void addRect(
|
||||
const glm::vec3& pos,
|
||||
const glm::vec3& right,
|
||||
const glm::vec3& up,
|
||||
const glm::vec3& norm,
|
||||
const UVRegion& region
|
||||
);
|
||||
void addBox(const glm::vec3& pos, const glm::vec3& size);
|
||||
void addBox(
|
||||
const glm::vec3& pos,
|
||||
const glm::vec3& size,
|
||||
const UVRegion (&texfaces)[6]
|
||||
const UVRegion (&texfaces)[6],
|
||||
const bool enabledSides[6]
|
||||
);
|
||||
void scale(const glm::vec3& size);
|
||||
};
|
||||
|
|
@ -47,6 +55,11 @@ namespace model {
|
|||
/// @param texture texture name
|
||||
/// @return writeable Mesh
|
||||
Mesh& addMesh(const std::string& texture) {
|
||||
for (auto& mesh : meshes) {
|
||||
if (mesh.texture == texture) {
|
||||
return mesh;
|
||||
}
|
||||
}
|
||||
meshes.push_back({texture, {}});
|
||||
return meshes[meshes.size()-1];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue