(jme3) reposition parent node relative to childrens

the parent node is the fulcrum for the rotation of the children. Now what would be the best method to reposition the parent without moving it’s children? (I attach nodes at runtime, and i’d like to reposition the fulcrum of the rotation).

Should I calculate the relative difference and local translate all the childrens, or detach the parent, move it and reattach? Or there is another, simpler way? I can’t try right now, but maybe lockTransforms?

No, you’ll have to do it like you say. Or arrange your nodes differently maybe?

1 Like

thank you very much, then I’ll write an algorithm calculating the center of mass and then move the children to make the parent the center of mass.

Mass? For physics, the parent-child-relation is not used for the positioning as there are only world coordinates in bullet…

yes yes, sorry, shouldn’t have mentioned mass, was just a thank you and end of transmission post, didn’t want to bother and make you lose time.

For now I’m doing a mock up prototype and not using physics for movement. I have the physics nodes in place, but I’m using them as kinematic, and moving/rotating the parent node by hand. I’ll make a full physics implementation in one of the future iterations, probably when the physics engine has gone bullet native.

The API of the physics wont change so you can start trying around with it already. Just dont use any of the java classes from com.bulletphysics directly (which is really not necessary anyway but still possible).