Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Measuring tape simulation
#1
Hi there, I would like to make a tape simulation with obi rope.

I have a rope cursor attached to one end and an object grabbing the other end using pin constraints so that i can simulate it by scripting the rope cursor rope length. However I need a method to detect when the rope need to be pulled out, is there a way that I can automatically increase the rope cursor rope length according to the force applied on the rope? thank you
Reply
#2
(20-04-2020, 04:22 AM)Lokeyyyy Wrote: Hi there, I would like to make a tape simulation with obi rope.

I have a rope cursor attached to one end and an object grabbing the other end using pin constraints so that i can simulate it by scripting the rope cursor rope length. However I need a method to detect when the rope need to be pulled out, is there a way that I can automatically increase the rope cursor rope length according to the force applied on the rope? thank you

Hi there!

You can compare the rope's current length (rope.CalculateLength()) with its rest length (rope.restLength), and change its length proportional to the difference between both. This is probably the simplest approach.

Or you could use constraint forces (lagrange multipliers, accessible using Oni.GetBatchConstraintForces()) to have a force-based approach. Take a look at ObiRope's ApplyTearing() method, there we use constraint forces to determine where/when the rope should tear when under strong forces.
Reply