FIX:Do not create a new MeshRaycaster repeatedly
jira: STUDIO-10905 Change-Id: I0a666ab7f9167c1bbd60f4cd6a5d0c78c9143275
This commit is contained in:
parent
193caabdc7
commit
51b5777b60
|
@ -87,8 +87,7 @@ bool GLGizmoMeshBoolean::gizmo_event(SLAGizmoEventType action, const Vec2d& mous
|
|||
|
||||
// Cast a ray on all meshes, pick the closest hit and save it for the respective mesh
|
||||
for (int mesh_id = 0; mesh_id < int(trafo_matrices.size()); ++mesh_id) {
|
||||
MeshRaycaster mesh_raycaster = MeshRaycaster(mo->volumes[mesh_id]->mesh());
|
||||
if (mesh_raycaster.unproject_on_mesh(mouse_position, trafo_matrices[mesh_id], camera, hit, normal,
|
||||
if (m_c->raycaster()->raycasters()[mesh_id] ->unproject_on_mesh(mouse_position, trafo_matrices[mesh_id], camera, hit, normal,
|
||||
m_c->object_clipper()->get_clipping_plane(), &facet)) {
|
||||
// Is this hit the closest to the camera so far?
|
||||
double hit_squared_distance = (camera.get_position() - trafo_matrices[mesh_id] * hit.cast<double>()).squaredNorm();
|
||||
|
|
Loading…
Reference in New Issue