Before we start with PhysX...

Make sure you have CMake installed: https://cmake.org/

As well as the DirectX SDK: https://www.microsoft.com/en-ca/download/details.aspx?id=6812

Note: If your DirectX installation fails, uninstall all “Microsoft Visual C++ 2010 x32 or x64 Redistributable - 10.XXXX” from your machine and try the installation again

PhysX Setup_软件

Download PhysX 4.0 as a .zip file

https://github.com/NVIDIAGameWorks/PhysX

PhysX Setup_PhysX_02

In the extracted PhysX directory, run the generate_projects.bat script to create the Visual Studio project files

PhysX Setup_软件_03

PhysX Setup_软件_04

PhysX Setup_软件_05

Build modes

the debug build can be useful for error analysis, but contains asserts used for SDK development which some customers may find too intrusive for daily use. Optimizations are turned off for this configuration.

the checked build contains code to detect invalid parameters, API race conditions, and other incorrect uses of the API which might otherwise cause mysterious crashes or failures in simulation.

the profile build omits the checks, but still has PVD and memory instrumentation.

the release build is built for minimal footprint and maximum speed. It omits most checks and instrumentation.

Running Snippet/Sample code

PhysX Setup_软件_06

PhysX Setup_PhysX_07

Linking to your Project

You need: the include files, DLLs, and .lib files Navigate to physx\bin\(your build version)\checked Copy all .dll files into your directory with your exe, copy all .lib files to your project’s lib directory. Navigate to physx\include and move folder content to your project’s include directory. Do the same with the pxshared\include folder Make sure to link the PhysX libraries to your project

Linking to your Project

PhysX Setup_软件_08

NOTE:

To link against your project, you will want to use the DLLs and .lib files generated in debug mode when you are also running your project in Debug mode, and use the files generated in checked mode when you are running your project in Release mode. If your project gives you linker errors or other unexpected issues when you try to build it, verify that you are using the appropriate .dll and .lib files for your build configuration.

PhysX Setup_PhysX_09

PhysX Setup_PhysX_10

PhysX Setup_软件_11

Include files

PhysX Setup_PhysX_12

PhysX Setup_软件_13

参考