Merge branch 'master' into issue_3678

pull/3694/head
Kim Kulling 2021-03-10 19:51:04 +01:00 committed by GitHub
commit 806b12dc8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 9 deletions

View File

@ -110,19 +110,18 @@ namespace glTF2 {
if (a.bufferView) { if (a.bufferView) {
obj.AddMember("bufferView", a.bufferView->index, w.mAl); obj.AddMember("bufferView", a.bufferView->index, w.mAl);
obj.AddMember("byteOffset", (unsigned int)a.byteOffset, w.mAl); obj.AddMember("byteOffset", (unsigned int)a.byteOffset, w.mAl);
Value vTmpMax, vTmpMin;
if (a.componentType == ComponentType_FLOAT) {
obj.AddMember("max", MakeValue(vTmpMax, a.max, w.mAl), w.mAl);
obj.AddMember("min", MakeValue(vTmpMin, a.min, w.mAl), w.mAl);
} else {
obj.AddMember("max", MakeValueCast<int64_t>(vTmpMax, a.max, w.mAl), w.mAl);
obj.AddMember("min", MakeValueCast<int64_t>(vTmpMin, a.min, w.mAl), w.mAl);
}
} }
obj.AddMember("componentType", int(a.componentType), w.mAl); obj.AddMember("componentType", int(a.componentType), w.mAl);
obj.AddMember("count", (unsigned int)a.count, w.mAl); obj.AddMember("count", (unsigned int)a.count, w.mAl);
obj.AddMember("type", StringRef(AttribType::ToString(a.type)), w.mAl); obj.AddMember("type", StringRef(AttribType::ToString(a.type)), w.mAl);
Value vTmpMax, vTmpMin;
if (a.componentType == ComponentType_FLOAT) {
obj.AddMember("max", MakeValue(vTmpMax, a.max, w.mAl), w.mAl);
obj.AddMember("min", MakeValue(vTmpMin, a.min, w.mAl), w.mAl);
} else {
obj.AddMember("max", MakeValueCast<int64_t>(vTmpMax, a.max, w.mAl), w.mAl);
obj.AddMember("min", MakeValueCast<int64_t>(vTmpMin, a.min, w.mAl), w.mAl);
}
if (a.sparse) { if (a.sparse) {
Value sparseValue; Value sparseValue;

View File

@ -52,6 +52,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/types.h> #include <assimp/types.h>
#ifdef __cplusplus
extern "C" {
#endif
/** Mixed set of flags for #aiImporterDesc, indicating some features /** Mixed set of flags for #aiImporterDesc, indicating some features
* common to many importers*/ * common to many importers*/
enum aiImporterFlags { enum aiImporterFlags {
@ -143,4 +147,8 @@ Will return a nullptr if no assigned importer desc. was found for the given exte
*/ */
ASSIMP_API const C_STRUCT aiImporterDesc *aiGetImporterDesc(const char *extension); ASSIMP_API const C_STRUCT aiImporterDesc *aiGetImporterDesc(const char *extension);
#ifdef __cplusplus
} // end of extern "C"
#endif
#endif // AI_IMPORTER_DESC_H_INC #endif // AI_IMPORTER_DESC_H_INC