Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Slide along attachment point
#1
Hello, thanks for this great extension. Sorry if this is a basic question but is there a way to slide a rope along an attachment point? I'd like the rope to react the way it currently does with an attachment point, but when enough force is applied to the rope it pulls the rope through using the attachment point to anchor the position. If there isn't a simple way to do this, would it be possible to use a cursor to increase the length on the side that's being pulled and decrease it on the other simultaneously? I'd really appreciate any thoughts. Thanks.
Reply
#2
(09-12-2020, 04:28 AM)llevine Wrote: Hello, thanks for this great extension. Sorry if this is a basic question but is there a way to slide a rope along an attachment point? I'd like the rope to react the way it currently does with an attachment point, but when enough force is applied to the rope it pulls the rope through using the attachment point to anchor the position. If there isn't a simple way to do this, would it be possible to use a cursor to increase the length on the side that's being pulled and decrease it on the other simultaneously? I'd really appreciate any thoughts. Thanks.

Hi there!

You can't do what you describe using attachments, as this isn't how they work. (Static) attachments set the mass of some particles to infinite (excluding them form the simulation) and overrides their position to follow a certain transform. Dynamic attachments exchange forces with the rigidbody they're attached to. Both types of attachment constrain 3 translational DOFs (degrees of freedom) and optionally, in the case of rods, 3 additional rotational DOFs.

This would be more of a "pinhole constraint" or something similar, that constrains the rope in only two translational DOFs and (I assume) all three rotational DOFs, leaving only one axis for the rope to move along. The "...when enough force..." part would also imply some kind of sliding friction along this unconstrained DOF. This is a really specialized use case.

Currently the only way of doing this would be collisions + frictional contacts.

kind regards,
Reply
#3
(09-12-2020, 09:03 AM)josemendez Wrote: Hi there!

You can't do what you describe using attachments, as this isn't how they work. (Static) attachments set the mass of some particles to infinite (excluding them form the simulation) and overrides their position to follow a certain transform. Dynamic attachments exchange forces with the rigidbody they're attached to. Both types of attachment constrain 3 translational DOFs (degrees of freedom) and optionally, in the case of rods, 3 additional rotational DOFs.

This would be more of a "pinhole constraint" or something similar, that constrains the rope in only two translational DOFs and (I assume) all three rotational DOFs, leaving only one axis for the rope to move along. The "...when enough force..." part would also imply some kind of sliding friction along this unconstrained DOF. This is a really specialized use case.

Currently the only way of doing this would be collisions + frictional contacts.

kind regards,

Thank you! You can ignore the "when enough force" part. I understand what you're saying, and am guessing I need to implement my own pinhole constraint as a new constraint type. Could you point me in the direction of how to constrain only two translational DOFs? I see in ObiParticleAttachment that the UpdateStaticAttachment method sets solver.angularVelocities[solverIndex] = Vector3.zero. Would changing this value in 1 dimension give me what I want?
Reply
#4
(11-12-2020, 06:04 PM)llevine Wrote: Thank you! You can ignore the "when enough force" part. I understand what you're saying, and am guessing I need to implement my own pinhole constraint as a new constraint type. Could you point me in the direction of how to constrain only two translational DOFs? I see in ObiParticleAttachment that the UpdateStaticAttachment method sets solver.angularVelocities[solverIndex] = Vector3.zero. Would changing this value in 1 dimension give me what I want?

It's unfortunately not as simple as setting the angular velocity. Writing new constraints requires you to have some understanding of constrained dynamics. Obi uses eXtended Position-Based Dynamics (XPBD), you can refer to the original XPBD article for the math involved. Equation 18) in this article is the one used to implement constraints:

https://matthias-research.github.io/page...s/XPBD.pdf
Reply