Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Manually Placing Rope Particles
#1
I'm looking to sync the position of the rope over a network, my initial test is getting the positions of the particles via the
Code:
ObiRope.GetParticles(index)

method, networking these values, then setting them on the other side, however I cannot seem to set them. My current attempt is as follows;

Code:
   private void SetPositions()
   {
       if (entity.isAttached)
       {
           for (int i = 0; i < ObiRope.UsedParticles && i < PositionArrayHardLimit; i++)
           {
               state.RopePositions[i] = ObiRope.GetParticlePosition(i);
           }
       }
   }

   private void GetPositions()
   {
       if (entity.isAttached)
       {
           for (int i = 0; i < ObiRope.UsedParticles && i < PositionArrayHardLimit; i++)
           {
               ObiRope.Solver.renderablePositions[ObiRope.particleIndices[i]] = state.RopePositions[i];
               ObiRope.Solver.UpdateActiveParticles();
           }
       }
   }
I can confirm that state.RopePositions contains the correct values when referenced by the client, but I'm unable to tell the solver to use these positions. Is this a thing that is even possible with ObiRope? Am I going about this all wrong? Any help would be appreciated!
Reply


Messages In This Thread
Manually Placing Rope Particles - by PhantomBadger - 17-07-2017, 02:02 PM