Skip to content

Commit

Permalink
Add a flag to cgltf_texture_transform so it's possible to tell if KHR…
Browse files Browse the repository at this point in the history
…_texture_transform supplies texcoord or not.
  • Loading branch information
jkuhlmann committed Sep 6, 2021
1 parent c994e31 commit a92412b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cgltf.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ typedef struct cgltf_texture_transform
cgltf_float offset[2];
cgltf_float rotation;
cgltf_float scale[2];
cgltf_bool has_texcoord;
cgltf_int texcoord;
} cgltf_texture_transform;

Expand Down Expand Up @@ -3305,6 +3306,7 @@ static int cgltf_parse_json_texture_transform(jsmntok_t const* tokens, int i, co
else if (cgltf_json_strcmp(tokens + i, json_chunk, "texCoord") == 0)
{
++i;
out_texture_transform->has_texcoord = 1;
out_texture_transform->texcoord = cgltf_json_to_int(tokens + i, json_chunk);
++i;
}
Expand Down

2 comments on commit a92412b

@zeux
Copy link
Contributor

@zeux zeux commented on a92412b Sep 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also be checked in cgltf_write I suspect

@jkuhlmann
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, of course, I've added that in a86b359. Thanks!

Please sign in to comment.