sofa icon indicating copy to clipboard operation
sofa copied to clipboard

[Core] Allow different gravity vectors in Nodes

Open alxbilger opened this issue 1 year ago • 11 comments


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

alxbilger avatar Aug 01 '24 08:08 alxbilger

[ci-build][with-all-tests]

hugtalbot avatar Aug 01 '24 09:08 hugtalbot

Interesting change @alxbilger The Gravity component is available for this. But your change should make it more straightforward, I will give it a try

hugtalbot avatar Aug 01 '24 09:08 hugtalbot

Tested and approved :+1:

What do you think @alxbilger about setting gravity to "0 0 0" as default value?

hugtalbot avatar Aug 01 '24 20:08 hugtalbot

What do you think @alxbilger about setting gravity to "0 0 0" as default value?

I think it will break a lot of scenes

alxbilger avatar Aug 02 '24 07:08 alxbilger

I also think about creating a graph link instead of a simple copy:

if (!worldGravity_.isSet())
{
    worldGravity_.setParent(&c); ///< Gravity IN THE WORLD COORDINATE SYSTEM.
}

What do you think?

alxbilger avatar Aug 02 '24 07:08 alxbilger

I think it will break a lot of scenes

I like it baby :fire_engine: :fire:

I also think about creating a graph link instead of a simple copy:

:thinking: why would you do that? I am unsure about side effect

hugtalbot avatar Aug 02 '24 13:08 hugtalbot

I also think about creating a graph link instead of a simple copy:

why @alxbilger

hugtalbot avatar Aug 05 '24 13:08 hugtalbot

So that it can update if its parent has changed

alxbilger avatar Aug 05 '24 13:08 alxbilger

To be noted, this change would only work in XML : SimpleAPI or Python do not change the "isSet" property as does the XML. I investigate on this currently

hugtalbot avatar Aug 08 '24 11:08 hugtalbot

If #4911 is solved, then #4910 could replace this PR @alxbilger

hugtalbot avatar Aug 14 '24 08:08 hugtalbot

@hugtalbot, isSet is switched to "true" at first value change (eg: any begin/write edit). Can you explain a bit what kind of behavior should be expected ?

damienmarchal avatar Aug 28 '24 09:08 damienmarchal