Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Issue Saving/Loading Particle Positions in play mode using ObiRope v7.0
#3
Hi!

(29-04-2025, 07:27 AM)ozeecode Wrote: rope.ActivateParticle(); // This doesn't have an actorIndex anymore.

It always uses activeParticleCount now. It's by far the most common case and the most efficient one as well: activate the last inactive particle, which is done by just bumping a counter.

(29-04-2025, 07:27 AM)ozeecode Wrote: Specifically, I commented out the following code block:

Code:
// while (rope.elements.Count < particleCount)
// {
//     rope.elements.Add(new ObiStructuralElement
//     {
//         particle1 = rope.elements[^1].particle1,
//         //particle2 = rope.solverIndices[rope.activeParticleCount],
//         restLength = rope.interParticleDistance
//     });
//     rope.CopyParticle(rope.activeParticleCount - 1, rope.activeParticleCount);
//     rope.ActivateParticle();
// }

By doing this, I could adjust the rope’s particle count by only removing particles, without adding new ones. However, I’m still unsure how to handle cases where I do need to add new elements.

This code appends a new element that links the first particle of the previous element with the new active particle. It should link the second particle of the previous element instead.

(29-04-2025, 07:27 AM)ozeecode Wrote: However, this no longer works in ObiRope v7.x. Could you help me identify what I might be missing?

Corrected the above two issues (ActivateParticle and reversed elements), tested it and it seems to work ok. Could you specify what you mean by "not working"? does it result in an error? does it do nothing? does it do something else that what you expected?

kind regards,
Reply


Messages In This Thread
RE: Issue Saving/Loading Particle Positions in play mode using ObiRope v7.0 - by josemendez - 29-04-2025, 07:53 AM