From ae6ff07998a7f324e57b8efc0487b9e1ef4ff57d Mon Sep 17 00:00:00 2001 From: Paul Baksic <30337881+bakpaul@users.noreply.github.com> Date: Fri, 12 Apr 2024 09:31:34 +0200 Subject: [PATCH] Update Sofa/GUI/Component/src/sofa/gui/component/performer/BaseAttachBodyPerformer.inl Co-authored-by: Hugo --- .../sofa/gui/component/performer/BaseAttachBodyPerformer.inl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sofa/GUI/Component/src/sofa/gui/component/performer/BaseAttachBodyPerformer.inl b/Sofa/GUI/Component/src/sofa/gui/component/performer/BaseAttachBodyPerformer.inl index 3fe9ef74c46c..6527bdd96f34 100644 --- a/Sofa/GUI/Component/src/sofa/gui/component/performer/BaseAttachBodyPerformer.inl +++ b/Sofa/GUI/Component/src/sofa/gui/component/performer/BaseAttachBodyPerformer.inl @@ -59,12 +59,15 @@ void BaseAttachBodyPerformer::start() double distanceFromMouse=picked.rayLength; this->m_interactor->setDistanceFromMouse(distanceFromMouse); + sofa::component::collision::geometry::Ray ray = this->m_interactor->getMouseRayModel()->getRay(0); ray.setOrigin(ray.origin() + ray.direction()*distanceFromMouse); + sofa::core::BaseMapping *mapping; this->m_interactor->getContext()->get(mapping); assert(mapping); mapping->apply(core::mechanicalparams::defaultInstance()); mapping->applyJ(core::mechanicalparams::defaultInstance()); + m_interactionObject->init(); this->m_interactor->setMouseAttached(true); }