2023-11-15 14:20:08 +08:00
|
|
|
#include <CesiumGltfContent/SkirtMeshMetadata.h>
|
2024-12-21 00:56:49 +08:00
|
|
|
#include <CesiumUtility/JsonValue.h>
|
2021-10-12 05:28:44 +08:00
|
|
|
#include <CesiumUtility/Math.h>
|
|
|
|
|
|
2025-01-16 05:58:03 +08:00
|
|
|
#include <doctest/doctest.h>
|
2020-12-23 07:39:56 +08:00
|
|
|
|
2024-12-18 06:27:03 +08:00
|
|
|
#include <optional>
|
|
|
|
|
|
2023-11-15 14:20:08 +08:00
|
|
|
using namespace CesiumGltfContent;
|
2020-12-24 04:57:08 +08:00
|
|
|
using namespace CesiumUtility;
|
|
|
|
|
|
2020-12-23 07:39:56 +08:00
|
|
|
TEST_CASE("Test converting skirt mesh metadata to gltf extras") {
|
2021-03-09 08:37:45 +08:00
|
|
|
SkirtMeshMetadata skirtMeshMetadata;
|
|
|
|
|
skirtMeshMetadata.noSkirtIndicesBegin = 0;
|
|
|
|
|
skirtMeshMetadata.noSkirtIndicesCount = 12;
|
|
|
|
|
skirtMeshMetadata.meshCenter = glm::dvec3(23.4, 12.3, 11.0);
|
|
|
|
|
skirtMeshMetadata.skirtWestHeight = 12.2;
|
|
|
|
|
skirtMeshMetadata.skirtSouthHeight = 0.2;
|
|
|
|
|
skirtMeshMetadata.skirtEastHeight = 24.2;
|
|
|
|
|
skirtMeshMetadata.skirtNorthHeight = 10.0;
|
|
|
|
|
|
|
|
|
|
JsonValue::Object extras =
|
|
|
|
|
SkirtMeshMetadata::createGltfExtras(skirtMeshMetadata);
|
|
|
|
|
REQUIRE(extras.find("skirtMeshMetadata") != extras.end());
|
|
|
|
|
|
|
|
|
|
JsonValue& gltfSkirt = extras["skirtMeshMetadata"];
|
2021-03-10 05:36:39 +08:00
|
|
|
const auto* pNoSkirtRange =
|
|
|
|
|
gltfSkirt.getValuePtrForKey<JsonValue::Array>("noSkirtRange");
|
|
|
|
|
REQUIRE(pNoSkirtRange);
|
|
|
|
|
REQUIRE((*pNoSkirtRange)[0].getSafeNumberOrDefault<double>(-1.0) == 0.0);
|
|
|
|
|
REQUIRE((*pNoSkirtRange)[1].getSafeNumberOrDefault<double>(-1.0) == 12.0);
|
2021-03-09 08:37:45 +08:00
|
|
|
|
2021-03-10 05:36:39 +08:00
|
|
|
const auto* pMeshCenter =
|
|
|
|
|
gltfSkirt.getValuePtrForKey<JsonValue::Array>("meshCenter");
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(Math::equalsEpsilon(
|
2021-03-10 05:36:39 +08:00
|
|
|
(*pMeshCenter)[0].getSafeNumberOrDefault<double>(0.0),
|
2021-03-09 08:37:45 +08:00
|
|
|
skirtMeshMetadata.meshCenter.x,
|
2022-01-25 16:36:10 +08:00
|
|
|
Math::Epsilon7));
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(Math::equalsEpsilon(
|
2021-03-10 05:36:39 +08:00
|
|
|
(*pMeshCenter)[1].getSafeNumberOrDefault<double>(0.0),
|
2021-03-09 08:37:45 +08:00
|
|
|
skirtMeshMetadata.meshCenter.y,
|
2022-01-25 16:36:10 +08:00
|
|
|
Math::Epsilon7));
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(Math::equalsEpsilon(
|
2021-03-10 05:36:39 +08:00
|
|
|
(*pMeshCenter)[2].getSafeNumberOrDefault<double>(0.0),
|
2021-03-09 08:37:45 +08:00
|
|
|
skirtMeshMetadata.meshCenter.z,
|
2022-01-25 16:36:10 +08:00
|
|
|
Math::Epsilon7));
|
2021-03-09 08:37:45 +08:00
|
|
|
|
2024-11-06 12:16:03 +08:00
|
|
|
const std::optional<double> maybeSkirtWestHeight =
|
2021-03-10 05:36:39 +08:00
|
|
|
gltfSkirt.getSafeNumericalValueForKey<double>("skirtWestHeight");
|
2024-11-06 12:16:03 +08:00
|
|
|
REQUIRE(maybeSkirtWestHeight);
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(Math::equalsEpsilon(
|
2024-11-06 12:16:03 +08:00
|
|
|
*maybeSkirtWestHeight,
|
2021-03-09 08:37:45 +08:00
|
|
|
skirtMeshMetadata.skirtWestHeight,
|
2022-01-25 16:36:10 +08:00
|
|
|
Math::Epsilon7));
|
2021-03-09 08:37:45 +08:00
|
|
|
|
2024-11-06 12:16:03 +08:00
|
|
|
const std::optional<double> maybeSkirtSouthHeight =
|
2021-03-10 05:36:39 +08:00
|
|
|
gltfSkirt.getSafeNumericalValueForKey<double>("skirtSouthHeight");
|
2024-11-06 12:16:03 +08:00
|
|
|
REQUIRE(maybeSkirtSouthHeight);
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(Math::equalsEpsilon(
|
2024-11-06 12:16:03 +08:00
|
|
|
*maybeSkirtSouthHeight,
|
2021-03-09 08:37:45 +08:00
|
|
|
skirtMeshMetadata.skirtSouthHeight,
|
2022-01-25 16:36:10 +08:00
|
|
|
Math::Epsilon7));
|
2021-03-09 08:37:45 +08:00
|
|
|
|
2024-11-06 12:16:03 +08:00
|
|
|
const std::optional<double> maybeSkirtEastHeight =
|
2021-03-10 05:36:39 +08:00
|
|
|
gltfSkirt.getSafeNumericalValueForKey<double>("skirtEastHeight");
|
2024-11-06 12:16:03 +08:00
|
|
|
REQUIRE(maybeSkirtEastHeight);
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(Math::equalsEpsilon(
|
2024-11-06 12:16:03 +08:00
|
|
|
*maybeSkirtEastHeight,
|
2021-03-09 08:37:45 +08:00
|
|
|
skirtMeshMetadata.skirtEastHeight,
|
2022-01-25 16:36:10 +08:00
|
|
|
Math::Epsilon7));
|
2021-03-09 08:37:45 +08:00
|
|
|
|
2024-11-06 12:16:03 +08:00
|
|
|
const std::optional<double> maybeSkirtNorthHeight =
|
2021-03-10 05:36:39 +08:00
|
|
|
gltfSkirt.getSafeNumericalValueForKey<double>("skirtNorthHeight");
|
2024-11-06 12:16:03 +08:00
|
|
|
REQUIRE(maybeSkirtNorthHeight);
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(Math::equalsEpsilon(
|
2024-11-06 12:16:03 +08:00
|
|
|
*maybeSkirtNorthHeight,
|
2021-03-09 08:37:45 +08:00
|
|
|
skirtMeshMetadata.skirtNorthHeight,
|
2022-01-25 16:36:10 +08:00
|
|
|
Math::Epsilon7));
|
2020-12-24 04:57:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_CASE("Test converting gltf extras to skirt mesh metadata") {
|
2021-03-09 08:37:45 +08:00
|
|
|
// mock gltf extras for skirt mesh metadata
|
|
|
|
|
JsonValue::Object gltfSkirtMeshMetadata = {
|
2022-02-25 05:44:26 +08:00
|
|
|
{"noSkirtRange", JsonValue::Array{0, 12, 24, 48}},
|
2021-03-09 08:37:45 +08:00
|
|
|
{"meshCenter", JsonValue::Array{1.0, 2.0, 3.0}},
|
|
|
|
|
{"skirtWestHeight", 12.4},
|
|
|
|
|
{"skirtSouthHeight", 10.0},
|
|
|
|
|
{"skirtEastHeight", 2.4},
|
|
|
|
|
{"skirtNorthHeight", 1.4}};
|
|
|
|
|
|
2025-01-16 05:58:03 +08:00
|
|
|
SUBCASE("Gltf Extras has correct format") {
|
2021-03-09 08:37:45 +08:00
|
|
|
JsonValue::Object extras = {{"skirtMeshMetadata", gltfSkirtMeshMetadata}};
|
|
|
|
|
|
|
|
|
|
SkirtMeshMetadata skirtMeshMetadata =
|
|
|
|
|
*SkirtMeshMetadata::parseFromGltfExtras(extras);
|
|
|
|
|
|
|
|
|
|
REQUIRE(skirtMeshMetadata.noSkirtIndicesBegin == 0);
|
|
|
|
|
REQUIRE(skirtMeshMetadata.noSkirtIndicesCount == 12);
|
2022-02-25 05:44:26 +08:00
|
|
|
REQUIRE(skirtMeshMetadata.noSkirtVerticesBegin == 24);
|
|
|
|
|
REQUIRE(skirtMeshMetadata.noSkirtVerticesCount == 48);
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(Math::equalsEpsilon(
|
|
|
|
|
skirtMeshMetadata.meshCenter.x,
|
|
|
|
|
1.0,
|
2022-01-25 16:36:10 +08:00
|
|
|
Math::Epsilon7));
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(Math::equalsEpsilon(
|
|
|
|
|
skirtMeshMetadata.meshCenter.y,
|
|
|
|
|
2.0,
|
2022-01-25 16:36:10 +08:00
|
|
|
Math::Epsilon7));
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(Math::equalsEpsilon(
|
|
|
|
|
skirtMeshMetadata.meshCenter.z,
|
|
|
|
|
3.0,
|
2022-01-25 16:36:10 +08:00
|
|
|
Math::Epsilon7));
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(Math::equalsEpsilon(
|
|
|
|
|
skirtMeshMetadata.skirtWestHeight,
|
|
|
|
|
12.4,
|
2022-01-25 16:36:10 +08:00
|
|
|
Math::Epsilon7));
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(Math::equalsEpsilon(
|
|
|
|
|
skirtMeshMetadata.skirtSouthHeight,
|
|
|
|
|
10.0,
|
2022-01-25 16:36:10 +08:00
|
|
|
Math::Epsilon7));
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(Math::equalsEpsilon(
|
|
|
|
|
skirtMeshMetadata.skirtEastHeight,
|
|
|
|
|
2.4,
|
2022-01-25 16:36:10 +08:00
|
|
|
Math::Epsilon7));
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(Math::equalsEpsilon(
|
|
|
|
|
skirtMeshMetadata.skirtNorthHeight,
|
|
|
|
|
1.4,
|
2022-01-25 16:36:10 +08:00
|
|
|
Math::Epsilon7));
|
2021-03-09 08:37:45 +08:00
|
|
|
}
|
|
|
|
|
|
2025-01-16 05:58:03 +08:00
|
|
|
SUBCASE("Gltf Extras has incorrect noSkirtRange field") {
|
|
|
|
|
SUBCASE("missing noSkirtRange field") {
|
2021-03-09 08:37:45 +08:00
|
|
|
gltfSkirtMeshMetadata.erase("noSkirtRange");
|
|
|
|
|
|
|
|
|
|
JsonValue::Object extras = {{"skirtMeshMetadata", gltfSkirtMeshMetadata}};
|
|
|
|
|
|
|
|
|
|
REQUIRE(SkirtMeshMetadata::parseFromGltfExtras(extras) == std::nullopt);
|
2020-12-24 05:11:10 +08:00
|
|
|
}
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2025-01-16 05:58:03 +08:00
|
|
|
SUBCASE("noSkirtRange field has wrong type") {
|
2021-03-09 08:37:45 +08:00
|
|
|
gltfSkirtMeshMetadata["noSkirtRange"] = 12;
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
JsonValue::Object extras = {{"skirtMeshMetadata", gltfSkirtMeshMetadata}};
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(SkirtMeshMetadata::parseFromGltfExtras(extras) == std::nullopt);
|
|
|
|
|
}
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2025-01-16 05:58:03 +08:00
|
|
|
SUBCASE("noSkirtRange field has only one element array") {
|
2021-03-09 08:37:45 +08:00
|
|
|
gltfSkirtMeshMetadata["noSkirtRange"] = JsonValue::Array{0};
|
2021-01-14 20:46:26 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
JsonValue::Object extras = {{"skirtMeshMetadata", gltfSkirtMeshMetadata}};
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(SkirtMeshMetadata::parseFromGltfExtras(extras) == std::nullopt);
|
|
|
|
|
}
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2025-01-16 05:58:03 +08:00
|
|
|
SUBCASE("noSkirtRange field has two elements array but not integer") {
|
2021-03-09 08:37:45 +08:00
|
|
|
gltfSkirtMeshMetadata["noSkirtRange"] =
|
|
|
|
|
JsonValue::Array{"first", "second"};
|
2021-01-14 20:46:26 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
JsonValue::Object extras = {{"skirtMeshMetadata", gltfSkirtMeshMetadata}};
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(SkirtMeshMetadata::parseFromGltfExtras(extras) == std::nullopt);
|
2020-12-24 05:11:10 +08:00
|
|
|
}
|
2021-03-09 08:37:45 +08:00
|
|
|
}
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2025-01-16 05:58:03 +08:00
|
|
|
SUBCASE("Gltf Extras has incorrect meshCenter field") {
|
|
|
|
|
SUBCASE("missing meshCenter field") {
|
2021-03-09 08:37:45 +08:00
|
|
|
gltfSkirtMeshMetadata.erase("meshCenter");
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
JsonValue::Object extras = {{"skirtMeshMetadata", gltfSkirtMeshMetadata}};
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(SkirtMeshMetadata::parseFromGltfExtras(extras) == std::nullopt);
|
|
|
|
|
}
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2025-01-16 05:58:03 +08:00
|
|
|
SUBCASE("meshCenter field has wrong type") {
|
2021-03-09 08:37:45 +08:00
|
|
|
gltfSkirtMeshMetadata["meshCenter"] = 12;
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
JsonValue::Object extras = {{"skirtMeshMetadata", gltfSkirtMeshMetadata}};
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(SkirtMeshMetadata::parseFromGltfExtras(extras) == std::nullopt);
|
|
|
|
|
}
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2025-01-16 05:58:03 +08:00
|
|
|
SUBCASE("meshCenter field is 2 elements array") {
|
2021-03-09 08:37:45 +08:00
|
|
|
gltfSkirtMeshMetadata["meshCenter"] = JsonValue::Array{1.0, 2.0};
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
JsonValue::Object extras = {{"skirtMeshMetadata", gltfSkirtMeshMetadata}};
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(SkirtMeshMetadata::parseFromGltfExtras(extras) == std::nullopt);
|
|
|
|
|
}
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2025-01-16 05:58:03 +08:00
|
|
|
SUBCASE("meshCenter field is 3 elements array but wrong type") {
|
2021-03-09 08:37:45 +08:00
|
|
|
gltfSkirtMeshMetadata["meshCenter"] = JsonValue::Array{1.0, 2.0, "third"};
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
JsonValue::Object extras = {{"skirtMeshMetadata", gltfSkirtMeshMetadata}};
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(SkirtMeshMetadata::parseFromGltfExtras(extras) == std::nullopt);
|
2020-12-24 05:11:10 +08:00
|
|
|
}
|
2021-03-09 08:37:45 +08:00
|
|
|
}
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2025-01-16 05:58:03 +08:00
|
|
|
SUBCASE("Gltf Extras has incorrect skirtWestHeight field") {
|
|
|
|
|
SUBCASE("missing skirtWestHeight field") {
|
2021-03-09 08:37:45 +08:00
|
|
|
gltfSkirtMeshMetadata.erase("skirtWestHeight");
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
JsonValue::Object extras = {{"skirtMeshMetadata", gltfSkirtMeshMetadata}};
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(SkirtMeshMetadata::parseFromGltfExtras(extras) == std::nullopt);
|
|
|
|
|
}
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2025-01-16 05:58:03 +08:00
|
|
|
SUBCASE("skirtWestHeight field has wrong type") {
|
2021-03-09 08:37:45 +08:00
|
|
|
gltfSkirtMeshMetadata["skirtWestHeight"] = "string";
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
JsonValue::Object extras = {{"skirtMeshMetadata", gltfSkirtMeshMetadata}};
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(SkirtMeshMetadata::parseFromGltfExtras(extras) == std::nullopt);
|
2020-12-24 05:11:10 +08:00
|
|
|
}
|
2021-03-09 08:37:45 +08:00
|
|
|
}
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2025-01-16 05:58:03 +08:00
|
|
|
SUBCASE("Gltf Extras has incorrect skirtSouthHeight field") {
|
|
|
|
|
SUBCASE("missing skirtSouthHeight field") {
|
2021-03-09 08:37:45 +08:00
|
|
|
gltfSkirtMeshMetadata.erase("skirtSouthHeight");
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
JsonValue::Object extras = {{"skirtMeshMetadata", gltfSkirtMeshMetadata}};
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(SkirtMeshMetadata::parseFromGltfExtras(extras) == std::nullopt);
|
|
|
|
|
}
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2025-01-16 05:58:03 +08:00
|
|
|
SUBCASE("skirtSouthHeight field has wrong type") {
|
2021-03-09 08:37:45 +08:00
|
|
|
gltfSkirtMeshMetadata["skirtSouthHeight"] = "string";
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
JsonValue::Object extras = {{"skirtMeshMetadata", gltfSkirtMeshMetadata}};
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(SkirtMeshMetadata::parseFromGltfExtras(extras) == std::nullopt);
|
2020-12-24 05:11:10 +08:00
|
|
|
}
|
2021-03-09 08:37:45 +08:00
|
|
|
}
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2025-01-16 05:58:03 +08:00
|
|
|
SUBCASE("Gltf Extras has incorrect skirtEastHeight field") {
|
|
|
|
|
SUBCASE("missing skirtEastHeight field") {
|
2021-03-09 08:37:45 +08:00
|
|
|
gltfSkirtMeshMetadata.erase("skirtEastHeight");
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
JsonValue::Object extras = {{"skirtMeshMetadata", gltfSkirtMeshMetadata}};
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(SkirtMeshMetadata::parseFromGltfExtras(extras) == std::nullopt);
|
|
|
|
|
}
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2025-01-16 05:58:03 +08:00
|
|
|
SUBCASE("skirtEastHeight field has wrong type") {
|
2021-03-09 08:37:45 +08:00
|
|
|
gltfSkirtMeshMetadata["skirtEastHeight"] = "string";
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
JsonValue::Object extras = {{"skirtMeshMetadata", gltfSkirtMeshMetadata}};
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(SkirtMeshMetadata::parseFromGltfExtras(extras) == std::nullopt);
|
2020-12-24 05:11:10 +08:00
|
|
|
}
|
2021-03-09 08:37:45 +08:00
|
|
|
}
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2025-01-16 05:58:03 +08:00
|
|
|
SUBCASE("Gltf Extras has incorrect skirtNorthHeight field") {
|
|
|
|
|
SUBCASE("missing skirtNorthHeight field") {
|
2021-03-09 08:37:45 +08:00
|
|
|
gltfSkirtMeshMetadata.erase("skirtNorthHeight");
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
JsonValue::Object extras = {{"skirtMeshMetadata", gltfSkirtMeshMetadata}};
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(SkirtMeshMetadata::parseFromGltfExtras(extras) == std::nullopt);
|
|
|
|
|
}
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2025-01-16 05:58:03 +08:00
|
|
|
SUBCASE("skirtNorthHeight field has wrong type") {
|
2021-03-09 08:37:45 +08:00
|
|
|
gltfSkirtMeshMetadata["skirtNorthHeight"] = "string";
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
JsonValue::Object extras = {{"skirtMeshMetadata", gltfSkirtMeshMetadata}};
|
2020-12-24 04:57:08 +08:00
|
|
|
|
2021-03-09 08:37:45 +08:00
|
|
|
REQUIRE(SkirtMeshMetadata::parseFromGltfExtras(extras) == std::nullopt);
|
2020-12-24 05:11:10 +08:00
|
|
|
}
|
2021-03-09 08:37:45 +08:00
|
|
|
}
|
2020-12-23 07:39:56 +08:00
|
|
|
}
|