Merge branch 'develop' of github.com:syoyo/tinyobjloader into develop

This commit is contained in:
Syoyo Fujita
2016-05-12 19:40:26 +09:00

View File

@@ -8,6 +8,7 @@
#include <iostream> #include <iostream>
#include <limits> #include <limits>
#include <cmath> #include <cmath>
#include <cassert>
#include <algorithm> #include <algorithm>
#include <GL/glew.h> #include <GL/glew.h>
@@ -118,6 +119,9 @@ bool LoadObjAndConvert(float bmin[3], float bmax[3], std::vector<DrawObject>& dr
int f0 = idx0.vertex_index; int f0 = idx0.vertex_index;
int f1 = idx1.vertex_index; int f1 = idx1.vertex_index;
int f2 = idx2.vertex_index; int f2 = idx2.vertex_index;
assert(f0 >= 0);
assert(f1 >= 0);
assert(f2 >= 0);
v[0][k] = attrib.vertices[3*f0+k]; v[0][k] = attrib.vertices[3*f0+k];
v[1][k] = attrib.vertices[3*f1+k]; v[1][k] = attrib.vertices[3*f1+k];
@@ -136,6 +140,9 @@ bool LoadObjAndConvert(float bmin[3], float bmax[3], std::vector<DrawObject>& dr
int f0 = idx0.normal_index; int f0 = idx0.normal_index;
int f1 = idx1.normal_index; int f1 = idx1.normal_index;
int f2 = idx2.normal_index; int f2 = idx2.normal_index;
assert(f0 >= 0);
assert(f1 >= 0);
assert(f2 >= 0);
for (int k = 0; k < 3; k++) { for (int k = 0; k < 3; k++) {
n[0][k] = attrib.normals[3*f0+k]; n[0][k] = attrib.normals[3*f0+k];
n[1][k] = attrib.normals[3*f1+k]; n[1][k] = attrib.normals[3*f1+k];