Skip to content
Snippets Groups Projects
Commit e9cafd07 authored by Trevor Hollmann's avatar Trevor Hollmann
Browse files

[#26] Update TODO comments and fix some formatting.

parent d6c44973
No related branches found
No related tags found
1 merge request!19Resolve "Asset Loading"
......@@ -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. */
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment