Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rope Position Inconsistencies over Network
#1
Hi all,

Im currently working on a networked app with ObiRope, and we have a slight issue wherein the rope has slightly inconsistent positions when networked, now a slight difference is ok, but the difference at the edge of the rope - where it is connected to an object, are quite drastic, often having the rope stick out (See Image below)

[Image: ropepositioncomparisons.png]

For reference, my rope set up is structured as follows:

[Image: ObiRopeSetupDiagram.png]

A - End-point Object A (Connection A in Hierarchy)
B - End-point Connector Object A (Point A in Hierarchy)
C - Obi Rope
[d]D[/d] - End-point Connector Object B (Point B in Hierarchy)
[e]E[/e] - End-point Object B (Connection B in Hierarchy)

[Image: ObiRopeHierarchy.PNG]

Now, my original concern was this was an issue with my network solution. My current solution is to network the positions of the used particles in the ObiRope, Getting and setting them into Oni on each end. This was due to a client requirement to have 1-1 Rope Positions across client and server.

Used by the Server to assign positions to the network:
Code:
   /// <summary>
   /// Sets the rope's current positions to the network using the Oni C++ Solver
   /// </summary>
   private void SetPositions()
   {
       if (entity.isAttached && ObiRope.particleIndices != null)
       {
           //Get the particle positions through the Oni .dll
           Vector4[] particlePositions = new Vector4[ObiRope.UsedParticles];
           Oni.GetParticlePositions(ObiRope.Solver.OniSolver, particlePositions, ObiRope.UsedParticles, ObiRope.particleIndices[0]);

           //Bind them to the network until we're done or hit the hard limit
           for (int i = 0; i < particlePositions.Length && i < PositionArrayHardLimit; i++)
           {
               state.RopePositions[i] = particlePositions[i];
           }
       }
   }

Used by the client to get positions from the network
Code:
   /// <summary>
   /// Gets the rope's current positions from the network and sets our locals to that
   /// </summary>
   private void GetPositions()
   {
       if (entity.isAttached && ObiRope.particleIndices != null)
       {
           //Create a temporary array to hold all the particles we use
           Vector4[] newPositions = new Vector4[ObiRope.UsedParticles];

           //Retrieve the values from the network until we have them all or hit our hard limit
           for (int i = 0; i < newPositions.Length && i < PositionArrayHardLimit; i++)
           {
               newPositions[i] = state.RopePositions[i];
           }

           //Set the particle positions using the Oni .dll in order to apply to the rope
           Oni.SetParticlePositions(ObiRope.Solver.OniSolver, newPositions, newPositions.Length, ObiRope.particleIndices[0]);
       }
   }

With this in mind what could be causing this difference? Especially such a major difference at each end of the rope? My initial thought is it is the rendering portion of the set up, but I'm not sure.

Thanks!

EDIT:
From some further investigation, using Handles seems to be 100% fine, but then I cant move the other end of the rope by using the first, so I would assume the issue is with the pin constraints?
Reply


Messages In This Thread
Rope Position Inconsistencies over Network - by PhantomBadger - 30-08-2017, 10:58 AM