Friday, July 8, 2022
HomeGame Developmentphysics - Implementing rigidity in chain/rope pulling

physics – Implementing rigidity in chain/rope pulling


I am making an attempt to implement the motion of a series of segments related to one another (gravity, mass, and many others. are usually not concerned). The chain can solely be dragged by its “head” phase. Every phase is represented with 2 vectors (back and front) and has mounted size.
Here is my methodology that adjusts the place of a phase after its earlier phase was moved:

public void AdjustLocation()
{
    Entrance = PrevSegment.Again;

    Vector delta = Entrance - Again;
    float f = SegmentSize.Width / delta.Size;

    Again = Entrance - (delta * f);
}

So it does two issues:

  1. Units the entrance location of a phase equal to the again location of its earlier phase.
  2. Strikes the again location in the direction of the brand new entrance location in a straight line sustaining the mounted size.

However the results of that strategy is just not sensible sufficient.
Like right here:

If we pull this chain down, the rear finish of it (on the left facet) should not transfer in any respect till this “knot” straightens out, however it follows its earlier segments an excessive amount of:

As I perceive it, when the “head” phase is moved, it simply pulls the remainder with it, and there is speculated to be a rigidity that pulls earlier segments again.

How can I implement it or make it look barely extra sensible?
I’ve examine easy constraints that simply pull objects in the direction of one another to the center, however I do not perceive how is it speculated to work when there are lots of constraints.
Is it essential to implement advanced physics for this?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments