Added suggested changes and fixed automated check errors
parent
f20071d740
commit
abfe8ad413
|
@ -383,32 +383,7 @@ struct Extras {
|
||||||
std::vector<CustomExtension> mValues;
|
std::vector<CustomExtension> mValues;
|
||||||
|
|
||||||
inline bool HasExtras() const {
|
inline bool HasExtras() const {
|
||||||
return mValues.size() != 0;
|
return !mValues.empty();
|
||||||
}
|
|
||||||
|
|
||||||
Extras() = default;
|
|
||||||
~Extras() = default;
|
|
||||||
|
|
||||||
Extras(const Extras &other) :
|
|
||||||
mValues(other.mValues) {
|
|
||||||
// empty
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//! Represents metadata in an glTF2 object
|
|
||||||
struct Extras {
|
|
||||||
std::vector<CustomExtension> mValues;
|
|
||||||
|
|
||||||
inline bool HasExtras() const {
|
|
||||||
return mValues.size() != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Extras() = default;
|
|
||||||
~Extras() = default;
|
|
||||||
|
|
||||||
Extras(const Extras &other) :
|
|
||||||
mValues(other.mValues) {
|
|
||||||
// empty
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -145,7 +145,7 @@ inline Extras ReadExtras(Value &obj) {
|
||||||
ret.mValues.reserve(obj.MemberCount());
|
ret.mValues.reserve(obj.MemberCount());
|
||||||
for (auto it = obj.MemberBegin(); it != obj.MemberEnd(); ++it) {
|
for (auto it = obj.MemberBegin(); it != obj.MemberEnd(); ++it) {
|
||||||
auto &val = it->value;
|
auto &val = it->value;
|
||||||
ret.mValues.push_back(ReadExtensions(it->name.GetString(), val));
|
ret.mValues.emplace_back(ReadExtensions(it->name.GetString(), val));
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -461,6 +461,10 @@ inline void ExportNodeExtras(const aiMetadataEntry &metadataEntry, aiString name
|
||||||
value.mUint64Value.value = *static_cast<uint64_t *>(metadataEntry.mData);
|
value.mUint64Value.value = *static_cast<uint64_t *>(metadataEntry.mData);
|
||||||
value.mUint64Value.isPresent = true;
|
value.mUint64Value.isPresent = true;
|
||||||
break;
|
break;
|
||||||
|
case AI_FLOAT:
|
||||||
|
value.mDoubleValue.value = *static_cast<float *>(metadataEntry.mData);
|
||||||
|
value.mDoubleValue.isPresent = true;
|
||||||
|
break;
|
||||||
case AI_DOUBLE:
|
case AI_DOUBLE:
|
||||||
value.mDoubleValue.value = *static_cast<double *>(metadataEntry.mData);
|
value.mDoubleValue.value = *static_cast<double *>(metadataEntry.mData);
|
||||||
value.mDoubleValue.isPresent = true;
|
value.mDoubleValue.isPresent = true;
|
||||||
|
@ -469,7 +473,7 @@ inline void ExportNodeExtras(const aiMetadataEntry &metadataEntry, aiString name
|
||||||
value.mStringValue.value = static_cast<aiString *>(metadataEntry.mData)->C_Str();
|
value.mStringValue.value = static_cast<aiString *>(metadataEntry.mData)->C_Str();
|
||||||
value.mStringValue.isPresent = true;
|
value.mStringValue.isPresent = true;
|
||||||
break;
|
break;
|
||||||
case AI_AIMETADATA:
|
case AI_AIMETADATA: {
|
||||||
const aiMetadata *subMetadata = static_cast<aiMetadata *>(metadataEntry.mData);
|
const aiMetadata *subMetadata = static_cast<aiMetadata *>(metadataEntry.mData);
|
||||||
value.mValues.value.resize(subMetadata->mNumProperties);
|
value.mValues.value.resize(subMetadata->mNumProperties);
|
||||||
value.mValues.isPresent = true;
|
value.mValues.isPresent = true;
|
||||||
|
@ -479,6 +483,10 @@ inline void ExportNodeExtras(const aiMetadataEntry &metadataEntry, aiString name
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
// AI_AIVECTOR3D not handled
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void ExportNodeExtras(const aiMetadata *metadata, Extras &extras) {
|
inline void ExportNodeExtras(const aiMetadata *metadata, Extras &extras) {
|
||||||
|
|
Loading…
Reference in New Issue