Support quaternions in gltf::accessor_iterator

This commit is contained in:
Nikita Lisitsa 2024-05-28 12:36:03 +03:00
parent b04456066b
commit b5117ca8b2

View file

@ -61,6 +61,19 @@ namespace psemek::gfx
}
};
template <typename T>
struct accessor_traits<geom::quaternion<T>>
{
static constexpr bool is_floating_point = accessor_traits<T>::is_floating_point;
static constexpr std::size_t components = 4;
using component_type = T;
static auto pointer(geom::quaternion<T> & value)
{
return &value[0];
}
};
template <typename T>
void safe_cast(gltf_asset::accessor::component_type_t type, bool normalized, T & dst, char const * src)
{