ikpil / DotRecast

DotRecast - a port of Recast & Detour, Industry-standard navigation mesh toolset for .NET, C#, Unity3D, games, servers
zlib License
563 stars 72 forks source link

Invert X axis #45

Closed Danil0v3s closed 9 months ago

Danil0v3s commented 9 months ago

Hey!

I've been using this mainly with Unity and it seems the X axis is inverted in comparison to Unity's coordinates. I have to do something like this every time I sent the position to my clients:

public static SVector3 toSVector3(this RcVec3f v, RcVec3f mapSize) => new() { X = mapSize.X - v.X, Y = v.Y, Z = v.Z };

Is there any way you can think of to invert this so we can avoid these conversions?

ikpil commented 9 months ago

For use in Unity, I believe the method you mentioned is the best approach.

Danil0v3s commented 9 months ago

Yea, sounds reasonable. Thank you!