Support quaternion attribs

This commit is contained in:
Nikita Lisitsa 2021-03-13 14:30:22 +03:00
parent 9baa91b7e3
commit 05cffcdc73

View file

@ -5,6 +5,7 @@
#include <psemek/geom/vector.hpp> #include <psemek/geom/vector.hpp>
#include <psemek/geom/point.hpp> #include <psemek/geom/point.hpp>
#include <psemek/geom/matrix.hpp> #include <psemek/geom/matrix.hpp>
#include <psemek/geom/quaternion.hpp>
#include <vector> #include <vector>
#include <optional> #include <optional>
@ -202,6 +203,16 @@ namespace psemek::gfx
using attrib_type = geom::matrix<T, R, C>; using attrib_type = geom::matrix<T, R, C>;
}; };
template <typename T>
struct attrib_traits<geom::quaternion<T>>
{
using attrib_type = geom::quaternion<T>;
static constexpr GLint size = 4;
static constexpr GLenum type = attrib_traits<T>::type;
static constexpr GLboolean normalized = gl::FALSE;
};
template <typename T> template <typename T>
struct attrib_traits<normalized<T>> struct attrib_traits<normalized<T>>
{ {