Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[constraint] makes BarycentricCenterEffector inherit from PositionEffector #42

Merged
merged 10 commits into from
Oct 18, 2024

Conversation

EulalieCoevoet
Copy link
Member

@EulalieCoevoet EulalieCoevoet commented Oct 3, 2024

This PR makes BarycentricCenterEffector inherit from PositionEffector which allows to:

  • standardize the use of the data weight, directions, and useDirections
  • adds the control of the orientation in case of Rigid3

Additionally:

  • updates the example
  • removes a test: it was testing the method initData() which I removed from the component because we use the initialization of PositionEffector now.

I'm not sure about the way I handled the deprecation warnings.

@EulalieCoevoet
Copy link
Member Author

@alxbilger thanks for your review. I think we can merge now 😊


cMatrix.endEdit();
m_nbLines = cIndex - constraintIndex;
template<>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you added this right? I did not think about specialization for rigids when I did my suggestions. Have a look if you could use DataTypes::CPos to try to factorize the function

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well. I've made the changes. The only difference was the normalization of the orientation in the case of a Rigid.

So I've factorized the code by adding a setBarycenter() function which normalize the orientation in the case of a Rigid. It makes sens, even though it hides/disconnects the normalization after the accumulate. But I'm fine with it.

@EulalieCoevoet
Copy link
Member Author

I'm sorry I really need this to be merged.
I think it's good to go but if you want other changes I can make another PR.

@EulalieCoevoet EulalieCoevoet merged commit c2dfb51 into SofaDefrost:main Oct 18, 2024
1 of 4 checks passed
@EulalieCoevoet EulalieCoevoet deleted the pr_barycentriceffector branch October 18, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants