Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing NavigationMesh.FindPath using parameter-ref in binding-call #71

Merged
merged 1 commit into from Nov 5, 2021

Conversation

dertom95
Copy link

@dertom95 dertom95 commented Nov 5, 2021

NavigationMesh.FindPath did not find any results. The start and endpoint were valid points on the navmesh.
I added some logs in the glue.cpp-layer and could see that the start- and end-values (vector3) were not the expected values.
Changing the glue-code function-signature to use vector3 parameters with ref keyword did the trick. Not sure why, but after that the right values were passed down to the cpp-layer.

@elix22
Copy link
Owner

elix22 commented Nov 5, 2021

Good catch .
It make sense , the underlying native function expects two Vector3 by reference
https://github.com/elix22/Urho3D/blob/dotnet/Source/Urho3D/DotNet/glue.cpp#L304

Not sure who implemented it , it wasn't me :)
In addition there is a memory leak on the native side , this one is never freed
https://github.com/elix22/Urho3D/blob/dotnet/Source/Urho3D/DotNet/glue.cpp#L312

@elix22 elix22 merged commit 531556f into elix22:dotnet Nov 5, 2021
@elix22
Copy link
Owner

elix22 commented Nov 5, 2021

I fixed the memory leak , will be part of the upcoming binaries , with additional fixes

4b5f08c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants