Search Unity

IS there a way to minimize rubber-band effect in physx rope?

Discussion in 'Editor & General Support' started by web76, Nov 4, 2009.

  1. web76

    web76

    Joined:
    Nov 4, 2009
    Posts:
    150
    Hi, I am buliding a crane sim, and need chain/ropes, but when I try to lift something heavy the rope act to much like a rubber band, how can I minimize this effect? If I can increase the accurasy in the cost of performance I would do it :)

    regards Kjell A
     
  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    If you're creating the rope using a chain of ConfigurableJoints, you could set the linearLimit properties to limit the extent of stretch and the springiness.
     
  3. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    @andeeee - So would setting the linearLimit to "0" keep the joint from stretching at all (that's what I want)? What would happen if a physics force was applied that tried to stretch it?
     
  4. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    Attached is a package that illustrates the issue the OP and I are talking about. No matter what setting I give linearLimit, the joint still stretches like a spring.
     

    Attached Files:

  5. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    @web76 - Try experimenting with the "Projection Mode" setting of the configurable joint. When I set this to position only it seems to stop the stretching.
     
  6. web76

    web76

    Joined:
    Nov 4, 2009
    Posts:
    150
    Thanks, for the hints, I also found the iteration count for physx, it was set on value 6, I increased it to 40, and still had very good fps, but much more sable physicks....

    I am getting quite good results now, 60-70 links/joints and four five of them...
     
  7. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    To stop the stretching, you need to set the xMotion (and/or yMotion and zMotion) to Limited. Then, the angular and linear limits should apply to the joint along the axes where it is limited. Setting the linear limit to a small value (ie, not zero, say about 0.01 or so) seems to help the stability of these joints considerably, especially when they are arranged in a chain.