Skip to content

Commit

Permalink
Update Sofa/GUI/Component/src/sofa/gui/component/performer/BaseAttach…
Browse files Browse the repository at this point in the history
…BodyPerformer.inl

Co-authored-by: Hugo <[email protected]>
  • Loading branch information
bakpaul and hugtalbot authored Apr 12, 2024
1 parent 6d8f35f commit ae6ff07
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,15 @@ void BaseAttachBodyPerformer<DataTypes>::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);
}
Expand Down

0 comments on commit ae6ff07

Please sign in to comment.