0% found this document useful (0 votes)
12 views

Phys XSetup

Uploaded by

Pierre Lam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Phys XSetup

Uploaded by

Pierre Lam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

PhysX Setup

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
Download PhysX 4.0 as a .zip file
https://github.com/NVIDIAGameWorks/PhysX
In the extracted PhysX directory, run the generate_projects.bat script to create the Visual Studio project
files
Select the appropriate version number
Now in the compiler/(VSversion) directory, you should have a
PhysXSDK.sln file.
NOTE:

Under your project’s Properties -> C/C++ -> Code Generation, verify that your setting for “Runtime
Library” is the same for both your PhysX SDK project and your game’s project.
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

The sdk_snippets_bin subdirectory has a .sln file containing all the available PhysX Snippets
(examples)
Build the Snippets solution.
You can set one of the projects as
the StartUp Project so it will run
once the solution is built.
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
You need: the include files, DLLs, and .lib files

Navigate to physx\bin\(your build version)\checked (or \debug)


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.
Copy all DLL files to the same directory as the .exe file that runs your game
Copy all .lib files to your project’s lib directory.
Include files

Copy everything from the physx\include directory into your project’s include directory.
Do the same with the “include” folder in the pxshared directory that should have also been
included in the .zip download of the PhysX Git repository.

You might also like