Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to get started with PhysX.Net

📅 2013-Jun-06 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ physx,, visual studio ⬩ 📚 Archive

PhysX.Net is a .Net library that has been written as a wrapper for the PhysX library from NVIDIA. This enables you to use PhysX from C# or any other .Net language.

  1. Ensure that the PhysX SDK is installed and running correctly. This post explains how to get started with PhysX.

  2. Download the latest build or nightly build of PhysX.Net from here. Unzip the contents of the zip file. It has the PhysX.Net.dll .Net assembly file that contains the wrapper methods and classes for both x86 and x64 architectures.

  3. Download the latest source code of PhysX.Net from here. Unzip the contents of the zip file.

  4. Open the PhysX.Net-3.sln solution file in Visual Studio. Examine the Samples project, it has the code for sample programs, such as JointsSample. All of the Samples use the code from the Engine sample, which has the code common to all the Samples.

  5. Add the PhysX.Net.dll downloaded in Step 2 as a reference to all the Samples.

  6. Build the Engine sample. This produces a PhysX.Samples.Engine.dll .Net assembly file that will be used by the other Samples.

  7. Now build any of the Samples, for example, the JointsSample. This produces a PhysX.Samples.JointsSample.exe.

  8. The EXE files need the PhysX DLL files, from NVIDIA, to execute. These are the 5 files: PhysX3CharacterKinematicCHECKED_x86.dllPhysX3CHECKED_x86.dllPhysX3CommonCHECKED_x86.dllPhysX3CookingCHECKED_x86.dll and PhysX3GpuCHECKED_x86.dll. These files can be found in the NVIDIA PhysX SDK or in the Assemblies directory in the PhysX source code. Place these in the same directory as the EXE file.

  9. Now you should be able to run the EXE file directly or debug it from Visual Studio.

Tried with: PhysX.Net 102011, PhysX 3.2.4, Visual Studio Express 2012 and Windows 7 x64