C# port of Box2D.

I think you need to grab the code and put it into an XNA project then re-compile it against the compact framework.
JeffWeber wrote:I think you need to grab the code and put it into an XNA project then re-compile it against the compact framework.


Care to elaborate? 🙂
Alright, I got it to work.

1) Checkout the code from the Box2DX svn ( http://box2dx.googlecode.com/svn/trunk/ )

2) Test the projects, make sure the lib compile and that you can run the testbed

3) Remove all previous reference to the Box2DX dll in your windows/xbox game

4) Add these projects to your game solution (I don't know if this is necessary or not, but makes life easier anyway)

5) Add a reference to these projects (not the dll, the project itself) in your game (I think you might have to manually add a reference for both Windows and Xbox projects separetly)
Okay, so rather than linking the DLL directly we have to link a project? Interesting, lol.

Vandash wrote:1) Checkout the code from the Box2DX svn ( http://box2dx.googlecode.com/svn/trunk/ )


But with this part, what do we download there? I just see links up the top rather than a proper webpage, what do I need from there? Is there actually a project that we download and we use rather than the DLL ?
I suggest you use a svn client to checkout the code, as stated in http://code.google.com/p/box2dx/source/checkout

Follow the link on the bottom ( http://subversion.tigris.org/links.html#clients ) and download any svn client. I myself prefer using Tortoise SVN : http://tortoisesvn.tigris.org/
Vandash wrote:I suggest you use a svn client to checkout the code, as stated in http://code.google.com/p/box2dx/source/checkout

Follow the link on the bottom ( http://subversion.tigris.org/links.html#clients ) and download any svn client. I myself prefer using Tortoise SVN : http://tortoisesvn.tigris.org/


Oh, I've used Tortoise SVN before. But I just went in and downloaded all the code manually 😛 Seems to work fine, though slower. Still checking to see if the code will work, but I reckon it will.
Great! I got this to work! 😀

Well... kinda... the physics initialized and everything but when I tried to do a Raycast I got this error:
An unhandled exception of type 'System.InvalidProgramException' occurred in Box2D.dll

And I got it in the 'Raycast' function in Box2DX.Dynamics.World at this specific line:
int count = _broadPhase.QuerySegment(segment, results, maxCount, RaycastSortKey);

Works fine in the Windows version, but not on the Xbox 360.
Any help?
Hi All! Sorry for the silence on air, but there is not free time at all. I think that I will be able to continue my work on Box2DX from June - July, since I will have one place of work instead of two as now.

BTW I have added Box2DX_XBox360 project to solution, so you will be able to find Box2DX_XBox360.dll in Output folder after its compilation. Please let me know if there will be any problems with this.

Thanks!
looking for some advise from anyone knowledgeable enough on this thread.

For a long while I've been planning on making a physics intensive platformer in xna. To date I have a level editor created and have gotten a start at a physics engine. But as I got into the actual physics code I began to realise the amount of time I'd spend debugging the physics to become reliably stable would make it preferable to use a pre-made physics engine instead. Box2dx looks ideal, except for the fact it does not claim to scale well with large worlds, in the broadspace.cs comments it recommends to use multi-SAP instead of SAP to overcome this. I already have a system very similar to multi-SAP written in my physics engine, and it sounds like the ideal collision detection method or me.

I am hobbyist programmer. I'm fairly confident that i have a thorough knowledge of the c# language and that i understand the fundamental concepts of multi-SAP and how to implement it. The Box2dx code however is not the easiest to read and I'm not yet too sure how and if someone like me could go about modifying it to use multi-SAP instead. Performance is not a huge issue for this game, there most likely won't be more than 5 dynamic objects in the screen at any given time, more important is that the performance scales well over a wide world space.

Could anyone offer some advise as to how to approach something like this or give me a hint of how much trouble i might be getting into?
Firstly, premature optimization is bad. Are you sure you need this? Broadphase is not usually a bottleneck in Box2D, I'm told. You might also want to consider other broad phases, such as a quadtree, researching the differences in ease of implementation and performance.

If you're still keen, I'd search the bullet forums, where Multi-SAP has already been implemented.

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