From b9f662ef47a6a3af2961e96f2d131bb828aef680 Mon Sep 17 00:00:00 2001 From: n0F4x Date: Sat, 17 Aug 2024 00:35:10 +0200 Subject: [PATCH] Allow `iterateSceneNodes` to take AssetType as const ref --- include/fastgltf/tools.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/fastgltf/tools.hpp b/include/fastgltf/tools.hpp index 6118a5066..8dce74243 100644 --- a/include/fastgltf/tools.hpp +++ b/include/fastgltf/tools.hpp @@ -898,11 +898,12 @@ FASTGLTF_EXPORT inline auto getTransformMatrix(const Node& node, const math::fma * Iterates over every node within a scene recursively, computing the world space transform of each node, * and calling the callback function with that node and the transform. */ -FASTGLTF_EXPORT template +FASTGLTF_EXPORT template #if FASTGLTF_HAS_CONCEPTS -requires std::is_invocable_v +requires std::same_as, Asset> + && std::is_invocable_v #endif -void iterateSceneNodes(fastgltf::Asset& asset, std::size_t sceneIndex, math::fmat4x4 initial, Callback callback) { +void iterateSceneNodes(AssetType&& asset, std::size_t sceneIndex, math::fmat4x4 initial, Callback callback) { auto& scene = asset.scenes[sceneIndex]; auto function = [&](std::size_t nodeIndex, math::fmat4x4 nodeMatrix, auto& self) -> void {