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
#442
For now with DM we where happy for them to just spawn on object death and than schedule them for deletion. Pretty simple really. We really only wanted to enhance the "death experience" for now. It's an area we will look into later on in development i guess and decide how much further we want to take it. So for now our answer to the above question was no.
01/16/2015 (5:35 pm)
My original attempt i simulated them both on server & client independently which actually worked but was totally unnecessary. The second version is client side only. This can be a hard one because it really depends on what you want to do with the ragdolls? Things like do you need them to live on and allow players to move them? use them for cover? etc etc. Those questions are pretty summarized by, Do you require the ragdolls to be in the exact same position on every single client? For now with DM we where happy for them to just spawn on object death and than schedule them for deletion. Pretty simple really. We really only wanted to enhance the "death experience" for now. It's an area we will look into later on in development i guess and decide how much further we want to take it. So for now our answer to the above question was no.
#443
01/16/2015 (5:55 pm)
Oh thanks az, there you go. ATL still an issue :/
#444
But i cant run sample From Bin/x86 Directory, It asks nVcuda.dll To Run This Program. What Can I do, Is It Works Correctly With Torque 3D ?
01/16/2015 (9:21 pm)
Thank You For Answering My Question MR.Timmy,But i cant run sample From Bin/x86 Directory, It asks nVcuda.dll To Run This Program. What Can I do, Is It Works Correctly With Torque 3D ?
#445
i Have A lot of problems In compiling
01/16/2015 (9:45 pm)
Do You Can Upload Compiled Physics(PhysX) Tools For full Template Demo 3.6.1 ?i Have A lot of problems In compiling
#446
01/16/2015 (10:14 pm)
You need the physx 3.3 SDK which you can download here developer.nvidia.com/gameworksdownload. Requires an account though.
#447
and installed on C:\Program Files\NVIDIA Corporation\NVIDIA PhysX SDK\v3.3.0_win;
named 3.3.1 to v3.3.0_win; and Created an env var, And Project Manager Successfully Created solution Files, And Compiled With warning c4096. and a error c1033.
01/17/2015 (1:17 am)
i Already Downloaded It From Gameworks physx-3.3.1_pc_sdk_core_2.exe, Size 146 mband installed on C:\Program Files\NVIDIA Corporation\NVIDIA PhysX SDK\v3.3.0_win;
named 3.3.1 to v3.3.0_win; and Created an env var, And Project Manager Successfully Created solution Files, And Compiled With warning c4096. and a error c1033.
#448
Looking at that path name(in the error) in your other thread i'm going to guess it's a locale problem. What language are you running?
01/17/2015 (1:26 am)
Don't worry about the warning.Looking at that path name(in the error) in your other thread i'm going to guess it's a locale problem. What language are you running?
#449
And Used PhysX3 Physics and its Created successfully with Project manager 2.1 deval. But I cannot Compile Without Errors.
Give Me a List Of Softwares To Build A game With Torque 3D
after I format My Hard disk. and Install Windows,
with URLs please.
01/17/2015 (1:30 am)
My New Project Named X DEMOAnd Used PhysX3 Physics and its Created successfully with Project manager 2.1 deval. But I cannot Compile Without Errors.
Give Me a List Of Softwares To Build A game With Torque 3D
after I format My Hard disk. and Install Windows,
with URLs please.
#450
Error_C1033:Cannot open Program database 'c:torque3denginelibcompileddebug.win32collada_dom_debug.pdp
This suggests to me it might be a locale issue. What language do you use?
01/17/2015 (1:41 am)
Yeah see my response above.Error_C1033:Cannot open Program database 'c:torque3denginelibcompileddebug.win32collada_dom_debug.pdp
This suggests to me it might be a locale issue. What language do you use?
#452
i see this error (1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt)
only
i will try to fix it with Updates Thankyou
01/18/2015 (12:24 am)
I am Using C++ Programming Language, Now I don't See This Error Now.i see this error (1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt)
only
i will try to fix it with Updates Thankyou
#453
https://github.com/ChrisCalef/Torque3D/tree/physx3_advanced
It doesn't have anything new in it yet except for updating the last couple months of T3D, but I did merge those in as best I could. (For conflicts I assumed that new stuff outside the physics directories was supposed to go in, inside the physics directories I just overwrote all the files with your latest versions.)
Please note, if it makes a difference, this repo starts with a clean fresh T3D and then merges in the changes from Tim's branch, not the other way around. I think this means I cannot offer a pull request to Tim, for which I apologize, but for purposes of sharing several other branches also based off of a clean stock T3D, it seemed to be the only way to organize it. (Someone please correct me if my git assumptions are all wrong here.)
Anyway, this branch is where I plan to work on joints and other stuff next, will pop up again in this thread if/when I get anything working.
01/18/2015 (1:17 pm)
So hey, just wanted to mention that I now have my own copy of Tim's repo up on my github: https://github.com/ChrisCalef/Torque3D/tree/physx3_advanced
It doesn't have anything new in it yet except for updating the last couple months of T3D, but I did merge those in as best I could. (For conflicts I assumed that new stuff outside the physics directories was supposed to go in, inside the physics directories I just overwrote all the files with your latest versions.)
Please note, if it makes a difference, this repo starts with a clean fresh T3D and then merges in the changes from Tim's branch, not the other way around. I think this means I cannot offer a pull request to Tim, for which I apologize, but for purposes of sharing several other branches also based off of a clean stock T3D, it seemed to be the only way to organize it. (Someone please correct me if my git assumptions are all wrong here.)
Anyway, this branch is where I plan to work on joints and other stuff next, will pop up again in this thread if/when I get anything working.
#454
When you start to get it going i'll put a link on the original post pointing to this new branch too (if you don't mind of course).
01/18/2015 (9:21 pm)
Hey you can still push changes back to my repo but honestly i'm happy for someone else to "take" over so to speak because honestly i just have so little spare time for it anyway. Happy to help where i can though, so just ask if any problems etc. When you start to get it going i'll put a link on the original post pointing to this new branch too (if you don't mind of course).
#455
Did attach the sqlite3 resource (has anybody ever proposed just adding that to the main engine btw? I sure need it everywhere I go) but nothing else exciting has happened so far.
Got a lot of work ahead of me now figuring out how to neatly divide my TSShape related functionality from the physics stuff, as I have (in typical fashion) crammed everything into too few massively overloaded bloat classes in my own work. :-p
Pretty soon I'm going to merge Jeff's Entity Component stuff in here too, possibly sooner than later, because it looks like a simple renderShape entity with an animationController component is going to be all I need to drive my actors, and ShapeBase will no longer be necessary(!). This seems like a great place to test that.
01/19/2015 (9:40 am)
Right on, yeah link it up, I plan on working on this for a while at least. Did attach the sqlite3 resource (has anybody ever proposed just adding that to the main engine btw? I sure need it everywhere I go) but nothing else exciting has happened so far.
Got a lot of work ahead of me now figuring out how to neatly divide my TSShape related functionality from the physics stuff, as I have (in typical fashion) crammed everything into too few massively overloaded bloat classes in my own work. :-p
Pretty soon I'm going to merge Jeff's Entity Component stuff in here too, possibly sooner than later, because it looks like a simple renderShape entity with an animationController component is going to be all I need to drive my actors, and ShapeBase will no longer be necessary(!). This seems like a great place to test that.
#456
01/19/2015 (1:25 pm)
There ya go chris, updated.
#457
01/19/2015 (3:17 pm)
Cool. Just so people know what it is, I also have a physx3_advanced_WIP branch up there which is, as implied, where I'll be doing my work until it's ready to merge into the main one. This will be a good place to spectate on my progress although of course no one should expect anything there to be functional. :-)
#458
To try it out you'll also want to download my project directory which I put up here:
https://github.com/ChrisCalef/physx3_advanced_game
There is a compiled executable in there so you can mess around without bothering to build it, but the critical thing is the sqlite database called physicsData.db, that has my joint configuration info in it, none of this will work without it. (Sorry, but I took the SQL red pill years ago and now I just don't bother doing a thing without it.) :-)
There are four new files, physicsJoint.cpp/.h and px3Joint.cpp/.h, which define joints using the same methodology as the rest of the physics plugin stuff. You can use the new jointAttach() console function for PhysicsShape to attach two bodies with a joint, like so:
The second argument is a database ID by which we look up our joint and all its properties, which then get loaded into a physicsJointData struct and sent to px3Joint.cpp for creation.
I made a couple more script functions for testing - "makeBoxes(%start)" lets you make a set of twelve boxes connected by six joints (one each of the available types - spherical, revolute, prismatic, fixed, distance, d6), using the %start vector as a starting position so you can do it more than once.
Then to see how they perform, looseBoxes(%start) is useful, to simply create six loose boxes above your swinging boxes to knock them around a bit.
Finally, I exposed Tim's applyImpulse() and applyRadialImpulse() functions to script as well, to make it easier to mess with things.
All of the loose (non kinematic) boxes in the makeBoxes function are named with the convention $prismaticB (for the B box, where the A box is the kinematic one), so you could go $prismaticB.applyImpulse("0 0 0","-20 0 0") for a pretty good time. ;-)
Next steps, joint motors and then RAGDOLLS! (This is what physicsArticulatedShape.cpp/.h is for...)
Have fun!
01/21/2015 (9:56 am)
So, hey, got my first progress to report... seemed more or less legit so I pushed it from the WIP back onto my regular physx_advanced branch.To try it out you'll also want to download my project directory which I put up here:
https://github.com/ChrisCalef/physx3_advanced_game
There is a compiled executable in there so you can mess around without bothering to build it, but the critical thing is the sqlite database called physicsData.db, that has my joint configuration info in it, none of this will work without it. (Sorry, but I took the SQL red pill years ago and now I just don't bother doing a thing without it.) :-)
There are four new files, physicsJoint.cpp/.h and px3Joint.cpp/.h, which define joints using the same methodology as the rest of the physics plugin stuff. You can use the new jointAttach() console function for PhysicsShape to attach two bodies with a joint, like so:
$d6A = new PhysicsShape() {
playAmbient = "0";
dataBlock = "PSCube";
position = VectorAdd(%start,"0 10 0");
rotation = "1 0 0 0";
canSave = "1";
canSaveDynamicFields = "1";
areaImpulse = "0";
damageRadius = "0";
invulnerable = "0";
minDamageAmount = "0";
radiusDamage = "0";
hasGravity = false;
isDynamic = false;
};
$d6B = new PhysicsShape() {
playAmbient = "0";
dataBlock = "PSCube";
position = VectorAdd(%start,"3 10 0");
rotation = "1 0 0 0";
canSave = "1";
canSaveDynamicFields = "1";
areaImpulse = "0";
damageRadius = "0";
invulnerable = "0";
minDamageAmount = "0";
radiusDamage = "0";
hasGravity = true;
isDynamic = true;
};
$d6A.jointAttach($d6B,1);The second argument is a database ID by which we look up our joint and all its properties, which then get loaded into a physicsJointData struct and sent to px3Joint.cpp for creation.
I made a couple more script functions for testing - "makeBoxes(%start)" lets you make a set of twelve boxes connected by six joints (one each of the available types - spherical, revolute, prismatic, fixed, distance, d6), using the %start vector as a starting position so you can do it more than once.
Then to see how they perform, looseBoxes(%start) is useful, to simply create six loose boxes above your swinging boxes to knock them around a bit.
Finally, I exposed Tim's applyImpulse() and applyRadialImpulse() functions to script as well, to make it easier to mess with things.
All of the loose (non kinematic) boxes in the makeBoxes function are named with the convention $prismaticB (for the B box, where the A box is the kinematic one), so you could go $prismaticB.applyImpulse("0 0 0","-20 0 0") for a pretty good time. ;-)
Next steps, joint motors and then RAGDOLLS! (This is what physicsArticulatedShape.cpp/.h is for...)
Have fun!
#459
01/21/2015 (10:00 am)
Awesome work Chris!
#460
Oh, additional note, the linear limits aren't working yet (translation limits, relevant for prismatic and d6 joints) but I think the swing and twist limits are working fine. Also I haven't implemented limit planes yet, and I actually haven't found them in the docs yet either, hoping they didn't get removed in physx3!
I tried to make drive forces work for the d6 joints as well, but haven't quite figured that out yet. By way of making the joint accessible to script, I added a mJoint member to physicsShape, and made the joint the property of the shape that called jointAttach. This way we'll be able to say $boxB.addMotorForce() etc to manipulate the joint.
01/21/2015 (10:47 am)
Thanks!Oh, additional note, the linear limits aren't working yet (translation limits, relevant for prismatic and d6 joints) but I think the swing and twist limits are working fine. Also I haven't implemented limit planes yet, and I actually haven't found them in the docs yet either, hoping they didn't get removed in physx3!
I tried to make drive forces work for the d6 joints as well, but haven't quite figured that out yet. By way of making the joint accessible to script, I added a mJoint member to physicsShape, and made the joint the property of the shape that called jointAttach. This way we'll be able to say $boxB.addMotorForce() etc to manipulate the joint.
Azaezel
Might try throwing www.visualstudio.com/en-us/news/vs2013-community-vs.aspx at it if it continues to be an issue.