Using BEPU with Unity3d ?

Discuss topics related to BEPUphysics or physics engine development.
Post Reply
Runner
Posts: 2
Joined: Sun Apr 19, 2015 7:57 pm

Using BEPU with Unity3d ?

Post by Runner »

Hello all,

As the title says, I would like to try this engine with Unity3d, since PhysX seems to cause me so much headache :) (well, it don't really work, mostly).
It seems Bebu cannot compile with .NET 3.5 (that Unity uses) , but another user had a working example/fork anyway. I looked at it but couldn't get it to compile with 3.5 ( about 1700 errors).
Anyone has a clue on how to achieve this ?

Thanks,

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

Re: Using BEPU with Unity3d ?

Post by Norbo »

The engine itself should compile without much fuss for 3.5. If you're seeing thousands of errors, it's probably just a few errors in BEPUutilities causing an enormous number of errors in BEPUphysics due to the missing dependency.

The steps to compile for 3.5 look something like:
1) Make sure every project is set to 3.5.
2) Remove the WINDOWS compilation symbol from the BEPUutilities project build properties. This makes the build fall back to the Xbox360's support level, which is compatible with 3.5. Issues have been reported with ALLOWUNSAFE and the unity webplayer, so if you hit some weird errors at runtime consider getting rid of it too.
3) Change ParallelLoopWorker.Dispose's getToWork.Dispose to getToWork.Close.

I believe it should then compile successfully.
Runner
Posts: 2
Joined: Sun Apr 19, 2015 7:57 pm

Re: Using BEPU with Unity3d ?

Post by Runner »

That did it ! Thanks !

Would it be an idea to have a fork with these fixes ? Bet this will come up a lot.

Thank you for the incredible fast response. I'm not used to that on the PhysX forums.

EDIT: For it to work you have to add the DLLs to the Asset folder in Unity. It's not enough adding them as references to Visual Studio.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Using BEPU with Unity3d ?

Post by Norbo »

A fork wouldn't be a bad idea (though there aren't all that many changes involved), but I usually leave creation and maintenance of corner case forks up to the users. You could make one if you wanted :)
Post Reply