I looked into the sticky XNA C# version of bullet and found it to be a little outdated so I created a new wrapper using SWIG for C#.
I ran into a issue that I'm not too worried about, but I wanted developer feedback before I continued.
Currently I have about 90% of the classes within scope of the Hello World wrapped using the SWIG director feature, but some of the helper classes/structs are nested within a class instead of global/namespace scope. SWIG can't wrap nested classes/structs ATM, but they do provide a work around which essentially has me redefine the class in global/namespace scope and then typemap the old class path to the new path. Personally I rather just move the nested classes out into global or a namespace to resolve the issue instead of having to keep track of these exceptions when development moves forward.
My suggestion is to move these classes (maybe all of them) out of a nested status. SWIG pretty much wrapped the entire project without much effort and I suspect it would be nice to provide wrappers with the source.
edit:
I guess I should give an example
I move btRigidBody::btRigidBodyConstructionInfo to global scope, and changed it in all the src in a few minutes. Now SWIG can wrap that struct and all of its members without any effort from me to trick the compiler (SWIG workaround for nested classes/structs). It's not a big deal because I can just keep my own git clone of the main bullet repo, but if others wanted to use the wrapper they would need todo the same or use the SWIG workaround.
SWIG C# Wrapper for Bullet2.77
-
- Posts: 1
- Joined: Wed Mar 09, 2011 11:41 pm
Re: SWIG C# Wrapper for Bullet2.77
I'm presently also engaged in creating such a wrapper (for Java and Android). Can we swap notes (I have it working, with many classes wrapped with Directors etc, but the Garbage Collector eventually is crashing the app).