Submitted by , posted on 19 April 2005



Image Description, by


This is a simple physics demo showing off the C# wrapper I wrote for Novodex. Once complete I'll release the wrapper. This demo is built upon an editor which I've been making. For simplicity I've stripped the editor down, but there is some editor functionality left. That's what differentiates this phsyics demo from the usual 'knock the box pile over' demo. Of course you can still knock box piles over, but you can also create and manipulate objects well enough to build your own stuff to play with. The renderer is pretty slow. Using a simple renderer with D3D is rather slow, it's not as tolerant to ugly unoptimized data like openGL is.

Wrapping Novodex was much more difficult than I thought. At first I was hoping to just call functions and methods directly from the Novodex DLLs but that wasn't really feasible. I ended up writing a C interface wrapper to talk with Novodex. Even with the extra layer it was difficult passing some of the more complex structures back and forth because it was impossible to get the C# structures to be bitwise identical to the C++ structures, even using LayoutKind.Explicit. In some cases I resorted to manually passing lots of parameters. In the end that is probably better because it will be more compatible with future Novodex DLLs where the structures probably won't be laid out identically.

Go to http://www.zelsnack.com/jason/JttZ/ to download the demo and to get links to DirectX and .NET runtimes. I would like to know if this still runs on .NET 1.1 or it only runs on .NET 2.0. I know it only runs on the April 2005 version of DirectX because every version of managed DirectX seems to be incompatible. It sure is great to require people to download 60MB of stuff to run an 820KB program.



[prev]
Image of the Day Gallery
www.flipcode.com

[next]


 


Copyright 1999-2008 (C) FLIPCODE.COM and/or the original content author(s). All rights reserved.
Please read our Terms, Conditions, and Privacy information.