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_microsoft_02

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

PhysX Setup_javascript_03

PhysX Setup_解决方案_04

PhysX Setup_javascript_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_javascript_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_解决方案_09

PhysX Setup_解决方案_10

PhysX Setup_microsoft_11

Include files

PhysX Setup_microsoft_12

PhysX Setup_microsoft_13

参考

https://pages.cpsc.ucalgary.ca/~mmactavi/585/PhysXSetup.pdf


Building with PhysX — NVIDIA PhysX SDK 4.0 Documentation

NVIDIA® PhysX® SDK for Windows ReadMe

PhysX SDK 4.0在Win7下的编译生成

安装DirectX SDK时出现Error Code:s1023 的解决方案

在VS2015中创建一个Physx工程

Unite 2014 - PhysX 3 in Unity 5