Game Development Community

Getting PhysX 3.2.3 to work with T3D

by Terry Barlow · in Torque 3D Beginner · 04/11/2013 (5:16 pm) · 4 replies

Written by a Noob, for a noob. For those experts out there that may see incorrect information please let me know through E-Mail(See Bio). Thanks in advance!

I figured I would share my findings as this is a question a lot of beginners like myself ask as to how to get a PhysX Full/Empty project to work.

As I understand there is more to PhysX than I know but this will get Torque to stop giving you this:

*******************************************************************

We were not able to find a valid path to the PhysX SDK!

You must install the latest PhysX SDK and set the path via a
$PHYSX_SDK_PATH variable in your buildFiles/project.conf file
or by setting the TORQUE_PHYSX_PATH system environment variable
(may require a reboot).

*******************************************************************


Well first you need the PhysX SDK which is supplied from NVIDIA's Dev website: developer.nvidia.com/physx-downloads
Follow the directions there. It may take from 30 mins to a few days to get the SDK.

Then you need to know where T3D is looking for the SDK, so go to:
{Your T3D Dir}/Torque 3D 1.2/Tools/projectGenerator/modules
Open physX.inc with Notepad or any text reader you prefer.

(Note: If you can't read every line in this file and know what it is referring to I recommend learning a bit more code before tackling T3D, but your probably just going to ignore that and that is fine.)

Look for:
// Since neither environment var worked try for 
            // the default PhysX SDK install location.
            $PHYSX_SDK_PATH = getenv("ProgramFiles") . "/NVIDIA Corporation/NVIDIA PhysX SDK/v2.8.4_win";

            // Last channce... try the x86 default install path.
            if (!file_exists($PHYSX_SDK_PATH))
               $PHYSX_SDK_PATH = getenv("ProgramFiles(x86)") . "/NVIDIA Corporation/NVIDIA PhysX SDK/v2.8.4_win";

You have one of two options here.
1) Change the dir to where you put your SDK (as long as it is within ProgramFiles or ProgramFiles(x86) as seen above)
or
2) Put the SDK files in that specific folder (may require you to create a few folders and rename one)


Now I did #2 but I changed v2.8.4 to v3.2.3 as this is the current PhysX SDK available and I like keeping my stuff organized.

Run a new project and you should have a working PhysX SDK.

About the author

Send all correction E-Mails to: h0td0g4@yahoo.com Unskilled, having fun, playing around, and helping out!


#1
04/12/2013 (9:41 am)
I'm afraid the way we create projects is misleading you a bit here. These steps do not get T3D working with PhysX 3.x, what this does is let the project generator create a project with only 3.x installed.

The reason the game works is because the precompiled dlls are included in the project. Nvidia changed the licensing a couple years ago to allow developers to redistribute them so that they were able to discontinue the system software drivers. If you try to recompile it will fail and in the process will probably delete the pre-existing dlls in the process.
#2
04/12/2013 (10:56 am)
I was figuring he would update the integration code and keep us posted here....
#3
04/12/2013 (11:33 am)
Ok so I guess this is now a thread, which now I ask how would I go about integrating PhysX 3.x into T3D now that PhysX is installed?

or is it just so far beyond what people are willing to work with that we should just forget about it now.

I have never worked with PhysX before so I haven't an idea where to start.
#4
04/12/2013 (4:28 pm)
Well, the traditional method would be to look at the currently implemented interface, see how PhysX has changed and adjust the interface to match. Since rag-doll physics and cloth simulations aren't that high on my list I've largely ignored PhysX - the built-in rigid shape physics works for what I need.