diff --git a/primitive_process/interface/subface/simple/cylinder_face.hpp b/primitive_process/interface/subface/simple/cylinder_face.hpp index db04f78..5d86b1f 100644 --- a/primitive_process/interface/subface/simple/cylinder_face.hpp +++ b/primitive_process/interface/subface/simple/cylinder_face.hpp @@ -34,8 +34,20 @@ template <> struct hasher { size_t operator()(const internal::cylinder_paired_model_matrix &block) const { - Eigen::Matrix character_rows = block.data->local_to_world.matrix().topRows<2>(); - return XXH3_64bits(character_rows.data(), sizeof(decltype(character_rows))); + const auto& mat = block.data->local_to_world.matrix(); // 3x4 + Eigen::Matrix3d A = mat.block<3,3>(0,0); + Eigen::Vector3d b = mat.col(3); + + Eigen::Matrix3d B = A.inverse(); + Eigen::Matrix R = B.topRows<2>(); + + Eigen::Matrix3d G = R.transpose() * R; + Eigen::Vector2d zero_proj = R * b; + + size_t h = XXH3_64bits(G.data(), sizeof(Eigen::Matrix3d)); + h ^= XXH3_64bits(zero_proj.data(), sizeof(Eigen::Vector2d)); + + return h; } };