diff --git a/modules/asset_loader/include/vkcv/asset/asset_loader.hpp b/modules/asset_loader/include/vkcv/asset/asset_loader.hpp index c677f600e0a0304f26835c685d9ab10545433ad5..8d255143c67451c2fbf7ce6a463cd1ea171fac1f 100644 --- a/modules/asset_loader/include/vkcv/asset/asset_loader.hpp +++ b/modules/asset_loader/include/vkcv/asset/asset_loader.hpp @@ -24,7 +24,7 @@ * top. * * Each Mesh has an array of one or more vertex groups (called "primitives" in - * glFW parlance) and an array of zero or more Materials. + * glTF parlance) and an array of zero or more Materials. * * Each vertex group describes a part of the meshes vertices by defining how * they should be rendered (as points, lines, triangles), how many indices and @@ -43,8 +43,12 @@ namespace vkcv::asset { -// enum matches modes in fx-gltf, the library returns a standard mode (TRIANGLES) if no mode is given in the file -enum PrimitiveMode { POINTS=0, LINES, LINELOOP, LINESTRIP, TRIANGLES, TRIANGLESTRIP, TRIANGLEFAN }; +/* This enum matches modes in fx-gltf, the library returns a standard mode + * (TRIANGLES) if no mode is given in the file. */ +enum PrimitiveMode { + POINTS=0, LINES, LINELOOP, LINESTRIP, TRIANGLES, TRIANGLESTRIP, + TRIANGLEFAN +}; /* With these enums, 0 is reserved to signal uninitialized or invalid data. */ enum PrimitiveType { POSITION=1, NORMAL, TEXCOORD_0 }; /* The indices in the index buffer can be of different bit width. */ diff --git a/modules/asset_loader/src/vkcv/asset/asset_loader.cpp b/modules/asset_loader/src/vkcv/asset/asset_loader.cpp index 0a5f35276f01ec76bd91918352d853bcc2141b94..6fe0da62b3db4fcd283df588612bee0d6deb52df 100644 --- a/modules/asset_loader/src/vkcv/asset/asset_loader.cpp +++ b/modules/asset_loader/src/vkcv/asset/asset_loader.cpp @@ -11,6 +11,9 @@ namespace vkcv::asset { * @param type * @return unsigned integer representation */ +// TODO Return proper error code (we need to define those as macros or enums, +// will discuss during the next core meeting if that should happen on the scope +// of the vkcv framework or just this module) uint8_t convertTypeToInt(const fx::gltf::Accessor::Type type) { switch (type) { case fx::gltf::Accessor::Type::None : @@ -63,11 +66,15 @@ int loadMesh(const std::string &path, Mesh &mesh) { return 0; } - // XXX Temporary restriction: Only one mesh per glTF file + // TODO Temporary restriction: Only one mesh per glTF file allowed + // currently. Later, we want to support whole scenes with more than + // just meshes. if (object.meshes.size() != 1) return 0; fx::gltf::Mesh const &objectMesh = object.meshes[0]; - // TODO We want to support more than one vertex group eventually... + // TODO We want to support more than one vertex group per mesh + // eventually... right now this is hard-coded to use only the first one + // because we only care about the example triangle and cube fx::gltf::Primitive const &objectPrimitive = objectMesh.primitives[0]; fx::gltf::Accessor posAccessor;