Posts: 20
Threads: 7
Joined: May 2020
Reputation:
0
10-06-2020, 02:57 PM
I have an issue with the ropes collision, sometimes when one rope collide with another one (or when another object) and stretched, it just slide through the other one, the solution I found is to increase the resolution and the pooled particles, but that make the rope so stretchy and its length increase!
This is what I want to achieve: when the rope collide with something (or with another rope), it should not pass through it, and at the same time, its length should not increase (maybe it can increase at the collision moment, but after it should return to its initial length).
Is there any way to do this?
Thanks,
Posts: 6,348
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
10-06-2020, 03:26 PM
(This post was last modified: 10-06-2020, 03:27 PM by josemendez.)
(10-06-2020, 02:57 PM)Kifwat Wrote: I have an issue with the ropes collision, sometimes when one rope collide with another one (or when another object) and stretched, it just slide through the other one, the solution I found is to increase the resolution and the pooled particles, but that make the rope so stretchy and its length increase!
This is what I want to achieve: when the rope collide with something (or with another rope), it should not pass through it, and at the same time, its length should not increase (maybe it can increase at the collision moment, but after it should return to its initial length).
Is there any way to do this?
Thanks,
Short answer: Just use more substeps. You can find this setting in the ObiFixedUpdater component.
Long answer: What you're experiencing is a mix of tunneling (the typical issue where small objects moving at high speeds pass trough each other, see this video if you're not already familiar with this: https://www.youtube.com/watch?v=ms0Z35GY6pk) and lack of convergence. Both can be addressed at the same time by advancing the simulation using smaller timesteps, which is best done by using more than 1 substep.
For a detailed description of how the underlying physics engine works and how substeps/iterations affect its quality, see:
http://obi.virtualmethodstudio.com/tutor...gence.html
Posts: 20
Threads: 7
Joined: May 2020
Reputation:
0
(10-06-2020, 03:26 PM)josemendez Wrote: Short answer: Just use more substeps. You can find this setting in the ObiFixedUpdater component.
Long answer: What you're experiencing is a mix of tunneling (the typical issue where small objects moving at high speeds pass trough each other, see this video if you're not already familiar with this: https://www.youtube.com/watch?v=ms0Z35GY6pk) and lack of convergence. Both can be addressed at the same time by advancing the simulation using smaller timesteps, which is best done by using more than 1 substep.
For a detailed description of how the underlying physics engine works and how substeps/iterations affect its quality, see:
http://obi.virtualmethodstudio.com/tutor...gence.html Increasing the Substeps make the rope look like a cable, I mean that it didn't fold I tried also decreasing the fixedtimesteps but nothing has changed!
Posts: 6,348
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
10-06-2020, 04:45 PM
(This post was last modified: 10-06-2020, 05:04 PM by josemendez.)
(10-06-2020, 04:30 PM)Kifwat Wrote: Increasing the Substeps make the rope look like a cable, I mean that it didn't fold I tried also decreasing the fixedtimesteps but nothing has changed!
Using more substeps will make all constraints converge a lot faster. Theoretically, a infinite amount of substeps (continuous time) would yield 100% stiff material: not bendable, not stretchable.
You want it to be easily bendable though (to be able to "fold", in your words), so just increase the max bending/compliance parameters of your bend constraints, or even disable them completely. You will find the per-rope bend parameters in the ObiRope inspector.
http://obi.virtualmethodstudio.com/tutor...aints.html
All this is thoroughly explained in the manual:
http://obi.virtualmethodstudio.com/tutor...gence.html
Think of substeps as your simulation budget: the more substeps, the higher stiffness your constraints can reach. If you have only 1 substep (low budget), you constraints will be soft under all circumstances. Once you give the simulation a bit more budget, you will have to manually impose limits to your constraint stiffness, because they can actually reach very high stiffness now.
These concepts are common to many (if not all) physics engines, so you should really get familiar with them.
Posts: 20
Threads: 7
Joined: May 2020
Reputation:
0
(10-06-2020, 04:45 PM)josemendez Wrote: Using more substeps will make all constraints converge a lot faster. Theoretically, a infinite amount of substeps (continuous time) would yield 100% stiff material: not bendable, not stretchable.
You want it to be easily bendable though (to be able to "fold", in your words), so just increase the max bending/compliance parameters of your bend constraints, or even disable them completely. You will find the per-rope bend parameters in the ObiRope inspector.
http://obi.virtualmethodstudio.com/tutor...aints.html
All this is thoroughly explained in the manual:
http://obi.virtualmethodstudio.com/tutor...gence.html
Think of substeps as your simulation budget: the more substeps, the higher stiffness your constraints can reach. If you have only 1 substep (low budget), you constraints will be soft under all circumstances. Once you give the simulation a bit more budget, you will have to manually impose limits to your constraint stiffness, because they can actually reach very high stiffness now.
These concepts are common to many (if not all) physics engines, so you should really get familiar with them. Honestly I'm not really familiar with them, but I tried all the possible ways you suggest, and this is what I got:
- Increasing substeps + increasing distance constraints = Fixed the rope go through other, but the rope is not soft and not foldable (like a hard cable).
- Keeping the substeps at 1 + increasing bend constraints = soft and foldable rope, but it go through the other, and the collision didn't happen properly.
I want the rope to be soft and foldable and at the same time it should stretch with other objects (and return to its initial length after) and don't go through them, can you please give me some value suggestion to achieve this?
Posts: 6,348
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
10-06-2020, 05:51 PM
(This post was last modified: 10-06-2020, 05:53 PM by josemendez.)
(10-06-2020, 05:41 PM)Kifwat Wrote: Honestly I'm not really familiar with them, but I tried all the possible ways you suggest, and this is what I got:
- Increasing substeps + increasing distance constraints = Fixed the rope go through other, but the rope is not soft and not foldable (like a hard cable).
- Keeping the substeps at 1 + increasing bend constraints = soft and foldable rope, but it go through the other, and the collision didn't happen properly.
With bend constraints you've done the opposite of what you should do: do not increase their interaction count, that would only make the rope less bendable. Either deactivate them, or increase their compliance and/or their max bending. Compliance will make then less stiff, and max bending will allow some amount of bending before they kick in.
The combination you want is: Increase substeps + increase max bending.
(10-06-2020, 05:41 PM)Kifwat Wrote: I want the rope to be soft and foldable and at the same time it should stretch with other objects (and return to its initial length after) and don't go through them.
Obi is a particle-based engine. The rope is basically a chain of particles, so if you overstretch it you will be opening gaps in-between particles trough which other objects/ropes will pass. Adding a ObiParticleRenderer component to the rope should make this point obvious. You can't stretch a rope past its maximum length and still expect it to catch all collisions, collision detection just doesn't work like this.
Posts: 6,348
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
I recorded a video to help you:
I start out with a rope with the default resolution (0.5) and default solver/updater/rope parameters. It is quite stretchy and it passes easily trough the collider in the scene. (I add a ObiParticleRenderer component to clearly see what's happening under the hood).
So, I increase the amount of substeps: the rope is much less stretchy and collision detection greatly improves. However, the rope is very stiff (doesn't fold) because the default bending parameters are zero compliance, and 0 bending allowed. So increasing either the bending compliance or the max bending will result in "foldable" rope.
Hope this helps!
Posts: 20
Threads: 7
Joined: May 2020
Reputation:
0
10-06-2020, 06:46 PM
(This post was last modified: 10-06-2020, 07:20 PM by Kifwat.)
(10-06-2020, 06:13 PM)josemendez Wrote: I recorded a video to help you:
I start out with a rope with the default resolution (0.5) and default solver/updater/rope parameters. It is quite stretchy and it passes easily trough the collider in the scene. (I add a ObiParticleRenderer component to clearly see what's happening under the hood).
So, I increase the amount of substeps: the rope is much less stretchy and collision detection greatly improves. However, the rope is very stiff (doesn't fold) because the default bending parameters are zero compliance, and 0 bending allowed. So increasing either the bending compliance or the max bending will result in "foldable" rope.
Hope this helps!
Thanks for the explanation, but can you try this and show me how to achieve it?
In your scene, link the the rope's start and end points with two cubes, and then in play mode, move the two cubes (linked with the rope) far from the horizontal object, so the rope is colliding with it. When going as far as you can from the horizontal object, the rope should not pass through it, it should stretch and stay colliding with it.
Check the attached image:
https://ibb.co/31b9SVj
Or is there any way to increase the amount of particles depending on the rope length? so when it stretch the particles stay close and then it didn't go through object.
Posts: 6,348
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
10-06-2020, 08:01 PM
(This post was last modified: 10-06-2020, 08:05 PM by josemendez.)
(10-06-2020, 06:46 PM)Kifwat Wrote: Thanks for the explanation, but can you try this and show me how to achieve it?
In your scene, link the the rope's start and end points with two cubes, and then in play mode, move the two cubes (linked with the rope) far from the horizontal object, so the rope is colliding with it. When going as far as you can from the horizontal object, the rope should not pass through it, it should stretch and stay colliding with it.
Simply stretching the rope won't work. In real life, imagine that you have two objects at 1 meter from each other, joined by a 1 meter long rope. Then, you suddenly separate the objects so that there's now 2 meters between them: the rope would simply break (or, prevent you from separating the cubes, depending on the force used to pull the objects apart from each other).
You need to actually change the rope rest length to match the distance between the two cubes. That's what cursors are for:
http://obi.virtualmethodstudio.com/tutor...ursor.html
They let you add "more rope" at any point in the rope, in any direction.
(10-06-2020, 06:46 PM)Kifwat Wrote: Or is there any way to increase the amount of particles depending on the rope length? so when it stretch the particles stay close and then it didn't go through object.
Yes, you can do this using cursors. They are designed to change the rope rest length at runtime. Check out the "Crane" and "GrapplingHook" sample scenes. They both do what you're asking for, specially the grappling hook one.
Posts: 20
Threads: 7
Joined: May 2020
Reputation:
0
(10-06-2020, 08:01 PM)josemendez Wrote: Simply stretching the rope won't work. In real life, imagine that you have two objects at 1 meter from each other, joined by a 1 meter long rope. Then, you suddenly separate the objects so that there's now 2 meters between them: the rope would simply break (or, prevent you from separating the cubes, depending on the force used to pull the objects apart from each other).
You need to actually change the rope rest length to match the distance between the two cubes. That's what cursors are for:
http://obi.virtualmethodstudio.com/tutor...ursor.html
They let you add "more rope" at any point in the rope, in any direction.
Yes, you can do this using cursors. They are designed to change the rope rest length at runtime. Check out the "Crane" and "GrapplingHook" sample scenes. They both do what you're asking for, specially the grappling hook one.
Okey that sounds good, but I think that will be easy just if the rope is straight and the two cubes move in a straight movement, so we can add edit the rope's length depending on the distance between the two cubes, but how can we do that when the rope is foldable and not straight? I mean in case the rope is stretched by other object's movement, how can we track that and then increase its length depending on the contact with the other object?
|