- Home /
Need Help Getting Rope To Wrap/Straighten In 3D Space
Hello!
I'm trying to create a rope that will wrap around objects and then straighten out when appropriate. I've gotten this to work in 2D space, but 3D is kicking my butt.
How I got it to work in 2D:
Constantly check for line of sight to the anchor point:
-If we no longer have sight, create a new anchor point at the point where we lost sight (ray cast).
-If we created a new anchor point, then note why we created that anchor point (clockwise bend, counter clockwise bend, what was the exact angle formed by the bend).
If we created a bend:
-Check to see if the rope is now bending the opposite way. If the rope has switched directions (i.e. created for clockwise bend and is now counter clockwise), then straighten out the rope.
Does anyone have an idea about how I can implement this is 3D space? My biggest problem is coming up with a way to determine the plane to compare the angle on. Could it be done with dot product and cross product?
Your answer
Follow this Question
Related Questions
Pulling objects towards eachother? 1 Answer
hook that only keep distance 0 Answers
Create Physical 3D Hook? 1 Answer
Gold Miner Hook? 1 Answer
Move towards connected body 1 Answer