RVO For 2D Games in Y-Up (XY camera orientation)

Do you currently have plans to make RVO scripts work in any orientation? Ideally, you’d be able to set a base orientation or something so it can work for games that are not made specifically in Z-up.

I’m considering rotating my game and camera, but there is tons of logic already in my game for Y-up so I am willing to wait on it if this library has plans to support it. I imagine you will, because the core pathfinding library works just fine by setting X to 90 degrees. Wish the RVO scripts had this option too!

Thanks in advance, big fan of A* so far!

Cheers!

Or alternatively, has anyone already done this who is willing to share? Just trying to avoid re-inventing the wheel…

This more or less works…

`@@ -106,6 +106,10 @@ public class RVOController : MonoBehaviour {
desiredVelocity = vel;
}

  •   Vector3 Transpose(Vector3 original) {
    
  •           return new Vector3(original.x, original.z, original.y);
    
  •   }
    
  •   public void Teleport (Vector3 pos) {
              tr.position = pos;
              lastPosition = pos;
    

@@ -115,7 +119,7 @@ public class RVOController : MonoBehaviour {

    public void Update () {
            if (lastPosition != tr.position) {
  •                   Teleport (tr.position);
    
  •                   Teleport (Transpose(tr.position));
              }
              
              UpdateAgentProperties ();
    

@@ -157,7 +161,7 @@ public class RVOController : MonoBehaviour {
#endif
rvoAgent.DesiredVelocity = desiredVelocity + force*wallAvoidForce;

  •           tr.position = rvoAgent.InterpolatedPosition + Vector3.up*height*0.5f + center;
    
  •           tr.position = Transpose(rvoAgent.InterpolatedPosition + Vector3.up*height*0.5f + center);
              lastPosition = tr.position;
      }
    

}
`