I.e. if I move an object that has a parent to the top level (root of the scene), then the position in the scene of this object (relative to "world") does not change. This is the behavior that I was hoping for.
But if I use the function sim.setObjectParent, then the position in the scene changes: E.g. I run the following code:
Code: Select all
CuboidHandle=sim.getObjectHandle('Cuboid') -- Cuboid has a parent objects, that is not located at (0,0,0)
sim.setObjectParent(CuboidHandle,-1,True) -- This "moves" the object in the scene
I want to use sim.setObjectParent to change a parent, but preserve the absolute position in the scene.
The only solution I came up with is to store the absolute position of the object before changing the parent, then restore the absolute position. Is there a better way?
Thanks.