Fast C OBJ parser
Find a file
Arseny Kapoulkine 293b83f259 Fix .obj parsing when empty 'g' is last
In some .obj files, there's a stray 'g' followed by a newline at the
very end of the file. What happens right now is that *p++ skips past the
"terminating newline", and then proceeds to process out of bounds memory
which leads to a crash.

I'm not sure if 'g' can actually be empty per spec, so this change just
fixes the crash without resetting the group to "default" or anything
like that; 'v'/'f' shouldn't be empty but this would fix crashing when
parsing malicious/malformed .obj files as well.
2019-06-01 11:31:34 -07:00
test Fix Windows compilation warnings 2019-05-22 10:55:27 +01:00
.gitignore Add .gitignore file 2019-05-19 09:51:43 +01:00
CMakeLists.txt Remove compile flags from CMakeLists.txt 2019-05-19 10:01:03 +01:00
fast_obj.h Fix .obj parsing when empty 'g' is last 2019-06-01 11:31:34 -07:00
LICENSE Initial commit 2018-07-29 13:31:09 +01:00
README.md Slight reorganise to fit in with stb reqs 2018-07-29 13:59:16 +01:00

fast_obj

Because the world needs another OBJ loader. Single header library, should compile without warnings in both C89 or C++. Much faster (5-10x) than other libraries tested.

To use:

 fastObjMesh* mesh = fast_obj_read("path/to/objfile.obj");

 ...do stuff with mesh...

 fast_obj_destroy(mesh);

Simple test app to compare speed against tinyobjloader and check output matches.