Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Save/Load Obi Rope state and rope network state synchronization
#4
(24-05-2021, 08:05 AM)pmike Wrote: Can you give a sample code for saving and loading the rope state using particles API?

There's sample code for this in the link I just posted. To read:

Code:
for (int i = 0; i < actor.solverIndices.Length; ++i)
{
    int solverIndex = actor.solverIndices[i];
    var pos = actor.solver.positions[solverIndex];
    var vel =  actor.solver.velocities[solverIndex];
}

To write:

Code:
for (int i = 0; i < actor.solverIndices.Length; ++i)
{
    int solverIndex = actor.solverIndices[i];
    actor.solver.positions[solverIndex] = yourPos;
    actor.solver.velocities[solverIndex] = yourVel;
}
Reply


Messages In This Thread
RE: Save/Load Obi Rope state and rope network state synchronization - by josemendez - 24-05-2021, 08:27 AM