Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Check if rope is wrapping or unwrapping?
#1
Is there any way to check if a rope is currently wrapping or unwrapping around a wrappable object? What about checking how many times the rope has wrapped around that object?
Reply
#2
(23-02-2021, 03:40 AM)Navvv Wrote: Is there any way to check if a rope is currently wrapping or unwrapping around a wrappable object? What about checking how many times the rope has wrapped around that object?

There's no built-in way to do that. The definition of "wrapped" can change a lot depending on the game. Is it 2D or 3D? what conditions should the rope meet to consider it's wrapped? should the rope touch itself to determine if it's wrapped? should all particles between two points be in contact with the object? etc.

You can implement this yourself using the particle/collisions API and some math:
http://obi.virtualmethodstudio.com/tutor...icles.html
http://obi.virtualmethodstudio.com/tutor...sions.html
Reply
#3
(23-02-2021, 08:37 AM)josemendez Wrote: There's no built-in way to do that. The definition of "wrapped" can change a lot depending on the game. Is it 2D or 3D? what conditions should the rope meet to consider it's wrapped? should the rope touch itself to determine if it's wrapped? should all particles between two points be in contact with the object? etc.

You can implement this yourself using the particle/collisions API and some math:
http://obi.virtualmethodstudio.com/tutor...icles.html
http://obi.virtualmethodstudio.com/tutor...sions.html

Thanks, those are helpful links. I'm still confused on how to determine if it is wrapped though. I am wrapping a rope around a 3D pole. One end of the rope is latched onto the top of that pole and the rest of the rope hangs down. The rope does not touch itself when it comes around, instead it goes around the pole in a helix sort of structure. Maybe I can check and see if all particles between two points on the rope are in contact like you suggested? I think that makes sense. Do you have any more tips?
Reply
#4
(24-02-2021, 12:43 AM)Navvv Wrote: Thanks, those are helpful links. I'm still confused on how to determine if it is wrapped though. I am wrapping a rope around a 3D pole. One end of the rope is latched onto the top of that pole and the rest of the rope hangs down. The rope does not touch itself when it comes around, instead it goes around the pole in a helix sort of structure. Maybe I can check and see if all particles between two points on the rope are in contact like you suggested? I think that makes sense. Do you have any more tips?

Checking for contact of all particles does not guarantee it's wrapped as it does not give any information about the shape of the rope (it could just be laying parallel to the pole), but it's a start.

Off the top of my head, a promising method is to calculate the 2D polar coordinates of each particle with respect to the pole's centerline, and check that the angle increases monotonically: that the angle of every particle is larger than the angle of the previous one. That guarantees the rope goes in circles around the pole, and you could even count how many times it wraps around dividing the delta angle (last particle angle - first particle angle) by 360º. Couple that with all particles touching it, and you know it's tightly wrapped around it.
Reply