Browse Source

fix: refactor translation handling in apply_transform to use Eigen::Translation3d

V2-origin
mckay 1 week ago
parent
commit
03f33d01c4
  1. 5
      primitive_process/src/base/subface.cpp

5
primitive_process/src/base/subface.cpp

@ -31,8 +31,9 @@ std::pair<internal::paired_model_matrix *, bool> subface::apply_transform(intern
temp.world_to_local.linear() = temp.world_to_local.linear() * rotation_matrix.transpose(); temp.world_to_local.linear() = temp.world_to_local.linear() * rotation_matrix.transpose();
} break; } break;
case internal::transform_type::translation: { case internal::transform_type::translation: {
temp.local_to_world.translation() += param.head<3>(); Eigen::Translation3d translation(param.head<3>());
temp.world_to_local.translation() -= param.head<3>(); temp.local_to_world = translation * temp.local_to_world;
temp.world_to_local = temp.world_to_local * translation.inverse();
} break; } break;
default: throw std::invalid_argument("Invalid transform type"); default: throw std::invalid_argument("Invalid transform type");
} }

Loading…
Cancel
Save