mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-13 21:06:02 +08:00
parse additional light properties and fix defaults
This commit is contained in:
parent
b7ca7c9381
commit
b2d7d88dbc
@ -817,7 +817,7 @@ struct SpotLight {
|
||||
double innerConeAngle;
|
||||
double outerConeAngle;
|
||||
|
||||
SpotLight() : innerConeAngle(0.0), outerConeAngle(0.0) { }
|
||||
SpotLight() : innerConeAngle(0.0), outerConeAngle(0.7853981634) { }
|
||||
|
||||
bool operator==(const SpotLight &) const;
|
||||
|
||||
@ -833,7 +833,7 @@ struct Light {
|
||||
double range;
|
||||
SpotLight spot;
|
||||
|
||||
Light() : intensity(0.0), range(0.0) {}
|
||||
Light() : intensity(1.0), range(0.0) {}
|
||||
|
||||
bool operator==(const Light &) const;
|
||||
|
||||
@ -3853,7 +3853,9 @@ static bool ParseLight(Light *light, std::string *err, const json &o) {
|
||||
|
||||
ParseStringProperty(&light->name, err, o, "name", false);
|
||||
ParseNumberArrayProperty(&light->color, err, o, "color", false);
|
||||
ParseStringProperty(&light->type, err, o, "type", false);
|
||||
ParseStringProperty(&light->type, err, o, "type", true);
|
||||
ParseNumberProperty(&light->range, err, o, "range", false);
|
||||
ParseNumberProperty(&light->intensity, err, o, "intensity", false);
|
||||
ParseExtensionsProperty(&light->extensions, err, o);
|
||||
ParseExtrasProperty(&(light->extras), o);
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user