Commit Graph

44 Commits

Author SHA1 Message Date
Adi Shavit @ MacBookPro
3736a5791f Fix a crash bug in LoadObjWithCallback() when passing a nullptr as MaterialReader *readMatFn.
- This preserves the existing API. If `nullptr` is passed then the material file will be ignored. This is useful when the user is not interested in the materials.
- Note that if `nullptr` is not a valid option for this function, then the API needs to be changed to take `MaterialReader&`.
2016-07-27 10:04:22 +03:00
Adi Shavit @ MacBookPro
0b0bf60137 Move heap-based objects like vectors and strings outside the parse loop in LoadObjWithCallback().
This avoids reallocation on every use making the code faster.
2016-07-27 10:00:13 +03:00
Syoyo Fujita
d496d8eab6 Remove some invalid comments. Fix calling index_cb per f line. Fixes #87. 2016-07-27 00:02:53 +09:00
Syoyo Fujita
22883def8d Support PBR extension for MTL which is proposed in http://exocortex.com/blog/extending_wavefront_mtl_to_support_pbr 2016-07-25 22:46:30 +09:00
Syoyo Fujita
e3a56816d6 Use std::getline() to read arbitrary size of line data. 2016-07-24 15:53:05 +09:00
Syoyo Fujita
93c495eca8 Fix 'o' callback. 2016-05-13 15:56:12 +09:00
Syoyo Fujita
368312cb4b Fix index buffer was not filled when !triangulate case.
Suppress VS2015 warnings.
Update premake5.exe.
2016-05-02 01:42:18 +09:00
Syoyo Fujita
8d60b4963a Rename varialble for better understanding.
Write some API usage in README.md.
2016-05-01 21:30:50 +09:00
Syoyo Fujita
58fa260605 Show normal vector in viewer example. 2016-04-20 16:00:45 +09:00
Syoyo Fujita
a55247574c Suppress VC2013 warnings.
Update AppVeyor script.
2016-04-19 13:11:55 +09:00
Syoyo Fujita
f4695de408 Suppress compiler warning. 2016-04-19 12:50:41 +09:00
Syoyo Fujita
1e663342bf Add callback API example.
Fix a sentinel value for the vertex index.
2016-04-18 17:52:04 +09:00
Syoyo Fujita
93acf63157 Change API for usemtl callback. 2016-04-18 16:48:37 +09:00
Syoyo Fujita
72ef6cbb76 Add initial unit test codes using Catch.
Add Kuroga build script.
2016-04-18 16:03:24 +09:00
Syoyo Fujita
54bd46014c Use google C++ code style. 2016-04-16 20:25:53 +09:00
Syoyo Fujita
ee7d6cc0fd Refactor and re-design tinyobjloader.
* Separete attribs(vtx,normal,texcoords) and shape.
* Support different index for vtx/normal/texcoord.
2016-04-16 19:49:12 +09:00
Syoyo Fujita
d119dcb976 Cosmetics. 2016-04-15 12:31:47 +09:00
Nicolas Guillemot
b40e8c9427 use sscanf_s in MSVC
consistent with other uses of sscanf in the library
2016-04-02 15:15:29 -07:00
Syoyo Fujita
ad9911ef1b Initialize vertex_index. Fixes #70. 2016-03-25 18:43:52 +09:00
Syoyo Fujita
bc42bc47ad Don't create new shape by usemtl. Fixes #68. 2016-03-12 02:14:52 +09:00
Ambal
cf52401ca7 Replace calls to 'isdigit', 'isSpace' and 'isNewLine' functions to macros. Other small performance tweaks. 2016-02-20 12:20:19 +02:00
Syoyo Fujita
41515c8c78 Apply clang-format. 2016-01-30 00:48:42 +09:00
Syoyo Fujita
968ad8248e Cosmetic updates. 2016-01-29 19:55:04 +09:00
Syoyo Fujita
b3eed44b3e Merge branch 'master' of github.com:syoyo/tinyobjloader 2016-01-29 19:50:29 +09:00
Syoyo Fujita
9f24c7c38e Merge branch 'master' of https://github.com/dboogert/tinyobjloader into dboogert-master
Conflicts:
	test.cc
	tiny_obj_loader.cc
	tiny_obj_loader.h
2016-01-29 19:49:07 +09:00
dboogert
2fcdd32bc3 subd support: n-sided polygons & pixar crease tags
+ optional parameter to triangulate polygons to maintain compatibility
+ added create tag test & example subd crease tag file from OpenSubD source code
2016-01-28 18:34:08 +00:00
mogemimi
0e23d499c7 Fix minor typos 2016-01-18 08:05:54 +09:00
Syoyo Fujita
783b8c4886 Suppress clang compiler warnings. 2015-12-05 12:34:28 +09:00
Syoyo Fujita
353d527fe8 Add Cocos2d-x.
Make tinyobjloader header-only.
2015-11-26 14:10:32 +09:00
Syoyo Fujita
e7e7eed616 Change API and handle no-mtl-file case correctly. Fixes #58. 2015-11-07 23:08:39 +09:00
Syoyo Fujita
7f2092b29f Support specular highlight, bump, displacement and alpha texture(Remove non-standard "normal map"). Fixes #53. 2015-09-01 20:20:10 +09:00
Syoyo Fujita
28005f9cdf Update copyright year. 2015-02-28 00:47:13 +09:00
Syoyo Fujita
9979275835 Format source code. 2015-02-15 16:51:38 +09:00
Syoyo Fujita
e4d4c65a17 Fix material ID assignment.
Fix build of example/obj_sticher.
2014-09-14 19:51:24 +09:00
Syoyo Fujita
cbba0a807e Initial support of multi-materials per group.
Introduce material_id attribute per face.
2014-09-13 23:49:25 +09:00
Mykhailo Parfeniuk
33cd9a4768 Added multiple materials per shape/object 2014-09-07 14:19:22 +03:00
Mattias Harrysson
f72fb80ac9 fix compiler warnings 2014-06-02 20:52:44 +02:00
E J Burns
b89a46c417 Code Modified to remove use of C++11 features.
Tested compilation with VS2012, clang++ 3.4 and g++.
2014-04-29 13:36:09 +01:00
E J Burns
08ff49d2d0 Added a LoadObj function that reads from a std::istream.
+ Added a LoadObj function that reads from a std::istream.  This should allow
   more generic usage and possibly make testing a little easier.
   o This LoadObj accepts a function that returns a
     std::unique_ptr<std::istream> for a material.
 + Modified LoadMtl to read from a std::istream to allow more generic
   usage.
 + Modified test.cc to check that the changes work as expected and nothing was
   broken.

Tests:
 + Compiled test.cc, checked diff of output against pre change output.
   Same output where expected.
2014-04-28 20:26:03 +01:00
Matt Pharr
6372ccbef2 Add support for parsing 'illum' and 'd'/'Tr' statements. 2014-04-09 09:46:03 -07:00
Syoyo Fujita
1544f0c865 Parse ior and transmittance of material parameter.
Add .obj sticher example.
2013-09-11 13:03:24 +09:00
Syoyo Fujita
5284dcb19f Parse multiple group name. Not yet finished fully though. 2013-06-29 13:00:22 +09:00
YarmUI
d62fdaf89d update .mtl loader (Ke, Ns, map_Ka, map_Kd, map_Ks, map_Ns) 2012-08-21 18:35:37 +09:00
Syoyo Fujita
cf78dd845b Initial commit. 2012-08-19 14:36:48 +09:00