PhysX setup

If you plan on creating a project that uses PhysX you will first need to have the PhysX SDK intalled on your computer. Without the PhysX SDK in place the project generation step will fail when using either the Project Manager or manual project generation methods.

Getting PhysX

  1. In a web browser, go to NVidia's Gameworks developer page, here.
  2. If you do not already have an account, you will need to register with them and select to have access to the PhysX SDKs.
  3. If you do have an account, log in.
  4. Once logged in, go to the downloads link on the right-hand side of the navigation bar, this takes you to the downloads center.
  5. On the main downloads list, find the PhysX: Core PhysX SDK numbered 3.3.1 (At the time of writing, it is 3rd on the list).
  6. Note: If you went through the PhysX option on the navigation bar, or manually set the PhysX filter on the downloads list, it will not display 3.3.1. You will need to go to the filters on the left-hand side, under the Gameworks category, and disable the PhysX filter to see the 3.3.1 download.
  7. Download and install it to a location of your choice.

Setting Up Your Project with PhysX:

  1. Open your project in your IDE.
  2. Navigate to the T3D/Physics directory and add a new folder for physx3 and add existing files.
  3. Add all the files found under Engine\Source\T3D\physics\physx3
  4. Now you need to include the Physx SDK files
  5. Under the properties for the DLL project, under Linker -> Additional Library Directories add the lib\win32 directory for the PhysX 3.3.1 SDK. For example, C:\NVIDIA PhysX SDK\Lib\win32. Add the following directories
  6. In the same window under the C/C++ section, you should see Additional Include Directories, you need to add the Include directory for the PhysX 3.3.1 SDK. For example, C:\NVIDIA PhysX SDK\Include. Add the following directories:
    1. Include/
    2. Include/cooking
    3. Include/characterkinematic
    4. Include/geometry
    5. Include/vehicle
    6. Include/foundation
    7. Include/extensions
    8. Include/common
    9. Include/cloth
  7. Next, you'll need to include the following library files to the project. In the same window, under the Linker -> Input section, you should see Additional Dependencies. You'll want to add the following lib files from the PhysX SDK:
    1. For Release:
      1. PhysX3_x86.lib
      2. PhysX3Common_x86.lib
      3. PhysX3Extensions.lib
      4. PhysX3Cooking_x86.lib
      5. PxTask.lib
      6. PhysX3CharacterKinematic_x86.lib
      7. PhysXVisualDebuggerSDK.lib
      8. PhysXProfileSDK.lib
    2. For Debug:
      1. PhysX3CHECKED_x86.lib
      2. PhysX3CommonCHECKED_x86.lib
      3. PhysX3ExtensionsCHECKED.lib
      4. PhysX3CookingCHECKED_x86.lib
      5. PxTaskCHECKED.lib
      6. PhysX3CharacterKinematicCHECKED_x86.lib
      7. PhysXVisualDebuggerSDKCHECKED.lib
      8. PhysXProfileSDKCHECKED.lib
  8. The final step to configure the project to compile is to add the correct debug preprocessor flag. In the properties window, under the C/C++ section will be Preprocessor. Select that and edit the Preprocessor Definitions.
    1. For a Release build, add NDEBUG
    2. For a Debug build add DEBUG
  9. The project should compile correctly now.
  10. Once compiled you will need to copy the following files into your exe's directory:
    1. For a Release build:
      1. PhysX3_x86.dll
      2. PhysX3CharacterKinematic_x86.dll
      3. PhysX3Common_x86.dll
      4. PhysX3Cooking_x86.dll
    2. And for Debug:
      1. PhysX3CHECKED_x86.dll
      2. nvToolsExt32_1.dll
      3. PhysX3CookingCHECKED_x86.dll
      4. PhysX3CommonCHECKED_x86.dll
      5. PhysX3CharacterKinematicCHECKED_x86.dll
  11. Once this is completed, you should be able to run your game with PhysX support for the physics simulation.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License