Obi Official Forum
Physically accurate closed pulley system - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Physically accurate closed pulley system (/thread-283.html)



Physically accurate closed pulley system - M. Hanssen - 08-01-2018

I would like to make a physically accurate closed pulley system with 2 pulleys and one closed rope.
All physics and colliders are working except that I cannot get the rope to react to the pulley rotation.
Is this even possible with Obi Rope and/or how should I approach this?

[Image: 1ii445dNDDSzaQWcR00kG_scJbCijUBoMfrU2AW4...17-h337-no]


RE: Physically accurate closed pulley system - josemendez - 08-01-2018

(08-01-2018, 12:18 PM)M. Hanssen Wrote: I would like to make a physically accurate closed pulley system with 2 pulleys and one closed rope.
All physics and colliders are working except that I cannot get the rope to react to the pulley rotation.
Is this even possible with Obi Rope and/or how should I approach this?

[Image: 1ii445dNDDSzaQWcR00kG_scJbCijUBoMfrU2AW4...17-h337-no]

Hi there! I'll try my best to help with this.

First of all, make sure the rope collision material or the pulleys collision material have a friction coefficient larger than zero. This is unlikely to be problem, though.

The pulleys interact with the rope trough friction, which is a physical property. Because of this, the pulleys must also be included in the simulation.

If the pulleys are not rigidbodies (that is, they have no physical properties like velocity, mass, etc) and you're rotating them using transform.Rotate() or transform.rotation = something (which is quite possibly what you're doing), you're not actually rotating anything in the physical sense of the word. You're actually "teleporting" them, so to speak: they disappear, and reappear in a different orientation every frame. However there's no angular velocity to them, and therefore no frictional forces involved.

This is a common misconception when it comes to physics, and happens to all physics engines: translating, rotating or scaling an object using its transform does not affect any physical property: linear velocity, angular velocity, acceleration, friction, restitution, etc.

Even if you turn your pulleys into rigidbodies, if you then simply change their transform's rotation you're not changing their angular velocity. To increase their angular velocity, you need to apply a torque or a linear force misaligned with their center of mass.

The solutions: either turn the pulleys into rigidbodies and rotate them by applying torques (by far the most straightforward fix), or if you reeeeeally can't afford them to be rigidbodies, derive an angular velocity yourself based on delta quaternions (that is, the difference between the previous frame rotation and the current divided by the delta time). This second solution is slightly more involved though. There's an example of it (using linear instead of angular velocities) in Obi/SampleScenes/SampleResources/Scripts/ObjectDragger.cs.


RE: Physically accurate closed pulley system - M. Hanssen - 15-01-2018

Although I'm not a Unity rookie, this phenomenon was completely unknown to me.
Thanks a lot for your correct answer!


RE: Physically accurate closed pulley system - josemendez - 15-01-2018

(15-01-2018, 10:54 AM)M. Hanssen Wrote: Although I'm not a Unity rookie, this phenomenon was completely unknown to me.
Thanks a lot for your correct answer!

You're welcome! Sonrisa