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
#202
I wanted APEX in the beginning but the more I read into it the less interest I have in it. First off it's really only a framework for preparing your models in specific ways to function well with features of PhysX.
For instance with the destruction you would use PhysX Lab to fracture the model into pieces, set some properties, etc and then you'd import both the model and the apex file that was generated. So even at it's core it doesn't actually add any functionality to PhysX, its just a nice framework for utilizing the existing features.
With that said, it's not available for Linux and there hasn't been a version of PhysX Lab released for PhysX 3.3 yet. There's just too many cons and not enough pros, so I abandoned the idea.
03/22/2014 (9:07 am)
@raaI wanted APEX in the beginning but the more I read into it the less interest I have in it. First off it's really only a framework for preparing your models in specific ways to function well with features of PhysX.
For instance with the destruction you would use PhysX Lab to fracture the model into pieces, set some properties, etc and then you'd import both the model and the apex file that was generated. So even at it's core it doesn't actually add any functionality to PhysX, its just a nice framework for utilizing the existing features.
With that said, it's not available for Linux and there hasn't been a version of PhysX Lab released for PhysX 3.3 yet. There's just too many cons and not enough pros, so I abandoned the idea.
#203
https://dl.dropboxusercontent.com/u/41968/t3d/source.zip
Let me know if you can see anything wrong, I'm completely stumped at the moment :( (oh the D6 joint spazzes out, not sure why)
03/24/2014 (12:28 am)
Timmy here's the source code for my ragdoll.https://dl.dropboxusercontent.com/u/41968/t3d/source.zip
Let me know if you can see anything wrong, I'm completely stumped at the moment :( (oh the D6 joint spazzes out, not sure why)
#204
I also added in support within the world editor:

@aussie:
I'll take a look for you mate and see what i can find.
03/24/2014 (1:15 am)
I added per triangle material support for heightmaps in my own project, works pretty good. The crappy looking texture the box slides over is meant to be ice. It has a static/dynamic friction value of 0 and the sand has a static/friction value of 1 just to exaggerate the effect (don't worry jeff, i didn't steal your code either). I added a clean interface for it all, a new PhysicsMaterial class and had to modify the terrain class and also the physics collision interface. Not sure yet if this will make it's way into the physx branchI also added in support within the world editor:

@aussie:
I'll take a look for you mate and see what i can find.
#206
03/24/2014 (12:57 pm)
Very nice. Do the landscape materials affect the players movement? In other words, can you run and slide on that ice patch?
#207
03/24/2014 (3:07 pm)
No the player doesn't support the landscape materials, would be a cool feature though. I just have no need for any of the fps player stuff in my project and i have actually removed the code entirely from my own private build.
#208
my code is under the MIT license, so no worries even if you did haha.
03/24/2014 (3:13 pm)
Quote:don't worry jeff, i didn't steal your code either)
my code is under the MIT license, so no worries even if you did haha.
#209
*Fixed setting the local pose of a physx 3 shape so it doesn't use the old deprecated method.
This fix is very minor and was only done in case the deprecated method is removed in the future.
03/24/2014 (4:49 pm)
Repo update:*Fixed setting the local pose of a physx 3 shape so it doesn't use the old deprecated method.
This fix is very minor and was only done in case the deprecated method is removed in the future.
#210
Sorry i forgot to mention the other day, the reason you can't see any of your ragdoll stuff with physicsDebugDraw script call is because by default that only shows the server side stuff not the client and obviously the ragdoll is living in client side only. I will add a new script function that changes this and lets you select which world to enable debugdraw on
04/01/2014 (4:39 pm)
@Aussie:Sorry i forgot to mention the other day, the reason you can't see any of your ragdoll stuff with physicsDebugDraw script call is because by default that only shows the server side stuff not the client and obviously the ragdoll is living in client side only. I will add a new script function that changes this and lets you select which world to enable debugdraw on
#211
I have been thinking about this long and hard over the past week and i have decided to "jump ship" over to UnrealEngine 4. I actually didn't really have any intentions of doing so because i have invested a lot of time and effort on my project so far with T3D but UnrealEngine 4 just suits my project down to a tee, i won't say anymore because i really don't want to bag T3D as i actually think it's a pretty good engine but it's hard to compare to a genuine AAA engine like Unreal.
Anyway i will leave this repo as is, feel free to do whatever you like with the code, it's all under the MIT license anyway.
Good luck everyone with your own projects,
Cheers,
Tim
04/02/2014 (4:23 am)
Hey everyone,I have been thinking about this long and hard over the past week and i have decided to "jump ship" over to UnrealEngine 4. I actually didn't really have any intentions of doing so because i have invested a lot of time and effort on my project so far with T3D but UnrealEngine 4 just suits my project down to a tee, i won't say anymore because i really don't want to bag T3D as i actually think it's a pretty good engine but it's hard to compare to a genuine AAA engine like Unreal.
Anyway i will leave this repo as is, feel free to do whatever you like with the code, it's all under the MIT license anyway.
Good luck everyone with your own projects,
Cheers,
Tim
#212
Quick question though - is it really that easy to just dump t3d and switch to unreal? How does unreal work in terms of the scripting? We resisted unreal and unity mostly because our artist is not crazy about the pipeline to get things in there, he finds t3d so much quicker to work with... myself I worry about all the custom scripts we have in torque script... but I would be willing to give it a shot if I knew a conversion was possible.
Thanks, cheers
Paul
04/02/2014 (7:50 am)
Sad to see you go Timmy, but thanks for all the work on this... It improves our project immensely having the physx3 in there...Quick question though - is it really that easy to just dump t3d and switch to unreal? How does unreal work in terms of the scripting? We resisted unreal and unity mostly because our artist is not crazy about the pipeline to get things in there, he finds t3d so much quicker to work with... myself I worry about all the custom scripts we have in torque script... but I would be willing to give it a shot if I knew a conversion was possible.
Thanks, cheers
Paul
#213
Best of luck to you, I'll do my best to keep the PhysX3 branch alive and well :D Thanks for all your hard work.
04/02/2014 (9:39 am)
You gotta do what you gotta do. I know when the new payment models for UE4 and CryEngine came out I was tempted. I'm too deep into Torque now though, changing engines would set us back at least 6 months I imagine, not worth it for me.Best of luck to you, I'll do my best to keep the PhysX3 branch alive and well :D Thanks for all your hard work.
#214
I will use PhysX though, it seems to perform better anyways.
Do you think we can do all the things that APEX helps us do with just plain PhysX put in?
04/02/2014 (10:15 am)
That makes sense about APEX. To be honest, PhysX was the thing that pulled me away fro UDK. I got so stressed out over the performance issues of PhysX that I had to leave UDK. I found Torque3D and was excited because I could add another physics engine.I will use PhysX though, it seems to perform better anyways.
Do you think we can do all the things that APEX helps us do with just plain PhysX put in?
#215
Good luck with UE4!
04/02/2014 (12:55 pm)
sorry to see ya go Tim! Thanks so much for your hardwork, I for one really appreciate it as you know I'm using it currently :).Good luck with UE4!
#216
My case i think is very different, although i will have to ditch some scripts i created the large majority of my work was done based around physx in c++ code, some of the custom stuff i can just reuse over in UE4 as they use physx 3.3 too, other stuff they already have implemented. If my project was further advanced i wouldn't even consider the change, it would just be far too much work.
Cheers everyone and i won't be disappearing forever, i actually like torque and found it quite easy to use and understand.
04/02/2014 (2:16 pm)
@Paul:My case i think is very different, although i will have to ditch some scripts i created the large majority of my work was done based around physx in c++ code, some of the custom stuff i can just reuse over in UE4 as they use physx 3.3 too, other stuff they already have implemented. If my project was further advanced i wouldn't even consider the change, it would just be far too much work.
Cheers everyone and i won't be disappearing forever, i actually like torque and found it quite easy to use and understand.
#217
It seems that PhysicsBody shapes don't want to "collide" with my player class. Here's a video to demonstrate.
It looks like the player just steps up onto the shape, no matter how high it is.
Any ideas? Ideally I want it to push the player.
05/15/2014 (11:35 pm)
Hey guys, I have a pretty huge gamebreaking problem I need solved.It seems that PhysicsBody shapes don't want to "collide" with my player class. Here's a video to demonstrate.
It looks like the player just steps up onto the shape, no matter how high it is.
Any ideas? Ideally I want it to push the player.
#218
05/19/2014 (3:54 am)
Okay on further investigation it looks like the player isn't effected by kinematic forces. Any idea how to allow this?
#219
05/19/2014 (4:28 am)
Sorry don't check back here too often any more. Is the player effected by other physics object that aren't kinematic?
#220
I have come up with a pretty hacky solution, I created a new filter group called "NOPLAYER" and set an option for it on PhysicsBody. If so, the player will pass through these objects without any interaction. I then just applyImpulse to any player that walks up and it creates a pushing away effect.
Ideally though I'd like kinematic forces to effect players, I tried adding a RigidBody::applyForce to OnShapeHit but it didn't seem to do anything. Also I presume this would be necessary for vehicles.
05/19/2014 (9:31 pm)
I'm not sure, I'll try and find out tonight. As for kinematic stuff it looks like this is actually a design decision by PhysX, they want you to customize the interaction between players and shapes yourself .Documentation here!I have come up with a pretty hacky solution, I created a new filter group called "NOPLAYER" and set an option for it on PhysicsBody. If so, the player will pass through these objects without any interaction. I then just applyImpulse to any player that walks up and it creates a pushing away effect.
Ideally though I'd like kinematic forces to effect players, I tried adding a RigidBody::applyForce to OnShapeHit but it didn't seem to do anything. Also I presume this would be necessary for vehicles.
Timmy01
Appex support would be pretty good but it's a lot of work and honestly not something i particularly need at this stage for my project so i'm not all that keen on burning lot's of time on it.
@aussie:
How did you end up with the ragdoll stuff? Looking at your init code that part looks ok, although it is a little hard without seeing the whole setup.