12 Commits

Author SHA1 Message Date
Syoyo Fujita
b2ad2cd11e Remove invalid file.
Fix compilation.
2017-12-10 00:35:02 +09:00
tigrazone
05f06d09d8 hashed tokens as keys of map. 5% speedup 2017-12-09 13:17:04 +02:00
tigrazone
3c0196bfb7 map vs unordered_map remake 2017-12-09 11:59:33 +02:00
tigrazone
dc4c970262 small speedups - up to 1-3% 2017-12-08 23:39:07 +02:00
tigrazone
aeb0f05c0e remove stringstream for simple string copy 2017-12-08 23:19:31 +02:00
tigrazone
c016910317 minimize token checks 2017-12-08 21:53:36 +02:00
tigrazone
5d7f6bf539 buffered file read 2017-12-08 13:21:45 +02:00
tigrazone
b818a34f1a small fixes2 2017-12-08 09:05:42 +02:00
tigrazone
baa62f4d89 small fixes 2017-12-08 08:43:33 +02:00
tigrazone
b2f07d10aa 1.1.2 : new hashed keywords 2017-12-07 08:38:44 +02:00
tigrazone
ee2c734c15 refactoring for new speedup release1 2017-12-06 22:44:04 +02:00
tigrazone
6e579f027f refactoring for new speedup release 2017-12-06 22:37:44 +02:00
16 changed files with 1090 additions and 704 deletions

View File

@@ -26,20 +26,11 @@ Old version is available `v0.9.x` branch https://github.com/syoyo/tinyobjloader/
## What's new
### Version 2.x
* Refactor API
* Support triangulation for concave polygons(#151)
### Version 1.x
Avaiable in `v1.x.y` branch.
* 20 Aug, 2016 : Bump version v1.0.0. New data structure and API!
### Older version
### Old version
Older version is avaiable in `v0.9.x` branch.
Previous old version is avaiable in `v0.9.x` branch.
## Example
@@ -58,11 +49,7 @@ http://casual-effects.com/data/index.html
TinyObjLoader is successfully used in ...
### New version(v2.x)
* Your project here! (Letting us know via github issue is welcome!)
### Old version(v1.x)
### New version(v1.0.x)
* Double precision support through `TINYOBJLOADER_USE_DOUBLE` thanks to noma
* Loading models in Vulkan Tutorial https://vulkan-tutorial.com/Loading_models
@@ -73,7 +60,7 @@ TinyObjLoader is successfully used in ...
* VFPR - a Vulkan Forward Plus Renderer : https://github.com/WindyDarian/Vulkan-Forward-Plus-Renderer
* Your project here! (Letting us know via github issue is welcome!)
### Older version(v0.9.x)
### Old version(v0.9.x)
* bullet3 https://github.com/erwincoumans/bullet3
* pbrt-v2 https://github.com/mmp/pbrt-v2
@@ -241,12 +228,12 @@ for (size_t s = 0; s < shapes.size(); s++) {
for (size_t v = 0; v < fv; v++) {
// access to vertex
tinyobj::index_t idx = shapes[s].mesh.indices[index_offset + v];
tinyobj::real_t vx = attrib.vertices[idx.vertex_index].x;
tinyobj::real_t vy = attrib.vertices[idx.vertex_index].y;
tinyobj::real_t vz = attrib.vertices[idx.vertex_index].z;
tinyobj::real_t nx = attrib.normals[idx.normal_index].x;
tinyobj::real_t ny = attrib.normals[idx.normal_index].y;
tinyobj::real_t nz = attrib.normals[idx.normal_index].z;
tinyobj::real_t vx = attrib.vertices[3*idx.vertex_index+0];
tinyobj::real_t vy = attrib.vertices[3*idx.vertex_index+1];
tinyobj::real_t vz = attrib.vertices[3*idx.vertex_index+2];
tinyobj::real_t nx = attrib.normals[3*idx.normal_index+0];
tinyobj::real_t ny = attrib.normals[3*idx.normal_index+1];
tinyobj::real_t nz = attrib.normals[3*idx.normal_index+2];
tinyobj::real_t tx = attrib.texcoords[2*idx.texcoord_index+0];
tinyobj::real_t ty = attrib.texcoords[2*idx.texcoord_index+1];
// Optional: vertex colors

View File

@@ -106,24 +106,24 @@ static void PrintInfo(const tinyobj::attrib_t& attrib,
std::cout << "# of shapes : " << shapes.size() << std::endl;
std::cout << "# of materials : " << materials.size() << std::endl;
for (size_t v = 0; v < attrib.vertices.size(); v++) {
for (size_t v = 0; v < attrib.vertices.size() / 3; v++) {
printf(" v[%ld] = (%f, %f, %f)\n", static_cast<long>(v),
static_cast<const double>(attrib.vertices[v].x),
static_cast<const double>(attrib.vertices[v].y),
static_cast<const double>(attrib.vertices[v].z));
static_cast<const double>(attrib.vertices[3 * v + 0]),
static_cast<const double>(attrib.vertices[3 * v + 1]),
static_cast<const double>(attrib.vertices[3 * v + 2]));
}
for (size_t v = 0; v < attrib.normals.size(); v++) {
for (size_t v = 0; v < attrib.normals.size() / 3; v++) {
printf(" n[%ld] = (%f, %f, %f)\n", static_cast<long>(v),
static_cast<const double>(attrib.normals[v].x),
static_cast<const double>(attrib.normals[v].y),
static_cast<const double>(attrib.normals[v].z));
static_cast<const double>(attrib.normals[3 * v + 0]),
static_cast<const double>(attrib.normals[3 * v + 1]),
static_cast<const double>(attrib.normals[3 * v + 2]));
}
for (size_t v = 0; v < attrib.texcoords.size(); v++) {
for (size_t v = 0; v < attrib.texcoords.size() / 2; v++) {
printf(" uv[%ld] = (%f, %f)\n", static_cast<long>(v),
static_cast<const double>(attrib.texcoords[v].x),
static_cast<const double>(attrib.texcoords[v].y));
static_cast<const double>(attrib.texcoords[2 * v + 0]),
static_cast<const double>(attrib.texcoords[2 * v + 1]));
}
// For each shape
@@ -361,7 +361,7 @@ static bool TestStreamLoadObj() {
virtual ~MaterialStringStreamReader() {}
virtual bool operator()(const std::string& matId,
std::vector<material_t>* materials,
std::map<std::string, int>* matMap,
std::map<unsigned int, int>* matMap,
std::string* err) {
(void)matId;
std::string warning;

View File

@@ -303,7 +303,7 @@ std::string matStream(
virtual bool operator() (
const std::string& matId,
std::vector<material_t>* materials,
std::map<std::string, int>* matMap,
std::map<unsigned int, int>* matMap,
std::string* err)
{
(void)matId;

File diff suppressed because it is too large Load Diff