Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Best strategy to add object with Mass to middle of rope.
#1
Hi All. 

I've got a way to "teleport" an object to my obi Rope. 
But that strategy doesn't effect the behaviour of the Rope. FYI the rope is being dragged behind rigidbody object. 

Ultimately I'd like to add an object to any point. Length float 0-1 on the rope. 
and have the rope behave physically correct. 

If someone can point me in the right direction, where to look  in the documentation. or a code fragment. 
it would be greatly appreciated! 
thanks!

ps. Sorry if this is a repeat of some other post.

Note: Just to be specific, basically I want to throw sticky weights or in my case zombie at a rope and have them stick there, whilst the rope reacts physically correct to the new masses.
Reply
#2
Hi!

If you don't need two-way coupling (the rope both receiving forces from and applying forces to the object), the simplest approach is to use the path smoother's GetSectionAt() method. It takes a float in the 0,1 range as parameter and returns an orthonormal frame in the rope's path, which you can use to place the object.

The included ObiRopeAttach utility script uses this method, you can just place it on an object and it will follow the rope.

Now, if you do need two-way coupling (which would seem the case since you mention "whilst the rope reacts physically correct to the new masses.") and want this to happen as a reaction to a collision against the rope, it's considerably more complex as it involves collision callbacks and runtime constraint creation:

- Detect collisions between the rope and other object. This can be done using collision callbacks: http://obi.virtualmethodstudio.com/manua...sions.html
- Create a new pin constraint at runtime. See: http://obi.virtualmethodstudio.com/manua...aints.html

kind regards,
Reply