Skip to content

Commit

Permalink
Updated to reflect name change:
Browse files Browse the repository at this point in the history
anisotropy_direction -> anisotropy_rotation
  • Loading branch information
abwood committed Mar 25, 2023
1 parent 111178c commit b5f7808
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cgltf.h
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ typedef struct cgltf_iridescence
typedef struct cgltf_anisotropy
{
cgltf_float anisotropy_strength;
cgltf_float anisotropy_direction;
cgltf_float anisotropy_rotation;
cgltf_texture_view anisotropy_texture;
} cgltf_anisotropy;

Expand Down Expand Up @@ -4044,7 +4044,7 @@ static int cgltf_parse_json_anisotropy(cgltf_options* options, jsmntok_t const*

// Default
out_anisotropy->anisotropy_strength = 0.f;
out_anisotropy->anisotropy_direction = 0.f;
out_anisotropy->anisotropy_rotation = 0.f;

for (int j = 0; j < size; ++j)
{
Expand All @@ -4056,10 +4056,10 @@ static int cgltf_parse_json_anisotropy(cgltf_options* options, jsmntok_t const*
out_anisotropy->anisotropy_strength = cgltf_json_to_float(tokens + i, json_chunk);
++i;
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "anisotropyDirection") == 0)
else if (cgltf_json_strcmp(tokens + i, json_chunk, "anisotropyRotation") == 0)
{
++i;
out_anisotropy->anisotropy_direction = cgltf_json_to_float(tokens + i, json_chunk);
out_anisotropy->anisotropy_rotation = cgltf_json_to_float(tokens + i, json_chunk);
++i;
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "anisotropyTexture") == 0)
Expand Down
2 changes: 1 addition & 1 deletion cgltf_write.h
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ static void cgltf_write_material(cgltf_write_context* context, const cgltf_mater
cgltf_write_line(context, "\"KHR_materials_anisotropy\": {");
const cgltf_anisotropy* params = &material->anisotropy;
cgltf_write_floatprop(context, "anisotropyFactor", params->anisotropy_strength, 0.f);
cgltf_write_floatprop(context, "anisotropyDirection", params->anisotropy_direction, 0.f);
cgltf_write_floatprop(context, "anisotropyRotation", params->anisotropy_rotation, 0.f);
CGLTF_WRITE_TEXTURE_INFO("anisotropyTexture", params->anisotropy_texture);
cgltf_write_line(context, "}");
}
Expand Down

0 comments on commit b5f7808

Please sign in to comment.