Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Rope pin+collision problem.
#1
Hi,

I'm working on a bridge-building style game. One where you draw a line from pointA to pointB and a rope is generated between the two locations. Then if the player draws a line from the first rope the two of them connect together.

In addition to this system, the ropes all should collide with each other. This is the most important aspect for the project to work. In effect, the player is creating structures out of the ropes which interact with each other via collisions and coupling.

Whilst I have the core system working on this and can connect ropes together. I have encountered one issue which I need to be able to fix in order to progress. For me to explain I need to describe how my system functions.


Firstly: How I'm generating ropes/constraints.

[Image: img1.PNG]
This image shows the way I generate ropes, with everything being generated via scripts (no prefabs or premade blueprints). Each Endpoint is an actual GameObject that contains rigidbodies (both Unity and Obi) which allow them to simulate physics/movement.

The rope can collide with everything.
The Endpoints don't collide with anything.

The rope does not use a "Particle Attachment" component. Instead, I directly access "Oni.ConstraintType.Pin" and use that to generate the pin constraint.


Secondly: How ropes are connected together.

[Image: img2.PNG]
This shows how two ropes are connected in the scene.

They both use the same Endpoint/constraint system, but in this example, Rope-1 generates constraints between A and B. Then Rope-2 generates constraints between B and C.

This allows for the ropes to interact with each other's movements (via two-way coupling).

Like before, the same collision rules apply for ropes and Endpoints.


The problem.

[Image: compare.gif]
Because ropes have collision enabled, this means if two (or more) ropes share a single point then the rope Endpoints get stuck in a cycle of detecting an intersection, moving away, then moving back to its pinned position. This causes a jittering effect which I've been trying to eliminate.

As the gif above shows, when ropes have collision switched off, the ropes simulate without any problems. However, this is not something I can do as ropes NEED to be able to collide with each other.

One fix I've attempted is when I pin the rope, I offset its location slightly to stop potential intersections. This gives some nicer results, but I can't use this as a solution as ropes are generated with gaps between them. Also, the pins act independently of each other, as shown below.
(Left is how the ropes start initially. Right is after the pin constraint is created and allowed to simulate)

[Image: unknown.png]

I have tried changing various solver parameters to see if that could help anything. Reducing the updater substeps to a very low amount helps reduce jittering, but this isn't a fix as the shared-point collision still exists and everything stretches too much.



I'm lost for ideas on what the solution is for this system. I somehow need ropes to both ignore and allow collisions at the same time.
Reply


Messages In This Thread
Rope pin+collision problem. - by WinterXYZ - 01-08-2021, 02:42 PM
RE: Rope pin+collision problem. - by josemendez - 02-08-2021, 07:46 AM
RE: Rope pin+collision problem. - by WinterXYZ - 06-08-2021, 05:38 PM
RE: Rope pin+collision problem. - by Destro26 - 22-06-2022, 09:55 PM
RE: Rope pin+collision problem. - by josemendez - 23-06-2022, 07:10 AM
RE: Rope pin+collision problem. - by Destro26 - 23-06-2022, 09:13 PM
RE: Rope pin+collision problem. - by josemendez - 24-06-2022, 07:09 AM