C# port of Box2D.

Hi.

I would like to make C# port of Box2D. At this moment I'm not planning any changes in code, and my aim is - pure Box2D (C#) for XNA. I would like to know, is there a necessity in such project?

Thanks.
Personaly, I would love to see a non-xna port. But I'm guessing there's enouogh interest.

Edit: Btw, I do remember seeing a C# port using XNA, but I'm not sure.
Only Vector2(3,4), Matrix structures and maybe MathHelper members will be used form XNA, but other than that port will be XNA independed. However, it is not so hard to implement structures described above 🙂.

p.s. Sorry for my English, It's not my native language.
There is no port of Box2D to C# or XNA. We have C++, Java, and AS3 as the main ports.

I recommend starting from the SVN version, which will be out shortly as version 2.0.

I think an XNA port would be great since MS has opened up Xbox Live to all developers.
I'm very interested in a complete c# port of Box2D.

I developed the Farseer Physics Engine (see sig. below) based off of Erin's earlier version of Box2D. I don't have the time to tackle this new version but have been coming back to these forums frequently to see if anyone else has taken it on.

Hope to see you finish this. I think you will find a LOT of interest in this from XNA, Silverlight, and WPF developers. I know I have with Farseer.

Are you planning to start a project site for this? Codeplex, GoogleCode...other? I'd like to follow the progress.

Good luck.

-Jeff Weber
Farseer Games - Physics Powered Games for the Web
Farseer Physics Engine - 2D Physics Engine for Silverlight and XNA
Let me know if you need any help with this. I'm a total C# noob - just started looking into it this week - but from what I know about C#, it seems that Java->C# would be incredibly easy to do, and I'm one of the maintainers of the Java Box2d port. Unfortunately we're not done with the 2.0 port yet, that will come a bit after the C++ one is released for real.

It looks like at one point Microsoft was even maintaining an automated tool to do just this (Java->C#), has anyone ever used it? I imagine anything like that is going to fail in some cases, but it might be useful for a first run. At the very least it would probably clean up any small syntax issues that you'd otherwise have to handle case by case.

I would personally suggest using the Vec2 and Mat22 classes that are internal to Box2d so that there are no XNA specific dependencies. Those classes are clean and simple to port, and they are used so much that if they relied on XNA, you'd essentially be shutting off use of the engine to anyone that wasn't using it.

If you do decide to take it on from scratch (C++ -> C#), skatehead (the AS3 maintainer) and I can help you out with any issues you run into - we hit a lot of the same bugs when doing our versions, so it's likely you'll hit some of them, too, though the existence of the struct in C# will help with some of that (and also likely lead to better performance than Java can get).
JeffWeber wrote:Are you planning to start a project site for this? Codeplex, GoogleCode...other? I'd like to follow the progress.

I created a new project on CodePlex, its name is Box2DX. I started porting and already finished with Common section of code.
Now Box2DX is in unpublished state. I will publish it later, when Collision section will be finished. I think that it will happen in 2-3 weeks, all depends on my work load on main work.
Ok, great. I'll keep an eye on it.
Hi ALL.

I'm glad to report that work-in-progress. I moved Box2DX project from codeplex to googlecode: http://code.google.com/p/box2dx/

Thanks.
Just note: I have just finished porting of Collision section of Box2D, please see http://code.google.com/p/box2dx.
Thanks.

Original thread: https://box2d.org/forum/viewtopic.php?t=481