[v2]pointer to a managed type problem

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
KakCAT
Posts: 22
Joined: Mon Apr 14, 2014 2:08 pm

[v2]pointer to a managed type problem

Post by KakCAT » Wed Feb 20, 2019 10:40 pm

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!

Norbo
Site Admin
Posts: 4587
Joined: Tue Jul 04, 2006 4:45 am

Re: [v2]pointer to a managed type problem

Post by Norbo » Thu Feb 21, 2019 1:29 am

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.

KakCAT
Posts: 22
Joined: Mon Apr 14, 2014 2:08 pm

Re: [v2]pointer to a managed type problem

Post by KakCAT » Thu Feb 21, 2019 2:37 pm

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! :)

Post Reply

Who is online

Users browsing this forum: Baidu [Bot] and 5 guests