Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  When the Obi Rope is tensioned
#4
(06-07-2023, 10:16 AM)EunBhin Park Wrote: for (int i = 0; i < actor.solverIndices.Length; ++i)

        {
            rope.solver.externalForces[actor.solverIndices] = otherRope.solver.externalForces[actor.solverIndices[i]];
            rope.solver.externalTorques[actor.solverIndices[i]] = otherRope.solver.externalTorques[actor.solverIndices[i]];

            rope.solver.positions[actor.solverIndices[i]] = otherRope.solver.positions[actor.solverIndices[i]];
            rope.solver.velocities[actor.solverIndices[i]] = otherRope.solver.velocities[actor.solverIndices[i]];

        }


In this way, the position and rotation values are passed.

The 'otherRope' is the rope that gives the value, and the 'rope' is the rope that receives the value.

Ok, where during the update cycle are you doing this? Update, FixedUpdate, one of the solver callbacks...? You'd typically want to set these values in the solver's OnEndStep callback. Copying them at any other time may lead to the solver modifying these positions as part of its normal simulation cycle. The idea is that you want both solvers to have finished a simulation step, and copy their particle values before rendering takes place.

Also, make sure to copy previousPositions array and startPositions arrays. These are used to derive velocities and perform interpolation, respectively.

(06-07-2023, 10:16 AM)EunBhin Park Wrote: Even if i pass an External Forces and an External Torques, when tension is applied, the rope that receives the value does not move the same as the rope that gives the value.

Unless you're explicitly writing custom data in ExternalForces and ExternalTorques, these values will [i]always be zero. As the name implies, they're "external" to the simulation.
Reply


Messages In This Thread
When the Obi Rope is tensioned - by EunBhin Park - 06-07-2023, 08:45 AM
RE: When the Obi Rope is tensioned - by josemendez - 06-07-2023, 10:25 AM
RE: When the Obi Rope is tensioned - by fevzi - 27-09-2023, 05:17 PM