Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Obi collision issue
#1
Hi, Obi team!

I was trying to use Obi rope as a string to create a crossbow like object. While prototyping it, I realised that the 'arrow' can easily penetrate the rope model.

By rendering the particles, clearly, the 'arrow' slipped through the gap between particles, as shown below.

 [Image: Screenshot-from-2021-01-23-21-57-28.png]

I have reduced the thickness to get smaller particles, however, this did not help much.

How should I change the parameters? Any idea is appreciated!

Many thanks in advance.
Reply
#2
Hi there!

There's a basic reason why this won't work, and it applies to all physics engines. Physics engines, as any other software, have to somehow discretize quantities for the computer to be able to work with them. In a physics engine, this discretization is both spatial and temporal. Obi discretizes ropes into particles, and Unity discretizes time into time steps.

Yours is probably a worst case scenario for any physics engine: a very thin object (the arrow) accurately colliding against a very thin, very tense string, that then gets projected forward at extremely high speeds. You will need incredibly fine spatial and temporal resolution for this to work. At that point, you will have a hard time justifying the amount of computational resources spent on this, specially for a game. Needless to say, this isn't how bows are simulated in games. Oftentimes tensing the bow is just an animation, when you release the arrow, a projectile is spawned at a given speed. No actual simulation of any kind involved for the bow itself.

Quote:I have reduced the thickness to get smaller particles, however, this did not help much.

This would most likely exacerbate the problem. By using more particles you're improving spatial resolution, but worsening temporal resolution. Smaller objects need finer temporal resolution for accurate collision detection to take place. This is why tunneling typically happens more often with small/thin objects. (If you're unsure what tunneling is, we have a video on the subject:https://www.youtube.com/watch?v=ms0Z35GY6pk&list=PLnCR8_XCOgrZL8gNxeuGJSrMUXHdJMXKn)

If you still want to try this, your best weapon are substeps (found in the ObiFixedUpdater component). Start at 10 substeps, which will typically yield a timestep of 0.02/10 = 0.002 seconds (where 0.02 is Unity's default timestep size). That should give you enough temporal resolution to start. The effect  substeps/iterations have on the simulation is explained here: http://obi.virtualmethodstudio.com/tutor...gence.html

Then, increase rope resolution at maximum (1) and reduce thickness to a reasonably small value. Both settings are found in the rope blueprint. If you feel like the rope becomes too stretchy when the amount of particles in it increases, it means you need to use even more substeps.

Let me know if I can be of further help. cheers!
Reply
#3
Hi josemendez, 

Thanks so much for your reply! It was really detailed and educational!

Please let me rephrase my question. I originally said it was a crossbow just to simplify my problem.

In fact, I am using Unity to simulate a robot grasping a rope. The gripper fingers are very thin, and it moves fast. The grasp looks like below.

[Image: Screenshot-from-2021-02-05-16-44-11.png]

As you have suggeted, I first slowed down the movement of the fingers. However, even when at very slow speeds, the fingers could still push the particles away as shown below:
[Image: imageedit-2-6662267114.png]
When I lift the gripper up, the rope just stayed where it was.

I also tried increasing the substeps, it did not show much effect as well. Meanwhile, the rope resolution was kept at 1 and in the thickness was set to 0.05. The Obi collider materials for both fingers were set to HighFriction/HighStaticFriction.

WIth your experience, do you think what I have been working on is viable? Thank you again for video and tutorial link, they are really helpful.
Reply