mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
add src/coders/obj
This commit is contained in:
parent
a9640fff36
commit
e4f9bd03b7
11 changed files with 241 additions and 28 deletions
|
|
@ -1,5 +1,7 @@
|
|||
#include "Model.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
using namespace model;
|
||||
|
||||
inline constexpr glm::vec3 X(1, 0, 0);
|
||||
|
|
@ -26,3 +28,14 @@ void Mesh::addBox(glm::vec3 pos, glm::vec3 size) {
|
|||
addPlane(pos+X*size, -Z*size, Y*size, X);
|
||||
addPlane(pos-X*size, Z*size, Y*size, -X);
|
||||
}
|
||||
|
||||
|
||||
void Model::clean() {
|
||||
meshes.erase(
|
||||
std::remove_if(meshes.begin(), meshes.end(),
|
||||
[](const Mesh& mesh){
|
||||
return mesh.vertices.empty();
|
||||
}),
|
||||
meshes.end()
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue