Rigid joints not rigid

I’m trying to build a rope, using rigid joints, with a weight on each end, to simulate a climber and a belayer. However I am having trouble building a rope that doesn’t stretch a ridiculous amount.
In the simplified example, the first 3 balls represent the rope and the last is a weight on one end. When run, the rope stretches. How can I stop this happening ?


STRETCH.blend (440 KB)

I’m surprised that the rigid body joint stretches at all. I never saw that before.

I guess this is the result of the unbalanced masses. Bullet2 can’t handle object with very different masses very well. I can only assume that it reinforces little calculation errors.

I suggest to play with the masses. Try to find out what mass-differences work and which one do not.

e.g. 50:100 works pretty well

Thanks Monster. Unfortunately rope is around 70 gm/metre and I’d like to simulate a falling climber of say 80 Kg with a lightweight belayer, of say 60 Kg.

Increasing the mass of the rope makes it behave like a heavy chain, negating the weight difference of the climber and belayer.

Please keep in mind the BGE and Bullet2 are designed for entertaining less for physical simulations.

There are not that many people who can see the difference between rope and chain physics. This enables you to build whatever you want as long as it looks like whatever you want to achieve ;).

You can use this “bug”/“Feature” to simulate a stretching rope.

not think is a good advice , but to make it rigid try to make gost the sphere in the middle (to avoid collision)
that point you can decrease the mass of the last ball , it seem a rope in this way(but lost the collision).

OT: at moment is impossible spawn a objet (group of) like this!

anyway you can make it alsoo with python , but simulate a elastic is more easy than simulate a rope

MarcoIT, I actually used a couple of hundred spheres to simulate my rope, rather than the 3 in the simplified example.

I’ve written very little python. Can you give me a hint on how I might approach this please ?

the way more easy is using the linear velocity of the obj dynamics (obj static not have this)

using the distance as reference to give more force to the constraints

this work well to make “elastic” constraints…

is similar to your script?

import bge

def cs1(cont):
    own = cont.owner
    A = obs["A"] # static obj
    B = obs["B"] # dynamic obj
    rigidity = 0.05
    vec = A.position - B.position
    B.worldLinearVelocity += vec*rigidity
def cs2(cont):
    own = cont.owner
    A = obs["A"] # static obj
    B = obs["B"] # dynamic obj
    vec = A.position - B.position
    dist = vec.magnitude
    if dist > 5:
        B.worldLinearVelocity += vec*rigidity


constraintsLevel2.blend (67.3 KB)

Thanks MarcoIT. I haven’t used a script in my examples.
Your script does restrain the ball independently of its mass, but it’s movement is quite unnatural. Can the constraint be made inelastic, that is, to keep the cube and ball a fixed distance apart ? When additional balls are added, is a new separate script required for each ball ?

i not have a good formula to make a rope,
this seem required to change (or i think) also the position , not only the velocity …
is more complex than a elastic

i adding some number “almost random” to get a decent result :o
(for example the value 10)

C.worldLinearVelocity += vec*gap*10

but not convince me much…

the mass is not calculated

yes a script is required , and must run all frame for all “obj-constraints”



noElastic.blend (69.5 KB)

Thanks again Marco. It behaves much better but it doesn’t react to obstacles. I wanted to show what happens to a lightweight belayer standing various distances from a wall, when a lead climber falls. Depending on how far the climber falls, and where the belayer stands, the belayer can be either pulled up into the first piece of protection or pulled into the wall.

The attached is about as close as I seem to be able to get, to something moderately realistic. The rope is too heavy and the scaling is wrong. A correct weight rope and changes to scaling make things worse.


rope_test3.blend (792 KB)