diff --git a/README.md b/README.md new file mode 100644 index 0000000..c200aa7 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +## Collage +#### [![License: Unlicense](https://img.shields.io/badge/license-Unlicense-blue.svg)](http://unlicense.org/) + +Another model loader for Linux & Windows. + +### Supported Formats +- Wavefront OBJ +- Animated Wavefront OBJ +- Collada (maybe) +- FBX + +### Building The Demo +```bash +git clone https://git.redacted.cc/Redacted/Collage.git && cd Collage && mkdir build && cd build && cmake .. && make -j8 +``` \ No newline at end of file diff --git a/include/Collage/collage.h b/include/Collage/collage.h new file mode 100644 index 0000000..5fde500 --- /dev/null +++ b/include/Collage/collage.h @@ -0,0 +1,2 @@ +#pragma once +#include diff --git a/include/types/animation.h b/include/Collage/types/animation.h similarity index 54% rename from include/types/animation.h rename to include/Collage/types/animation.h index af56eef..8b42482 100644 --- a/include/types/animation.h +++ b/include/Collage/types/animation.h @@ -1,6 +1,6 @@ #pragma once #include -#include +#include struct KeyFrame { uint index; diff --git a/include/types/bone.h b/include/Collage/types/bone.h similarity index 100% rename from include/types/bone.h rename to include/Collage/types/bone.h diff --git a/include/Collage/types/keyFrame.h b/include/Collage/types/keyFrame.h new file mode 100644 index 0000000..5ff4550 --- /dev/null +++ b/include/Collage/types/keyFrame.h @@ -0,0 +1,2 @@ +#pragma once +#include diff --git a/include/types/model.h b/include/Collage/types/model.h similarity index 96% rename from include/types/model.h rename to include/Collage/types/model.h index 636c550..b2640f7 100644 --- a/include/types/model.h +++ b/include/Collage/types/model.h @@ -5,7 +5,7 @@ #include #include #include -#include +#include typedef Vector3 Vertex; diff --git a/include/types/textureInfo.h b/include/Collage/types/textureInfo.h similarity index 100% rename from include/types/textureInfo.h rename to include/Collage/types/textureInfo.h diff --git a/include/collage.h b/include/collage.h deleted file mode 100644 index 0de35c9..0000000 --- a/include/collage.h +++ /dev/null @@ -1,2 +0,0 @@ -#pragma once -#include diff --git a/include/types/keyFrame.h b/include/types/keyFrame.h deleted file mode 100644 index 2887ac2..0000000 --- a/include/types/keyFrame.h +++ /dev/null @@ -1,2 +0,0 @@ -#pragma once -#include diff --git a/src/obj.cpp b/src/obj.cpp index a7fa4a3..7fe2861 100644 --- a/src/obj.cpp +++ b/src/obj.cpp @@ -1,9 +1,8 @@ #include -#include +#include void Model::loadOBJ(const std::string& filename) { std::ifstream file(filename); - //if (!file.is_open()) std::vector positions; std::vector uvs; TextureInformation tInfo = {}; @@ -35,7 +34,6 @@ void Model::loadOBJ(const std::string& filename) { Vector2 textureCoordinate; vertex = positions[vertexIndex[i]]; textureCoordinate = uvs[texCoordIndex[i]]; - vertices.push_back(vertex); tInfo.textureCoordinates.push_back(textureCoordinate); indices.push_back(static_cast(indices.size())); @@ -44,19 +42,4 @@ void Model::loadOBJ(const std::string& filename) { } textureInfo.push_back(tInfo); file.close(); -}; - -// map face of model to positions and texture coords -void Model::mapFaces(const FaceIndices& facedata, const std::vector& positions, const std::vector& uvs) { - std::vector textureCoordinates; - for (int i = 0; i < 3; ++i) { - Vector3 vertex; - //Vector2 textureCoordinate; - vertex = positions[facedata.vertexIndex[i]]; - //textureCoordinate = uvs[facedata.texCoordIndex[i]]; - vertices.push_back(vertex); - indices.push_back(static_cast(indices.size())); - //textureCoordinates.push_back(textureCoordinate); - } - textureInfo.push_back({"", textureCoordinates}); -} \ No newline at end of file +}; \ No newline at end of file diff --git a/src/types/animation.cpp b/src/types/animation.cpp index e2e67ee..1e68caf 100644 --- a/src/types/animation.cpp +++ b/src/types/animation.cpp @@ -1,2 +1,2 @@ -#include -#include \ No newline at end of file +#include +#include \ No newline at end of file diff --git a/src/types/bone.cpp b/src/types/bone.cpp index 547b443..df30038 100644 --- a/src/types/bone.cpp +++ b/src/types/bone.cpp @@ -1,4 +1,4 @@ -#include +#include const Matrix4x4& Bone::getMatrix() { return matrix; diff --git a/src/types/boneMap.cpp b/src/types/boneMap.cpp index db0bf22..24ded65 100644 --- a/src/types/boneMap.cpp +++ b/src/types/boneMap.cpp @@ -1,4 +1,4 @@ -#include +#include struct BoneMap { std::vector bones; }; \ No newline at end of file diff --git a/src/types/model.cpp b/src/types/model.cpp index be3edf3..7345273 100644 --- a/src/types/model.cpp +++ b/src/types/model.cpp @@ -1,4 +1,4 @@ -#include +#include void Model::load(const std::string& file) { if (file.ends_with(".obj"))