[ODE] Ode.NET

Jason Perkins starkos at gmail.com
Thu Nov 2 11:31:15 MST 2006


I just checked in the bulk of an API-level .NET binding. I still have
to work my way through some of the support headers like error.h,
memory.h, etc. but the main API is done. I have done very little
testing in order to get it done quickly, so I'll be counting on
feedback to catch any problems.

I decided to put in the functions requiring the unsafe modifier, such
as dBodyGetPosition() and the like. I expose the unsafe function with
"Unsafe" tacked on the end, and then a wrapper you can use if you
don't want to enable unsafe mode in your own code.

  public class d {
    public unsafe Vector3* BodyGetPositionUnsafe(IntPtr body);
    public Vector3 BodyGetPosition(IntPtr body) {
       unsafe { return *BodyGetPositionUnsafe(body); }
    }
  }

There is also a `--no-unsafe` switch on the premake script so you can
exclude all unsafe code if you want, but I haven't implemented all of
the Copy...() replacements yet, in my ideological battle against
unsafe code ;)

I am going to finish binding all of these support functions, and then
I'll start looking into implementing a higher-level API.

Enjoy, feedback welcome.

Jason


More information about the ODE mailing list