Browse Source

fix: update matrix references in hasher for cylinder and plane to use local_to_world. Hash of plane changed to col 0 and 3

V2-origin
mckay 2 weeks ago
parent
commit
95f6594bb9
  1. 2
      primitive_process/interface/subface/simple/cylinder_face.hpp
  2. 7
      primitive_process/interface/subface/simple/plane.hpp

2
primitive_process/interface/subface/simple/cylinder_face.hpp

@ -34,7 +34,7 @@ template <>
struct hasher<internal::cylinder_paired_model_matrix> {
size_t operator()(const internal::cylinder_paired_model_matrix &block) const
{
Eigen::Matrix<double, 2, 4> character_rows = block.data->world_to_local.matrix().topRows<2>();
Eigen::Matrix<double, 2, 4> character_rows = block.data->local_to_world.matrix().topRows<2>();
return XXH3_64bits(character_rows.data(), sizeof(decltype(character_rows)));
}
};

7
primitive_process/interface/subface/simple/plane.hpp

@ -34,8 +34,11 @@ template <>
struct hasher<internal::plane_paired_model_matrix> {
size_t operator()(const internal::plane_paired_model_matrix &block) const
{
Eigen::Vector4d character_row = block.data->world_to_local.matrix().row(0);
return XXH3_64bits(character_row.data(), sizeof(Eigen::Vector4d));
const auto& mat = block.data->local_to_world.matrix();
Eigen::Matrix<double, 3, 2> character_col;
character_col.col(0) = mat.col(0);
character_col.col(1) = mat.col(3);
return XXH3_64bits(character_col.data(), sizeof(Eigen::Matrix<double, 3, 2>));
}
};

Loading…
Cancel
Save