PhysX in TGEA 1.8.1
by Ronald J Nelson · 04/05/2009 (8:38 am) · 50 comments
Thanks to alot of help from the Garage Games Community namely Ross Pawley, Gerald Fishel, and deepscratch I am putting up an updated version of the PhysX resource that is compatible with TGEA 1.8.1.
It comes with something extra though, PhysX actors react to objects using Polysoup thanks to Triangle Mesh Cooking. I am using PhysX SDK version 2.7.3 but this will probably work fine with later versions.
Of course none of this would be possible (by me at least) without the original work done by Shannon "ScarWars" Scarvaci and his resource found here:
www.garagegames.com/community/resources/view/12711
So follow his PhysX SDK instructions then use these files.
One more thing, if you have bought Konrad Kiss's BG Cliff Kit and installed the TGEa 1.8.1 version, I have emailed him files that will make this work on his cliffs as well.
Here are the files:
torque.abigholeintheweb.com/public_system/useruploads/PhysX_TGEA_1_8_1_v2.zip
It comes with something extra though, PhysX actors react to objects using Polysoup thanks to Triangle Mesh Cooking. I am using PhysX SDK version 2.7.3 but this will probably work fine with later versions.
Of course none of this would be possible (by me at least) without the original work done by Shannon "ScarWars" Scarvaci and his resource found here:
www.garagegames.com/community/resources/view/12711
So follow his PhysX SDK instructions then use these files.
One more thing, if you have bought Konrad Kiss's BG Cliff Kit and installed the TGEa 1.8.1 version, I have emailed him files that will make this work on his cliffs as well.
Here are the files:
torque.abigholeintheweb.com/public_system/useruploads/PhysX_TGEA_1_8_1_v2.zip
#22
04/06/2009 (8:24 am)
yeah, seems like it, at a glance, the physx files at least
#23
04/06/2009 (8:26 am)
Alright, thanks for checking. Also, if you'd like to add me to MSN my email is taylor_petrick[@]hotmail.com.
#24
04/06/2009 (8:30 am)
ok, Rons files are indeed different, quite a bit.
#25
But hey I am all for collaborating on improvements for an overall package.
04/06/2009 (1:26 pm)
Not really, the truth is I removed all of the commented out crap and cleaned up the carriage returns. The differences are only those necessary to make it compatible with TGEA 2.7.3 since alot of the newer PhysX functions don't are not present in this version.But hey I am all for collaborating on improvements for an overall package.
#26
04/06/2009 (9:44 pm)
I found what difference there was in mine and deepscratch's and changed it. Joints work fine now and the new version is up there.
#27
04/07/2009 (1:04 pm)
Thanks Ron, now if deep just gets that ragdolling fully functional...
#28
04/07/2009 (10:22 pm)
I just made a little "stick man" sort of thing using joints. Here's a video of it, along with the rigids. Its kind of funny how the figure looks like he is trying to stand up, as I didn't give him any animations.
#29
04/07/2009 (11:27 pm)
Pretty Cool. Also, I have been touch with Shannon "ScarWars" Scarvaci who started all of this and he has cloth working and said when finds where he put the code, he will send it to me.
#30
04/08/2009 (3:17 am)
Very nice progress guys!
#31
04/08/2009 (4:18 am)
Has anyone been able to get any non-convex objects working as physics actors? Putting a ring shape in, and setting the type to Trimesh, crashed Torque.
#32
Because it you were just trying to do that with the trimesh garbage in a datablock, my stuff has nothing to do with that.
If you are trying to do that with the polsoup checkbox when you add the object as a static shape and then is crashes. Well that is a problem. I have tried ridiculous abounts of detail in shapes and including mass replications as with the BG Cliff kit and it all works fine.
04/08/2009 (4:29 am)
Let me clarify what you mean. Are you saying that you put a donut shaped object into the game that doesn't have a collision mesh to start with, enabled polysoup, and it crashes?Because it you were just trying to do that with the trimesh garbage in a datablock, my stuff has nothing to do with that.
If you are trying to do that with the polsoup checkbox when you add the object as a static shape and then is crashes. Well that is a problem. I have tried ridiculous abounts of detail in shapes and including mass replications as with the BG Cliff kit and it all works fine.
#33
Sorry for not being clear. ;) It looks like the SetupTrimesh is using the NxConvex, not NxTrimesh. I'll take a look and see what I can come up with. Also, it seems deepscratch's version doesn't have your polysoup addition.
04/08/2009 (4:31 am)
No, I'm trying to make a non-convex PhysX Actor. I'm using the ring in a PhysXActor datablock:datablock PhysXActorData(pxJointChain) {
// Mission editor category
category = "Physics";
pxShape = "trimesh";
friction = 0.1;
mass = 20.0;
elasticity = 0.1;
shapeFile = "~/data/shapes/chain/chain.dts";
materialBlock = pxMaterialBox;
pxKinematicBody = false;
};Sorry for not being clear. ;) It looks like the SetupTrimesh is using the NxConvex, not NxTrimesh. I'll take a look and see what I can come up with. Also, it seems deepscratch's version doesn't have your polysoup addition.
#34
The only things in PhysX that let you do that and some of us are already working on that is cloth and soft touch items. Vehicles, players, and other moveable stuff that you would have done with RigidShape previously, cannot be non-convex.
04/08/2009 (4:36 am)
I see what you are saying and no you can't do that. As was said in the beginning with polysoup, objects that move should not be using triangle mesh or polysoup collisions, the amount of work on a system to keep up with those calculations would be crazy and would certainly explain your crash.The only things in PhysX that let you do that and some of us are already working on that is cloth and soft touch items. Vehicles, players, and other moveable stuff that you would have done with RigidShape previously, cannot be non-convex.
#35
04/08/2009 (4:43 am)
Fair enough. I thought it would be fun to add a big chain, with each link as a seperate moving piece. I supposed I could make them planar and use an alpha texture.
#36
c:program files/ageia technologies/sdkv2.7.2/sdksfoundation/includenx.h(34) : fatal error C1189:
#error : custom definition of NX_CALL_CONV for your OS needed!
How to resolve this error. In my project all Preprocessors are WIN32 only. Current Preprocessor Definitions for TGEA 1.8.1 Debug(Win32):
TORQUE_SHADERGEN;TORQUE_PLAYER;BAN_OPCODE_AUTOLINK;ICE_NO_DLL;
TORQUE_OPCODE;LTC_NO_PROTOTYPES;TORQUE_OGGVORBIS;TORQUE_DEBUG;UNICODE;TORQUE_DEBUG_GUARD;D3D_DEBUG_INFO;INITGUID;
TORQUE_NET_STATS;_CRT_SECURE_NO_DEPRECATE;NOWINBASEINTERLOCK
06/19/2009 (9:49 pm)
After integrating 2.7.2 PhyX SDK with TGEA 1.8.1 i got the following error.c:program files/ageia technologies/sdkv2.7.2/sdksfoundation/includenx.h(34) : fatal error C1189:
#error : custom definition of NX_CALL_CONV for your OS needed!
How to resolve this error. In my project all Preprocessors are WIN32 only. Current Preprocessor Definitions for TGEA 1.8.1 Debug(Win32):
TORQUE_SHADERGEN;TORQUE_PLAYER;BAN_OPCODE_AUTOLINK;ICE_NO_DLL;
TORQUE_OPCODE;LTC_NO_PROTOTYPES;TORQUE_OGGVORBIS;TORQUE_DEBUG;UNICODE;TORQUE_DEBUG_GUARD;D3D_DEBUG_INFO;INITGUID;
TORQUE_NET_STATS;_CRT_SECURE_NO_DEPRECATE;NOWINBASEINTERLOCK
#37
make sure you have defined your platform in win_common_prefix.h
Hope this helps
06/22/2009 (2:34 pm)
@Adithyaa: not sure if this is the answer, but:make sure you have defined your platform in win_common_prefix.h
Hope this helps
#38
..\..\..\..\..\engine\source\terrain\terrData.cpp(107) : error C2039: 'setTerrainFile' : is not a member of 'TerrainBlock'
c:\Torque\TGEA_1_8_0\engine\source\terrain/terrData.h(113) : see declaration of 'TerrainBlock'
..\..\..\..\..\engine\source\terrain\terrData.cpp(216) : error C2039: 'setTerrainFile' : is not a member of 'TerrainBlock'
c:\Torque\TGEA_1_8_0\engine\source\terrain/terrData.h(113) : see declaration of 'TerrainBlock'
..\..\..\..\..\engine\source\terrain\terrData.cpp(217) : error C2365: 'setTerrainFile' : redefinition; previous definition was 'formerly unknown identifier'
..\..\..\..\..\engine\source\terrain\terrData.cpp(218) : error C2065: 'mTerrFileName' : undeclared identifier
..\..\..\..\..\engine\source\terrain\terrData.cpp(219) : error C2065: 'mFile' : undeclared identifier
..\..\..\..\..\engine\source\terrain\terrData.cpp(220) : error C2065: 'mFile' : undeclared identifier
..\..\..\..\..\engine\source\terrain\terrData.cpp(220) : error C2227: left of '->mFilePath' must point to class/struct/union/generic type
type is ''unknown-type''
..\..\..\..\..\engine\source\terrain\terrData.cpp(2238) : error C2039: 'purgeNextUpdate' : is not a member of 'ClipMap'
c:\Torque\TGEA_1_8_0\engine\source\clipmap/clipMap.h(28) : see declaration of 'ClipMap'
06/25/2009 (11:19 am)
When I compile it tells me this:..\..\..\..\..\engine\source\terrain\terrData.cpp(107) : error C2039: 'setTerrainFile' : is not a member of 'TerrainBlock'
c:\Torque\TGEA_1_8_0\engine\source\terrain/terrData.h(113) : see declaration of 'TerrainBlock'
..\..\..\..\..\engine\source\terrain\terrData.cpp(216) : error C2039: 'setTerrainFile' : is not a member of 'TerrainBlock'
c:\Torque\TGEA_1_8_0\engine\source\terrain/terrData.h(113) : see declaration of 'TerrainBlock'
..\..\..\..\..\engine\source\terrain\terrData.cpp(217) : error C2365: 'setTerrainFile' : redefinition; previous definition was 'formerly unknown identifier'
..\..\..\..\..\engine\source\terrain\terrData.cpp(218) : error C2065: 'mTerrFileName' : undeclared identifier
..\..\..\..\..\engine\source\terrain\terrData.cpp(219) : error C2065: 'mFile' : undeclared identifier
..\..\..\..\..\engine\source\terrain\terrData.cpp(220) : error C2065: 'mFile' : undeclared identifier
..\..\..\..\..\engine\source\terrain\terrData.cpp(220) : error C2227: left of '->mFilePath' must point to class/struct/union/generic type
type is ''unknown-type''
..\..\..\..\..\engine\source\terrain\terrData.cpp(2238) : error C2039: 'purgeNextUpdate' : is not a member of 'ClipMap'
c:\Torque\TGEA_1_8_0\engine\source\clipmap/clipMap.h(28) : see declaration of 'ClipMap'
#39
09/15/2009 (1:57 pm)
There seems to be an issue with the ragdoll.cpp file? it wont compile
#40
11/06/2009 (11:47 am)
Using vs2008 and getting a lot of compile isues. What a great resource. I would love to get this into some tgea projects. 
Torque Owner deepscratch
DeepScratchStudios