PhysX 3.x Plugin
by Timmy01 · in Torque 3D Professional · 10/28/2013 (5:11 am) · 500 replies
Update:
If you wish to follow this than please check here github.com/ChrisCalef/Torque3D/tree/physx3_advanced_WIP
If you wish to follow this than please check here github.com/ChrisCalef/Torque3D/tree/physx3_advanced_WIP
About the author
#362
07/22/2014 (12:09 am)
Yeah at some stage in the future it will. I'm really busy at the moment implementing some Apex modules which will take awhile. Still have to finish the vehicle stuff too. Put joints down as number 3 on the list ;-)
#363
07/22/2014 (12:40 am)
OK cool, yeah the Apex stuff looks pretty neat.
#364
07/22/2014 (1:32 am)
I dropped the general enhancements part of the title because i'm only concentrating on physx 3 stuff from here on out (i mentioned this a few pages back).
#365
Apex will be a separate module from physx and will need be selected manually like so:

That is my own personal build of T3D where i have completly removed bullet and physx 2.8 among other things.
I have the framework all setup and working, the scene simulates through apex. Now it's the fun job of implementing the different apex modules, my main priority is destructible stuff and there is two different methods to do this. Use the Apex rendering API or do as UE4 does and import the apex asset and convert it to a skeleton mesh. I'm undecided at the moment, will do some testing. I think i will go the Apex rendering API because i want to support particles and turbulence and i think it might be easier in the long run to use the Apex rendering API. I'll see how it goes.
07/25/2014 (6:55 pm)
Slowly getting there with the Apex stuff. Using the PhysX Lab sure is a faster way of getting destruction stuff up and running. Even noob artists like me can use it lol.Apex will be a separate module from physx and will need be selected manually like so:

That is my own personal build of T3D where i have completly removed bullet and physx 2.8 among other things.
I have the framework all setup and working, the scene simulates through apex. Now it's the fun job of implementing the different apex modules, my main priority is destructible stuff and there is two different methods to do this. Use the Apex rendering API or do as UE4 does and import the apex asset and convert it to a skeleton mesh. I'm undecided at the moment, will do some testing. I think i will go the Apex rendering API because i want to support particles and turbulence and i think it might be easier in the long run to use the Apex rendering API. I'll see how it goes.
#366
I'm currently using T3D 3.0. Do I need to update to the latest version of T3D to use the PhysX?
08/05/2014 (8:33 am)
I'm looking to add PhysX to my project but I'm not sure where to start. I mainly need PhysX for my vehicles to interact with objects in the mission. Can I use basic or do I need advance?I'm currently using T3D 3.0. Do I need to update to the latest version of T3D to use the PhysX?
#367
08/05/2014 (5:52 pm)
The code should run ok with 3.0. The vehicle stuff is in the advanced branch. If you only want to use the basic version but also have the vehicles take a look at physicsBody and Px3Body from advanced and look for the new moveKinematicTo functions. The only other change is with the vehicle class itself too, once again just copy this from the advanced version.
#368
08/05/2014 (6:24 pm)
That's good I can use the PhysX with T3D 3.0. Is there a big difference between basic and advanced?
#369
CCD.
Cloth.
Particles.
Vehicle fixes to integrate with physics scene.
Per triangle terrain materials.
RigidPhysicsShape for better integration with default T3D objects.
Check the original post it goes into a little more details and shows a few vids and some pre-compiled demos
08/05/2014 (7:01 pm)
Yeah advanced has these extras:CCD.
Cloth.
Particles.
Vehicle fixes to integrate with physics scene.
Per triangle terrain materials.
RigidPhysicsShape for better integration with default T3D objects.
Check the original post it goes into a little more details and shows a few vids and some pre-compiled demos
#370
08/05/2014 (7:05 pm)
I see. I checked out the demos and I really liked the vehicle physics would like to get it working in my game. How hard would it be to add PhysX to a existing project?
#371
Instructions for setup can be found here github.com/rextimmy/Torque3D
08/05/2014 (7:22 pm)
The vehicle physics really is just a "hack" of sorts to make it work against physics objects, it's not a true physics car. The work on real physics car i haven't completed yet.Instructions for setup can be found here github.com/rextimmy/Torque3D
#372
08/05/2014 (7:52 pm)
The vehicle fix will also work with bullet and the older physx 2.8 plugin but you will need the moveKinematicTo functions i created for them though. All the other extras will not work with the other physics plugins, only physx 3.3
#373
08/05/2014 (8:26 pm)
So you can use the vehicle fix with bullet physics and not have to use physx?
#374
08/05/2014 (8:43 pm)
Correct
#375
08/05/2014 (8:44 pm)
If I may ask, where are the vehicle fixes?
#376
08/05/2014 (8:53 pm)
vehicle.h/cpp and also you will need the moveKinematicTo functions from physicsBody.h and the btBody.h/cpp (if using bullet). Sorry i'm pulling all this stuff from memory, so hopefully it's accurate lol.
#377
08/06/2014 (3:17 am)
Thanks for the info. Any info will help. I'll dig into this and see what I can do.
#378
Now copy Engine\source\T3D\vehicles.cpp/h (both) to your local copy of T3D
Than copy Engine\source\T3D\physics\physicsBody.h (don't need the cpp)
Than copy Engine\source\T3D\physics\bullet\btBody.cpp/h (both)
Hopefully you can than just recompile T3D and your good to go. Do note that the BF_CCD enum in physicsBody will be totally ignored in bullet, feel free to delete it. I haven't tested this myself, can't 100% guarantee it will work.
Anyway hope that helps.
08/06/2014 (3:38 am)
Grab a copy of physx3_advanced branchNow copy Engine\source\T3D\vehicles.cpp/h (both) to your local copy of T3D
Than copy Engine\source\T3D\physics\physicsBody.h (don't need the cpp)
Than copy Engine\source\T3D\physics\bullet\btBody.cpp/h (both)
Hopefully you can than just recompile T3D and your good to go. Do note that the BF_CCD enum in physicsBody will be totally ignored in bullet, feel free to delete it. I haven't tested this myself, can't 100% guarantee it will work.
Anyway hope that helps.
#379
08/06/2014 (3:40 am)
Now this is using bullet instead of physx? I forget, is bullet default to T3D or does it need to be added?
#380
If you are using the GUI project manager it's even easier, open that up select modules and make sure bullet is selected and regenerate or create a new project
08/06/2014 (3:48 am)
Yes this is using bullet. Bullet needs to be enabled when building T3D, you can modify the build config file (located My Projects\yourprojectname\buildfiles\config\project.conf) and add:includeModule( 'bullet' );than regenerate the project.
If you are using the GUI project manager it's even easier, open that up select modules and make sure bullet is selected and regenerate or create a new project
Torque Owner Scott Przybylski
HydroSim