diff options
| author | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2021-10-02 17:32:23 +0700 |
|---|---|---|
| committer | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2021-10-02 17:32:23 +0700 |
| commit | 4aeff0886aa61ed3834ef4826aa1a1f3e99508b1 (patch) | |
| tree | 0be178818e4ed9de7e70872c224ce73adaba8f6a /src/Models.cpp | |
| parent | 7a4fdb3978c36e4309479806140f38669bcd3883 (diff) | |
| download | blackshades-4aeff0886aa61ed3834ef4826aa1a1f3e99508b1.tar.gz | |
Clean up unused functions and style 2.4.0
Diffstat (limited to 'src/Models.cpp')
| -rw-r--r-- | src/Models.cpp | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/src/Models.cpp b/src/Models.cpp index 6d8eecf..8f3dc37 100644 --- a/src/Models.cpp +++ b/src/Models.cpp @@ -1,3 +1,5 @@ +#include <algorithm> + #include "Models.h" #include "misc.h" @@ -90,28 +92,12 @@ void Model::load(const char* path) boundingsphereradius = 0; for (auto&& v : vertex) - boundingsphereradius = max(boundingsphereradius, + boundingsphereradius = std::max(boundingsphereradius, findDistancefast(average, v)); boundingsphereradius = sqrt(boundingsphereradius); CalculateNormals(); } -void Model::save(const char* path) -{ - auto f = fopen(path, "w"); - fprintf(f, "%d %d 0\n", vertexNum, TriangleNum); - for (int i = 0; i < vertexNum; ++i) - fprintf(f, "%.3f %.3f %.3f\n", - vertex[i].x, vertex[i].y, vertex[i].z); - for (int i = 0; i < TriangleNum; ++i) - fprintf(f, "3 %d %d %d %.3f %.3f %.3f\n", - Triangles[i].vertex[0], - Triangles[i].vertex[1], - Triangles[i].vertex[2], - Triangles[i].r, Triangles[i].g, Triangles[i].b); - fclose(f); -} - void Model::Scale(float xscale,float yscale,float zscale) { int i; |
