favreau / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

SWIG wrapper C#, Java support: Do not use nested classes/structs/unions/enums in source to allow for SWIG to wrap the entire library. #477

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. none. the source is using nested classes/structs/unions/enums instead of 
namespaces placing those items in global scope or in a namespace. (though use 
of namespaces is not required)

What is the expected output? What do you see instead?
na

What version of the product are you using? On what operating system?
Bullet 2.77

Please provide any additional information below.
Move all nested classes/structs/enums into global scope or in namespace scope. 
Then you can provide a simple SWIG wrapper in the repo (however this step is 
not required because of how easy it is to do this). I've already completed one 
is VS2008 and would be happy to contribute.

I moved 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 requiring to trick the compiler (SWIG workaround for nested 
classes/structs). 

This is not a big deal for me because I can just keep my own git clone of the 
main bullet repo and move the classes/structs/unions/enum. This is a community 
change.

Documentation supporting this idea.
http://www.swig.org/Doc1.3/SWIGPlus.html#SWIGPlus_nested_classes

Also,
To support backword compatibility you can just typedef the new locations to the 
old locations.

I attached the SWIG interface file
and the build rule for VS2008.

Original issue reported on code.google.com by chb...@gmail.com on 24 Jan 2011 at 2:10

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for sharing the wrapper.

We are now preparing for Bullet 3.x and try to keep the Bullet 2.x API stable, 
so we cannot make those changes right now.

We'll keep it mind for future changes.

Original comment by erwin.coumans on 27 Jan 2011 at 7:35