Skip navigation.

A Blag About Graphics and Programming

...and Stuff

Compiling PhysX.Net

,

NVidia is giving away PhysX for free for quite some time now. And since it has hardware acceleration on PhysX cards and on CUDA enabled GeForces and some fun features like cloth, soft bodies, why not try it?

I'm slowly moving all of my coding needs to C#, so I needed a PhysX .NET wrapper. You can find a list in this gd.net forum post. Most of them seem kind of dead, the only one that shows some activity is PhysX.Net, so it's either the best maintained or the buggiest :wink:

The binaries are a bit old and use PhysX 2.8.1.4 SDK, while the latest version, I believe, is 2.8.1.15 .
So it's probably better to get it via SVN and compile it yourself. This proved to be a bit tricky:
  1. Download PhysX SDK;
  2. Download PhysX System Software;
  3. Open PhysX.Net.sln. You'll probaly get some errors that it can't load the sample projects. That's because you need XNA Game Studio installed. So either install it or not, your choise.
  4. Select which graphics library (XNA, SlimDX, MDX) you'll be using from the Solution Configuration dropdown list. For example, choosing SlimDX means that PhysX.Actor.GlobalPose will return a SlimDX.Matrix;
  5. If you chose SlimDX, open stdafx.h, find the line
    #using <C:\Program Files\SlimDX (September 2008)\SlimDX.dll>
    
    and change it to something like
    #using <C:\Program Files\SlimDX SDK (November 2008)\Bin\x86\SlimDX.dll>
    

  6. Try compiling it. If it works- great, but you might get an error about "afxres.h" not found. Open Resources.h and replace the line
    #include "afxres.h"
    
    with
    #include "windows.h"
    (more info)
  7. Enjoy;


A bit off-topic. Apparently, a lot of random visitors come here after googling "SlimDX". I'm not sure what they're looking for, but allow me to say this: it is good. Use it! They already started wrapping D3D11!

Global Game Jam

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies

December 2009
M T W T F S S
November 2009January 2010
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31