mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-07-14 19:41:47 +08:00
Initialize light
and emitter
members. Fixes #431
Include `light` and `emitter` comparison in Node::operator==()
This commit is contained in:
parent
e12e0a9392
commit
7a570c88d9
14
tiny_gltf.h
14
tiny_gltf.h
@ -1039,19 +1039,19 @@ struct Mesh {
|
|||||||
|
|
||||||
class Node {
|
class Node {
|
||||||
public:
|
public:
|
||||||
Node() : camera(-1), skin(-1), mesh(-1) {}
|
Node() : camera(-1), skin(-1), mesh(-1), light(-1), emitter(-1) {}
|
||||||
|
|
||||||
DEFAULT_METHODS(Node)
|
DEFAULT_METHODS(Node)
|
||||||
|
|
||||||
bool operator==(const Node &) const;
|
bool operator==(const Node &) const;
|
||||||
|
|
||||||
int camera; // the index of the camera referenced by this node
|
int camera{-1}; // the index of the camera referenced by this node
|
||||||
|
|
||||||
std::string name;
|
std::string name;
|
||||||
int skin;
|
int skin{-1};
|
||||||
int mesh;
|
int mesh{-1};
|
||||||
int light; // light source index (KHR_lights_punctual)
|
int light{-1}; // light source index (KHR_lights_punctual)
|
||||||
int emitter; // audio emitter index (KHR_audio)
|
int emitter{-1}; // audio emitter index (KHR_audio)
|
||||||
std::vector<int> children;
|
std::vector<int> children;
|
||||||
std::vector<double> rotation; // length must be 0 or 4
|
std::vector<double> rotation; // length must be 0 or 4
|
||||||
std::vector<double> scale; // length must be 0 or 3
|
std::vector<double> scale; // length must be 0 or 3
|
||||||
@ -2089,6 +2089,8 @@ bool Node::operator==(const Node &other) const {
|
|||||||
return this->camera == other.camera && this->children == other.children &&
|
return this->camera == other.camera && this->children == other.children &&
|
||||||
this->extensions == other.extensions && this->extras == other.extras &&
|
this->extensions == other.extensions && this->extras == other.extras &&
|
||||||
Equals(this->matrix, other.matrix) && this->mesh == other.mesh &&
|
Equals(this->matrix, other.matrix) && this->mesh == other.mesh &&
|
||||||
|
(this->light == other.light) &&
|
||||||
|
(this->emitter == other.emitter) &&
|
||||||
this->name == other.name && Equals(this->rotation, other.rotation) &&
|
this->name == other.name && Equals(this->rotation, other.rotation) &&
|
||||||
Equals(this->scale, other.scale) && this->skin == other.skin &&
|
Equals(this->scale, other.scale) && this->skin == other.skin &&
|
||||||
Equals(this->translation, other.translation) &&
|
Equals(this->translation, other.translation) &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user