Game Development Community

PathShape resource and PhysX, how to.

by Sorin Daraban · in Torque 3D Professional · 07/25/2012 (8:08 pm) · 6 replies

Anybody know how to make the PathShape resource work with Physics; Bullet Physics, to be more specific?
The Physics player falls right through the moving shape.

#1
07/25/2012 (10:00 pm)
I am assuming that you are using a StaticShape for the animation in the eye-candy rich PhysX build. Well hold on to your seat.

I just recently found out myself that a PhysX build game project does not support collision with any dynamic object other than PhysX, TSStatic, and terrain. In other words any object that you would "really need" for an "actual game" will not recognize collision unless you plan on inviting your friends over after making a dime-a-dozen FPS for a primitive raid.
Ironically, if you wish to make objects that are more than just props that are destructible, then you will need to make a new "FPS" build project. This will eliminate the needless PhysX objects, and focus you on Torque based objects that completely communicate with each other collision-wise including your brand new FPS based player.
Sorry for the sarcasm, but I am still spellbound by this asinine situation and frustrated, but at least someone told you before you had an entire game-world constructed before braving animations with collision.
#2
07/25/2012 (10:41 pm)
Thanks for the info, DreamPharaoh.

I kind of knew that about Physics in Torque. I just wanted to know if anybody has this resource working with Physics.

I still appreciate your intentions, and I understand your frustruation.
It's game development. When you work with any kind of third party software, frustruation is to be expected. You just have to fight through it.
#3
07/26/2012 (8:05 am)
Your right. This one seems to be winning every time, but hopefully there is someone who has experience with this that can shed some light at the end of the tunnel.

I found this by Matt Fairfax. He did a great job clarifying how collision is handled in Torque. It at least gave me the impression that there might be a way to still fix the code into allowing PhysX builds, in their current state, to work with other collisions.

http://www.garagegames.com/community/blogs/view/5414
#4
07/26/2012 (12:29 pm)
Thanks.

Hopefully, someone that has this working will chime in.
#5
07/26/2012 (6:18 pm)
Since, nobody seems to know how to do it, I decided to, once again, dig into it myself.

I seem to have found a way to fix the falling through problem.
Now, the Player stays on, but the shape won't move.

Eventually, I will fix this, but for now, the way I made the Player collide with the shape, was to make the PathShape use the PhysicsBody class (i.e PhysicsBody * mPhysicsRep.) I just looked at how the other classes use Physics (i.e Item, TurretShape), and I applied the same concept to PathShape.

Hopefully, I'm on the right path (pun intended.) ;)
#6
07/27/2012 (8:41 am)
I have attempted, a week ago, to add a sphere collision using TSShapeConstructer like the turret, but it did not apply any collision at all for any model I had made. Its strange that he turret has collision at the base -- not sure how they are doing this.

I will experiment some more with this one. Thank you for the reminder.