Page 1 of 1

[v2]pointer to a managed type problem

Posted: Wed Feb 20, 2019 10:40 pm
by KakCAT
I'm trying to create a brand new project (so far I've only been playing inside the Demos project) using MonoGame and Bepu 2.

When creating an INarrowPhaseCallbacks to feed the Simulation object, I'm getting those errors:

Code: Select all

error CS0208: Cannot take the address of, get the size of, or declare a pointer to a managed type ('ConvexContactManifold')
error CS0208: Cannot take the address of, get the size of, or declare a pointer to a managed type ('NonconvexContactManifold')
error CS0208: Cannot take the address of, get the size of, or declare a pointer to a managed type ('ConvexContactManifold')
Is there any switch in the project, or something I might be missing to allow those pointers?

( the project is a .NET 4.7.1 because MonoGame can't work with net core 2 yet. Is this a net core feature? )

Thanks!

Re: [v2]pointer to a managed type problem

Posted: Thu Feb 21, 2019 1:29 am
by Norbo
That's pretty strange. The contact manifolds definitely aren't managed types. Are there any other errors? It may be that the dependency resolution for the System.Numerics stuff failed somehow and so it can't see that Vector3 is unmanaged, so you get this as a side effect barf.

This may be related: https://github.com/dotnet/corefx/issues/30106

Could try directly adding the System.Numerics.Vectors nuget dependency to the desktop project.

Re: [v2]pointer to a managed type problem

Posted: Thu Feb 21, 2019 2:37 pm
by KakCAT
As you said, adding System.Numerics.Vector (via nuget, got 4.5.0) allowed me to compile the program with .NET 4.7.1 For some reason it was automatically referencing S.N.Vector 4.1.3.0 instead

Thanks again! :)