Skip to content

Commit cc327ee

Browse files
authored
Support facets with > 255 vertices. (tinyobjloader#375)
1 parent ee45fb4 commit cc327ee

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

tiny_obj_loader.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,10 +352,9 @@ struct index_t {
352352

353353
struct mesh_t {
354354
std::vector<index_t> indices;
355-
std::vector<unsigned char>
355+
std::vector<unsigned int>
356356
num_face_vertices; // The number of vertices per
357-
// face. 3 = triangle, 4 = quad,
358-
// ... Up to 255 vertices per face.
357+
// face. 3 = triangle, 4 = quad, ...
359358
std::vector<int> material_ids; // per-face material ID
360359
std::vector<unsigned int> smoothing_group_ids; // per-face smoothing group
361360
// ID(0 = off. positive value
@@ -1946,7 +1945,7 @@ static bool exportGroupsToShape(shape_t *shape, const PrimGroup &prim_group,
19461945
}
19471946

19481947
shape->mesh.num_face_vertices.push_back(
1949-
static_cast<unsigned char>(npolys));
1948+
static_cast<unsigned int>(npolys));
19501949
shape->mesh.material_ids.push_back(material_id); // per face
19511950
shape->mesh.smoothing_group_ids.push_back(
19521951
face.smoothing_group_id); // per face

0 commit comments

Comments
 (0)