mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 17:27:52 -06:00
Unproject on mesh in the SLA gizmo is now performed by the MeshRaycaster class
This commit is contained in:
parent
284355d378
commit
b6292247e8
4 changed files with 137 additions and 42 deletions
|
@ -14,6 +14,8 @@ class TriangleMeshSlicer;
|
|||
|
||||
namespace GUI {
|
||||
|
||||
class Camera;
|
||||
|
||||
|
||||
|
||||
class ClippingPlane
|
||||
|
@ -86,6 +88,28 @@ private:
|
|||
};
|
||||
|
||||
|
||||
|
||||
|
||||
class MeshRaycaster {
|
||||
public:
|
||||
MeshRaycaster(const TriangleMesh& mesh);
|
||||
~MeshRaycaster();
|
||||
void set_transformation(const Geometry::Transformation& trafo);
|
||||
void set_camera(const Camera& camera);
|
||||
|
||||
bool unproject_on_mesh(const Vec2d& mouse_pos, const Transform3d& trafo, const Camera& camera,
|
||||
std::vector<Vec3f>* positions = nullptr, std::vector<Vec3f>* normals = nullptr) const;
|
||||
|
||||
private:
|
||||
// PIMPL wrapper around igl::AABB so I don't have to include the header-only IGL here
|
||||
class AABBWrapper;
|
||||
AABBWrapper* m_AABB_wrapper;
|
||||
|
||||
const TriangleMesh* m_mesh = nullptr;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // namespace GUI
|
||||
} // namespace Slic3r
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue