C# port of Box2D.

Excellent. Thank Ihar.

I will grab it now.
ihar3d wrote:
Hi!

I updated Box2DX to Box2D 2.0.1 (r149) and Box2DX obtained BETA status. Bug in contact solver, which caused destruction of pyramid as example, was fixed. More tests were added into TestBed, soon will be more. I uploaded Box2DX-2.0.1b-DemoSuite.zip, please see http://code.google.com/p/box2dx/downloads/list. Still there is a problem in broadphase and I'm trying to solve it. Also reference to IClonable was deleted.

Thanks!


This is great stuff, will make writing editors easier than having to type those numbers in by hand 🙂 would the broadphase cause the problem with the "Simple Test" when you set the box's Restitution to 0.75f ? looks like it shouldn't be doing that to be honest.

Keep up the great work, kudos to both you and Erin.
ihar3d wrote:
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.


Also this summer they will be releasing the tools to make games for the Zune using XNA. Box2D would be great for Zune games I bet 😀
I don't know if this is the right place to ask, but...
As I look at the Box2DX source code, I'm just wondering, there are so many functions that accept for example Vector2 parameters. These functions don't actually modify the Vector2's or anything, but yet they don't use the ref keyword. A simple observation can point you that there is significant speedup with ref's even with so simple types... If the guys who port this thing to C# aren't concerned with speed than the port is worth nothing...
Quote:
As I look at the Box2DX source code, I'm just wondering, there are so many functions that accept for example Vector2 parameters. These functions don't actually modify the Vector2's or anything, but yet they don't use the ref keyword. A simple observation can point you that there is significant speedup with ref's even with so simple types... If the guys who port this thing to C# aren't concerned with speed than the port is worth nothing...

I will make an attempt to explain simply...
Now Box2DX has BETA status, and it means that main aim is find and fix bugs. Unfortunately I don`t have enough time for working on Box2DX, but I hope that situation will be better in June. I will improve performance between RC and RELEASE. And would be better to get bug reports from potential users, but not ostensible recommendations.
ivailo91 wrote:
I don't know if this is the right place to ask, but...
As I look at the Box2DX source code, I'm just wondering, there are so many functions that accept for example Vector2 parameters. These functions don't actually modify the Vector2's or anything, but yet they don't use the ref keyword. A simple observation can point you that there is significant speedup with ref's even with so simple types...


1) if they don't modify the values why the need for ref ?
2) In my bench tests, using by value is slightly faster over a million iterations, this is OK for Vector2 as the size of it fits in well how the IL works, anything lower than 16-24 bytes (can't remember which) should have no performance difference than by passing by value or ref, I'd like to see proof otherwise to which you came to your conclusions or a citation to your observation, C++ != c# so don't assume they work the same way when passing by ref.

ivailo91 wrote:
If the guys who port this thing to C# aren't concerned with speed than the port is worth nothing...


This is stupid in itself as the performance is not only fine, but if it's slightly slower than its C++ equivalent and you are so worried then maybe you shouldn't be using c#, if anything its useful for creating tool to generate the data needed and that's if the performance wasn't quick enough, which it is.

So if you think this port is worth nothing to you, fair enough, the code's there to do a better one, I guess for the rest of us, it's worth more than nothing.


EDIT: you can also change from structs to classes if you think it will make a difference.
Weird, I downloaded the latest dll's form the TAO framework and referenced the 3 missing dll's to my project. Now, when I try to run it I get an exception telling me it can't find 'freetype6.dll'.
Hi ihar3d,

I've used your port of Box in a library focused on multiplayer gaming in .Net. http://entanglar.dunnchurchill.com

Cheers 🙂
SaphuA wrote:
Weird, I downloaded the latest dll's form the TAO framework and referenced the 3 missing dll's to my project. Now, when I try to run it I get an exception telling me it can't find 'freetype6.dll'.


I have the same issue. Maybe the latest Box2DX source is out of sync with the latest Tao release or something. I tried puting freetype6 in the same folder as the exe and even in System32 and it still told me it couldn't load it.

The other possibility is that freetype6 has a dependency that we dont have.

ihar3d, can you put all the dependent dll's in the Libarary folder?
Quote:
when I try to run it I get an exception telling me it can't find 'freetype6.dll'.


The same thing happened to me. It was a dependency on zlib1.dll; I grabbed a copy of that from somewhere and it works.

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