urho icon indicating copy to clipboard operation
urho copied to clipboard

NavigationMesh.FindPath throws exception when run on UWP.

Open utekai opened this issue 6 years ago • 0 comments

This issue was opened and closed. Not sure if it was fixed.

Closed: https://github.com/xamarin/urho/issues/24

The issue is for UWP NavigatonMesh.FindPath throws an exception.

The fix is the dll call needs modified to define the start/end vector3 arguments as REF.

The line with the error for SharpReality is here.

[DllImport(Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal extern static IntPtr urho_navigationmesh_findpath(IntPtr navMesh, ref Urho.Vector3 start, ref Urho.Vector3 end, out int count);

Once the change above is made, this line must pass in the arguments (start and end) with ref keyword.

Then it works on UWP/SharpReality.

Without the change, upon running the exception is: Exception thrown: 'System.AccessViolationException' in Urho.dll An unhandled exception of type 'System.AccessViolationException' occurred in Urho.dll Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

This issue is observed in the FeatureSample Navigation when run on a UWP SharpReality platform.

utekai avatar Feb 06 '19 02:02 utekai