Compare commits

..

1 Commits

Author SHA1 Message Date
Syoyo Fujita
4b5fc0cb31 minijson experiment. 2025-01-22 22:26:02 +09:00
5 changed files with 3192 additions and 19 deletions

View File

@@ -1,6 +1,7 @@
//
// TODO(syoyo): Print extensions and extras for each glTF object.
//
#include <iostream>
#define TINYGLTF_IMPLEMENTATION
#define STB_IMAGE_IMPLEMENTATION
#define STB_IMAGE_WRITE_IMPLEMENTATION

3186
minijson.h Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -1182,21 +1182,3 @@ TEST_CASE("images-as-is", "[issue-487]") {
}
}
}
TEST_CASE("inverse-bind-matrices-optional", "[issue-492]") {
tinygltf::Model model;
tinygltf::TinyGLTF ctx;
std::string err;
std::string warn;
bool ret = ctx.LoadBinaryFromFile(&model, &err, &warn, "issue-492.glb");
if (!warn.empty()) {
std::cout << "WARN:" << warn << std::endl;
}
if (!err.empty()) {
std::cerr << "ERR:" << err << std::endl;
}
REQUIRE(true == ret);
REQUIRE(err.empty());
}

View File

@@ -1721,6 +1721,9 @@ class TinyGLTF {
#endif // __GNUC__
#ifndef TINYGLTF_NO_INCLUDE_JSON
#ifdef TINYGLTF_USE_MINIJSON
#include "minijson.h"
#else // !TINYGLTF_USE_MINIJSON
#ifndef TINYGLTF_USE_RAPIDJSON
#include "json.hpp"
#else
@@ -1732,6 +1735,7 @@ class TinyGLTF {
#include "writer.h"
#endif
#endif
#endif // !TINYGLTF_USE_MINIJSON
#endif
#ifdef TINYGLTF_ENABLE_DRACO
@@ -5660,7 +5664,7 @@ static bool ParseSkin(Skin *skin, std::string *err, const detail::json &o,
skin->skeleton = skeleton;
int invBind = -1;
ParseIntegerProperty(&invBind, err, o, "inverseBindMatrices", false, "Skin");
ParseIntegerProperty(&invBind, err, o, "inverseBindMatrices", true, "Skin");
skin->inverseBindMatrices = invBind;
ParseExtrasAndExtensions(skin, err, o,