Ported the obj parser.

This commit is contained in:
zy4n
2025-04-01 21:51:56 +02:00
parent bc065bc657
commit 27977c1738
34 changed files with 1676 additions and 1554 deletions

View File

@@ -0,0 +1,24 @@
#pragma once
#include "glm/glm.hpp"
#include <memory>
// Hash function for Eigen matrix and vector.
// The code is from `hash_combine` function of the Boost library. See
// http://www.boost.org/doc/libs/1_55_0/doc/html/hash/reference.html#boost.hash_combine .
template<glm::length_t L, typename T, glm::qualifier Q>
struct std::hash<glm::vec<L, T, Q>>
{
auto operator() (const glm::vec<L, T, Q>& key) const
{
auto seed = std::size_t{};
for (glm::length_t i{}; i != L; ++i)
{
seed ^= std::hash<T>{}(key[i]) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
}
return seed;
}
};