26-09-2025, 04:12 PM
I would like to constrain rod by another one and align them to each other.
The way how I want this to work could be compared to putting one rod into another one, like into pipe.
I managed to write some script that maps particles from first rod to target position on another second rod (based on displacement), but this method fails to create stable alignment.
That script uses end of simulation to run constraint for both rods on each other. Position is casted and delta is based on nearest particle weights, but I guess because I don't mix orientations it fails to keep shape properly or it's caused by the fact it runs after simulation, but I hope I am wrong. Current result is some kind of broke, because outside of constraint particles "break" into their prefered direction, it's more like teleportation of common part, than physical constraint.
My question is - what things I need to take into account to make it work (even if not perfect), and is it actually possible at all without modification of Obi itself?
I also tried to pin particles of inner rod by setting invMass to 0, it kind of works better, but the problem is that it's one sided and first rod does not influence second one.
I wish there was way to kind of "blend" shapes of both rods into each other and make forces to work properly.
The way how I want this to work could be compared to putting one rod into another one, like into pipe.
I managed to write some script that maps particles from first rod to target position on another second rod (based on displacement), but this method fails to create stable alignment.
That script uses end of simulation to run constraint for both rods on each other. Position is casted and delta is based on nearest particle weights, but I guess because I don't mix orientations it fails to keep shape properly or it's caused by the fact it runs after simulation, but I hope I am wrong. Current result is some kind of broke, because outside of constraint particles "break" into their prefered direction, it's more like teleportation of common part, than physical constraint.
My question is - what things I need to take into account to make it work (even if not perfect), and is it actually possible at all without modification of Obi itself?
I also tried to pin particles of inner rod by setting invMass to 0, it kind of works better, but the problem is that it's one sided and first rod does not influence second one.
I wish there was way to kind of "blend" shapes of both rods into each other and make forces to work properly.