You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

27 lines
593 B

#pragma once
#include <base/subface.hpp>
namespace internal
{
// local: plane x=0
// u: planar local x-axis
// v: planar local y-axis
struct plane_t final : subface {
};
} // namespace internal
namespace detail
{
template <>
struct hasher<internal::plane_t> {
size_t operator()(const internal::plane_t &subface) const
{
const auto &mat = subface.world_to_local.matrix();
Eigen::Vector4d vec = mat.row(0);
vec.head<3>().normalize();
if (vec.z() < 0) vec.head<3>() = -vec.head<3>();
return hash_funcs(vec);
}
};
} // namespace detail