Using BEPU with OpenTK

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
aeroflyluby
Posts: 4
Joined: Thu Jan 29, 2015 7:04 pm

Using BEPU with OpenTK

Post by aeroflyluby »

Hello everybody.

I used BulletSharp which has really nice feature - it can be compiled with OpenTK math classes instead of using its own. It allows for really good integration because it makes unnecessary casting and explict converstions just disappear.
However, I haven't found similar option in BEPU physics, as it seems to use its own math classes from BEPUutilities. Those classes differ a bit from that which OpenTK use, so replacing won't work here.

My question is: Is it possible, or maybe someone managed to do it, to compile BEPU against OpenTK so it can share math classes?

Thank you, best regards.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Using BEPU with OpenTK

Post by Norbo »

There's no automatic way to do it, unfortunately. I used to maintain some forks for different math libraries, but it becomes an enormous hassle when there isn't a perfect mapping.

One of the easier approaches to ease the transition is to use implicit conversions, like the OpenTK fork does. You could do something similar, but based on the more recent development version.

You still end up paying the small performance tax for doing the conversion, but it can get rid of a lot of the developmental annoyances.

Notably, there's a good chance BEPUphysics will eventually move to the SIMD types once they get solidified. My guess is a lot of other libraries will do the same, so this issue will be mitigated somewhat.
aeroflyluby
Posts: 4
Joined: Thu Jan 29, 2015 7:04 pm

Re: Using BEPU with OpenTK

Post by aeroflyluby »

Norbo wrote:There's no automatic way to do it, unfortunately. I used to maintain some forks for different math libraries, but it becomes an enormous hassle when there isn't a perfect mapping.

One of the easier approaches to ease the transition is to use implicit conversions, like the OpenTK fork does. You could do something similar, but based on the more recent development version.

You still end up paying the small performance tax for doing the conversion, but it can get rid of a lot of the developmental annoyances.

Notably, there's a good chance BEPUphysics will eventually move to the SIMD types once they get solidified. My guess is a lot of other libraries will do the same, so this issue will be mitigated somewhat.
I actually switched from BulletSharp to BEPU original in less than 2 hours today and it works great! I added some implict conversion operators for Vectors, Quaternion and Matrix and this library is great.
It's far more straightforward to use than bullet too :)
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Using BEPU with OpenTK

Post by Norbo »

Glad it's working for you! :)
Post Reply