Jump to content

PhysX 3.3.x guide


Timmy

Recommended Posts

Well it has been a very long time since I touched the standard PhysX 3 in T3D so thought i better write a guide how to use it now as a few things have changed from the PhysX side.


NVidia no longer supply up to date binaries of PhysX 3 but they will give access to the complete source code instead on github(don't mistake this as PhysX is now Open Source because it's not). I won't run through how to clone a repository as there are so many great guides on the net but firstly you will want to go here and follow the instructions about how to access the source code https://developer.nvidia.com/physx-source-github . Once you have an account the source code is here https://github.com/NVIDIAGameWorks/PhysX-3.3


Once you have cloned the repository you should have a directory structure like so


http://i.imgur.com/R0nOot1.jpg


If you go into PathToPhysxSource\PhysXSDK\Source\compiler you should find you IDE choice. With Visual Studio just open up and compile a debug and a release build. Should be fairly straight forward no other mods etc needed here.


Now when that is complete we need to create an environment variable called TORQUE_PHYSX3_PATH and point it to the PhysXSDK within your PathToPhysxSource directory like so


http://i.imgur.com/4MLp8mx.jpg


Due to the changes in how PhysX is now distributed it's almost impossible to make the default project manager work with all the different IDE versions and folder names, so i have created a CMake module to handle this. The PR for that is here https://github.com/GarageGames/Torque3D/pull/1488 and will most likely be in the main T3D development branch sometime in the near future.


Anyway back to CMake, it's pretty easy just select PhysX 3 and if all of the above is ok it should be happy days


http://i.imgur.com/u75sxP7.jpg


Just don't forget to build the INSTALL project in Visual Studio to actually install the DLL files into your project. I will try and find time to get this working in Linux too as the current CMake module only supports windows for now.


*Tested with PhysX 3.3.4

Link to comment
Share on other sites

Do try out the new CMake module i created above [mention]chriscalef[/mention] (if get a chance of course ).


Got linux working too now, i will upload these changes to the CMake module soon.


Talking of linux [mention]JeffR[/mention] , the latest development branch doesn't compile, there are a few minor problems with the taml stuff that was added. Will do a seperate PR for that.


http://i.imgur.com/KwBqPVZ.jpg

Link to comment
Share on other sites

  • 2 weeks later...

Went to try testing this last night(sorry for taking a bit to get to it) and I went about grabbing the github build of PhysX, set up the environment variable, and then made sure I was using the latest of CMAKE. Ran through the config step though, and I got no errors, but it wasn't able to find the PhysX paths.


Any ideas?

Link to comment
Share on other sites

Hey all good @JeffR there is no hurry with it, i still gotta add the linux side to the original PR i sent as i got all that working too.


What compiler/ide are you using there jeff? Is the environment variable you set definitely pointing to /PhysX-3.3/PhysXSDK ? Perhaps i should have set it up to just point to the root physx folder rather than the PhysXSDK folder within it.


For anyone else reading that folder called PhysX-3.3 could be named anything you like, i just left it at that because if you clone the physx repo that is the default folder name.

Link to comment
Share on other sites

Was using VS2013.


And yeah, I put it to the PhysXSDK path specifically from the grabbed repo and extracted folder. Pretty sure you don't have to restart Windows to get env vars to take effect, or at least I don't remember needing to do that...

Link to comment
Share on other sites

  • 2 years later...

PhysX 3.3.4


I was getting error at compile time, using vc14win64 on VS2015 SP3.

 

Severity Code Description Project File Line Suppression State

Error C2373 '__pfnDliNotifyHook2': redefinition; different type modifiers PhysXCooking C:\Users\Red\Documents\PhysX-3.3-master\PhysXSDK\Source\PhysXCooking\src\windows\WindowsCookingDelayLoadHook.cpp 64


which links too:

PfnDliHook __pfnDliNotifyHook2 = delayHook;

 

The solution I had was to have created a "#define DELAYIMP_INSECURE_WRITABLE_HOOKS" in PhysX-3.3-master\PhysXSDK\Source\ PhysX\src\ windows\NpWindowsDelayLoadHook.cpp


https://github.com/NVIDIAGameWorks/PhysX-3.3/pull/73/commits/dcd8d9e256bbfd8b41a39b1a30666a60447fb608

Link to comment
Share on other sites

  • 2 weeks later...

PhysX 3.3.4


I was getting error at compile time, using vc14win64 on VS2015 SP3.

 

Severity Code Description Project File Line Suppression State

Error C2373 '__pfnDliNotifyHook2': redefinition; different type modifiers PhysXCooking C:\Users\Red\Documents\PhysX-3.3-master\PhysXSDK\Source\PhysXCooking\src\windows\WindowsCookingDelayLoadHook.cpp 64


which links too:

PfnDliHook __pfnDliNotifyHook2 = delayHook;

 

The solution I had was to have created a "#define DELAYIMP_INSECURE_WRITABLE_HOOKS" in PhysX-3.3-master\PhysXSDK\Source\ PhysX\src\ windows\NpWindowsDelayLoadHook.cpp


https://github.com/NVIDIAGameWorks/PhysX-3.3/pull/73/commits/dcd8d9e256bbfd8b41a39b1a30666a60447fb608

 

Hey

fix code

PfnDliHook __pfnDliNotifyHook2 = delayHook; to const PfnDliHook __pfnDliNotifyHook2 = delayHook;

everything will be fine ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...