diff --git a/CHANGES.md b/CHANGES.md index 244d10d52..f8c921989 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,11 @@ # Change Log +### Not Released Yet + +##### Additions :tada: + +- Added support for `EXT_accessor_additional_types` in `AccessorView`. + ### v0.41.0 - 2024-11-01 ##### Breaking Changes :mega: diff --git a/CesiumGltf/generated/include/CesiumGltf/AccessorSpec.h b/CesiumGltf/generated/include/CesiumGltf/AccessorSpec.h index 4bad735b4..a5cf56bca 100644 --- a/CesiumGltf/generated/include/CesiumGltf/AccessorSpec.h +++ b/CesiumGltf/generated/include/CesiumGltf/AccessorSpec.h @@ -30,9 +30,17 @@ struct CESIUMGLTF_API AccessorSpec : public CesiumGltf::NamedObject { static constexpr int32_t UNSIGNED_SHORT = 5123; + static constexpr int32_t INT = 5124; + static constexpr int32_t UNSIGNED_INT = 5125; + static constexpr int32_t INT64 = 5134; + + static constexpr int32_t UNSIGNED_INT64 = 5135; + static constexpr int32_t FLOAT = 5126; + + static constexpr int32_t DOUBLE = 5130; }; /** diff --git a/CesiumGltf/include/CesiumGltf/AccessorView.h b/CesiumGltf/include/CesiumGltf/AccessorView.h index 3d73bf2e7..49e723d71 100644 --- a/CesiumGltf/include/CesiumGltf/AccessorView.h +++ b/CesiumGltf/include/CesiumGltf/AccessorView.h @@ -449,16 +449,36 @@ createAccessorView( model, accessor, std::forward(callback)); + case Accessor::ComponentType::INT: + return ::CesiumGltf::CesiumImpl::createAccessorView( + model, + accessor, + std::forward(callback)); case Accessor::ComponentType::UNSIGNED_INT: return ::CesiumGltf::CesiumImpl::createAccessorView( model, accessor, std::forward(callback)); + case Accessor::ComponentType::INT64: + return ::CesiumGltf::CesiumImpl::createAccessorView( + model, + accessor, + std::forward(callback)); + case Accessor::ComponentType::UNSIGNED_INT64: + return ::CesiumGltf::CesiumImpl::createAccessorView( + model, + accessor, + std::forward(callback)); case Accessor::ComponentType::FLOAT: return ::CesiumGltf::CesiumImpl::createAccessorView( model, accessor, std::forward(callback)); + case Accessor::ComponentType::DOUBLE: + return ::CesiumGltf::CesiumImpl::createAccessorView( + model, + accessor, + std::forward(callback)); default: return callback(AccessorView>( AccessorViewStatus::InvalidComponentType)); diff --git a/CesiumGltf/src/Accessor.cpp b/CesiumGltf/src/Accessor.cpp index 8c87d616a..075df596c 100644 --- a/CesiumGltf/src/Accessor.cpp +++ b/CesiumGltf/src/Accessor.cpp @@ -39,9 +39,14 @@ Accessor::computeByteSizeOfComponent(int32_t componentType) noexcept { case CesiumGltf::Accessor::ComponentType::SHORT: case CesiumGltf::Accessor::ComponentType::UNSIGNED_SHORT: return 2; + case CesiumGltf::Accessor::ComponentType::INT: case CesiumGltf::Accessor::ComponentType::UNSIGNED_INT: case CesiumGltf::Accessor::ComponentType::FLOAT: return 4; + case CesiumGltf::Accessor::ComponentType::INT64: + case CesiumGltf::Accessor::ComponentType::UNSIGNED_INT64: + case CesiumGltf::Accessor::ComponentType::DOUBLE: + return 8; default: // TODO Print a warning here! return 0;