mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-02-01 08:28:42 +03:00
Merge prusa 2.6.1
This commit is contained in:
@@ -465,14 +465,17 @@ bool MeshRaycaster::unproject_on_mesh(const Vec2d& mouse_pos, const Transform3d&
|
||||
|
||||
|
||||
|
||||
bool MeshRaycaster::is_valid_intersection(Vec3d point, Vec3d direction, const Transform3d& trafo) const
|
||||
bool MeshRaycaster::intersects_line(Vec3d point, Vec3d direction, const Transform3d& trafo) const
|
||||
{
|
||||
point = trafo.inverse() * point;
|
||||
Transform3d trafo_inv = trafo.inverse();
|
||||
Vec3d to = trafo_inv * (point + direction);
|
||||
point = trafo_inv * point;
|
||||
direction = (to-point).normalized();
|
||||
|
||||
std::vector<AABBMesh::hit_result> hits = m_emesh.query_ray_hits(point, direction);
|
||||
std::vector<AABBMesh::hit_result> neg_hits = m_emesh.query_ray_hits(point, -direction);
|
||||
|
||||
return !hits.empty() && !neg_hits.empty();
|
||||
return !hits.empty() || !neg_hits.empty();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user