Posts: 48
Threads: 8
Joined: Jun 2021
Reputation:
0
02-07-2021, 10:01 AM
(This post was last modified: 02-07-2021, 10:12 AM by alex798.)
Hello,
Sorry for the dumb question(it is probably explained somewhere in manual), but how after rope stretch and release make it compress to length less forcefull?- it shoots like rubber and moves chaotically...
P.S. I understand that it has something to do with compliance, but with comp>0 it doesn't return fully to needed lenght...
Posts: 6,346
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
02-07-2021, 10:40 AM
(This post was last modified: 02-07-2021, 10:44 AM by josemendez.)
(02-07-2021, 10:01 AM)alex798 Wrote: Hello,
Sorry for the dumb question(it is probably explained somewhere in manual), but how after rope stretch and release make it compress to length less forcefull?- it shoots like rubber and moves chaotically...
P.S. I understand that it has something to do with compliance, but with comp>0 it doesn't return fully to needed lenght...
Why is your rope being stretched in the first place? It should not, unless you're trying to simulate a rubber band.
You can think of a rope as an infinitely stiff rubber band: if you stretch it past its rest length, it will *immediately* go back to its rest length.
After you stretch a rope, it will try to get back to its rest length as fast a possible -often in a single frame-, since overstretching violates the basic rope distance constraint: particles must be at a fixed distance from each other.
Compliance makes the rope easier to stretch (more of an actual rubber band), however under gravity it will appear longer (since gravity is an external, ever-present acceleration, permanently stretching the rope).
What you're looking for is either internal damping or plasticity. Internal damping won't help unless compliance is larger than zero which makes it useless in your case. Plasticity is not yet available for distance constraints.
Posts: 48
Threads: 8
Joined: Jun 2021
Reputation:
0
(02-07-2021, 10:40 AM)josemendez Wrote: Why is your rope being stretched in the first place? It should not, unless you're trying to simulate a rubber band.
You can think of a rope as an infinitely stiff rubber band: if you stretch it past its rest length, it will *immediately* go back to its rest length.
After you stretch a rope, it will try to get back to its rest length as fast a possible -often in a single frame-, since overstretching violates the basic rope distance constraint: particles must be at a fixed distance from each other.
Compliance makes the rope easier to stretch (more of an actual rubber band), however under gravity it will appear longer (since gravity is an external, ever-present acceleration, permanently stretching the rope).
What you're looking for is either internal damping or plasticity. Internal damping won't help unless compliance is larger than zero which makes it useless in your case. Plasticity is not yet available for distance constraints.
It's stretching because one end should be connected to unmoving objects, and the other to object, which we can freelly pull... Ok, is there some event that rope is stretching or updating amount of stretch?- maybe I could free pullable object on this event- so no stretching occur
Posts: 6,346
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
02-07-2021, 11:35 AM
(This post was last modified: 02-07-2021, 11:39 AM by josemendez.)
(02-07-2021, 11:10 AM)alex798 Wrote: It's stretching because one end should be connected to unmoving objects, and the other to object, which we can freelly pull... Ok, is there some event that rope is stretching or updating amount of stretch?- maybe I could free pullable object on this event- so no stretching occur
Why not use dynamic attachments for this? it's exactly what they're designed for: coupling between objects and ropes.
In real life, if you attach the rope to an object and pull the object, once the rope is fully stretched you won't be able to pull the object further away. This is because the rope exerts a force on the object, of equal magnitude but opposite direction to the pulling force. Both forces cancel each other out, and the object no longer moves.
Using a dynamic attachment to attach the rope to the object you're pulling (and obviously, using forces to pull the object instead of explicitly setting its position) simulates this. See:
http://obi.virtualmethodstudio.com/manua...ments.html
Quote:By using dynamic attachments, you allow the particles to be fully simulated and exchange impulses with rigidbodies. This means the actor will be affected by the rigidbody's movements, and the rigidbody will in turn be affected by the actor. The technical name for this kind of behavior is two-way coupling.
On the other hand, a static attachment will force the rope to go wherever the object goes. It can't apply any forces back to the object, so it will stretch as much as necessary.
Posts: 48
Threads: 8
Joined: Jun 2021
Reputation:
0
02-07-2021, 12:32 PM
(This post was last modified: 02-07-2021, 12:34 PM by alex798.)
I use dynamic on pullable object, but pulling it more then lenght is still stretchs it and shoots on release- the only way I can think about is to release grip on stretch event...
Or u suggest to use dynamic on static object with ObiRigidbody set to isKinematic for particles?
Posts: 6,346
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
02-07-2021, 12:37 PM
(This post was last modified: 02-07-2021, 12:43 PM by josemendez.)
(02-07-2021, 12:32 PM)alex798 Wrote: I use dynamic on pullable object, but pulling it more then lenght is still stretchs it and shoots on release- the only way I can think about is to release grip on stretch event...
What's the magnitude of theĀ force are you applying to the object? Only way I can think for this to happen is if you apply a force proportional to the distance between the object and the user input (mouse cursor, or whatever). Also make sure you're using enough substeps for the simulation to converge.
Note you can compare the rope's actual length vs its rest length to determine if it's being stretched. The quotient between the two is known as the strain:
Code: float strain = rope.CalculateLength() / rope.restLength;
Will be >1 if the rope is stretched, == 1 if the rope is not stretched, < 1 if the rope is compressed.
Quote:Or u suggest to use dynamic on static object with ObiRigidbody set to isKinematic for particles?
That's basically the same as using a static attachment, so won't work.
Posts: 48
Threads: 8
Joined: Jun 2021
Reputation:
0
(02-07-2021, 12:37 PM)josemendez Wrote: What's the magnitude of theĀ force are you applying to the object? Only way I can think for this to happen is if you apply a force proportional to the distance between the object and the user input (mouse cursor, or whatever). Also make sure you're using enough substeps for the simulation to converge.
Note you can compare the rope's actual length vs its rest length to determine if it's being stretched. The quotient between the two is known as the strain:
Code: float strain = rope.CalculateLength() / rope.restLength;
Will be >1 if the rope is stretched, == 1 if the rope is not stretched, < 1 if the rope is compressed.
That's basically the same as using a static attachment, so won't work.
It's VR so I pull by input(controller)... Not sure about magnitude, but seems like the force is enough to stretch...
Posts: 6,346
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
02-07-2021, 12:51 PM
(This post was last modified: 02-07-2021, 12:53 PM by josemendez.)
(02-07-2021, 12:47 PM)alex798 Wrote: It's VR so I pull by input(controller)... Not sure about magnitude, but seems like the force is enough to stretch...
What kind of VR input controller script you're using?
Most ready-made VR controllers do not apply forces. They simply set the position of an object, so won't work with physics. If you want the rope to apply a force to the object and vice versa, you need to move the object using forces so that both can be accounted for in the simulation. Otherwise you're basically just teleporting the object around from one frame to the next. There's no way a physics engine can react realistically to that.
Posts: 48
Threads: 8
Joined: Jun 2021
Reputation:
0
(02-07-2021, 12:51 PM)josemendez Wrote: What kind of VR input controller script you're using?
Most ready-made VR controllers do not apply forces. They simply set the position of an object, so won't work with physics. If you want the rope to apply a force to the object and vice versa, you need to move the object using forces so that both can be accounted for in the simulation. Otherwise you're basically just teleporting the object around from one frame to the next. There's no way a physics engine can react realistically to that. It's Vive Focus. Currently it moves object without physics, because when it used(with MoveRigidbody) connection with rope was less stable...
Posts: 6,346
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
02-07-2021, 01:06 PM
(This post was last modified: 02-07-2021, 01:06 PM by josemendez.)
(02-07-2021, 01:01 PM)alex798 Wrote: It's Vive Focus. Currently it moves object without physics, because when it used(with MoveRigidbody) connection with rope was less stable...
You can't move the object without physics and expect physics to work properly. If the object is involved with any kind of physics, both the object as well as all user input/interaction with it must be physically simulated.
Regarding stability, can you give more details? What's the mass of the object? is it much heavier than the rope?
|