Game Development Community

PhysX Cooked Mesh Raycast Code help please

by Ron Nelson · in Torque Game Engine Advanced · 11/04/2008 (4:16 pm) · 30 replies

I am posting this in both TGE and TGEA forums because I know not everyone owns both and I am hoping to up my chances for a successful resolution to my code problems.

I have successfully gotten Triangle Mesh Cooking working in PhysX(with help). What I am trying to get working is the TSStatic::castRay function so collisions can be detected. I have almost succeeded.

The following is everything I added to get this working. Everyone is welcome to use this I just want a fix to the castray issue.

Thanks in advance.
Page«First 1 2 Next»
#21
12/09/2008 (10:14 am)
That's great :)
#22
02/03/2009 (8:29 pm)
deepscratch - Any chance you would be willing to share what you did to get it working? I am coming off a hiatus and am trying to get into my old work again.
#23
02/05/2009 (9:49 am)
sure, but remember, its 1.7.1, I've tried to dif it out but I've made so many changes to tsStatic.cpp already that its a bit of a nightmare to find where I've changed what, tell me do you get a trace in console at all? 000.0? or nothing? maximum I'll give you my tsStatic.cpp and let you go through it yourself
#24
02/05/2009 (11:11 am)
I'm using 1.7.1 too and interesting about the fix for that.
#25
02/05/2009 (1:30 pm)
Yeah I can dif it no problem. Thanks deepscratch.
#26
02/07/2009 (3:22 pm)
Well deepscratch here I was thinking why haven't then emailed it to me yet and then I decided to look at something due to the new forum. Yeah I see now my email address is no longer accessible from my profile, which is dumb Garage Games guys. So if you would not mind, please email me what you have at RJNelson68@cox.net. Thanks again deepscratch.
#27
02/08/2009 (6:10 am)
Ron, mailed it to you.
#28
02/08/2009 (6:31 am)
@Ron:
Would you mind post any progress to this thread or a resource?
#29
02/08/2009 (11:24 am)
I think there's quite a few people watching this thread :) So yeah... plz keep us posted.
#30
02/09/2009 (12:37 am)
Well I have bad news. deepscratch's code was not successful and I can explain why. deepscratch if you look at the order or your transfers in packUpdate and unpackUpdate you will see they are not the same.

Therefore, with the order as you have it, you were enabling polysoup, not trianglemesh collision and of course those raycasts do work.

So no there is no further progress at this time. If you are testing this for the raycast make absolutely sure there is nothing but sky behind the object you are testing as well. You will get positive results from a terrain collision for example.

The issue here is not as much as the raycast itself as it is teaching Torque to genuinely recognize the TriangleMesh collision as it would with anyother collision. I was avoiding the method used with polysoup because it didn't actually use the opcode collision but faked it by creating another convex collision so Torque could interact with it.

You see if you had used, for example ODE objects, they should react to the Opcode Polysoup collision without the genration of the additional convex collision. Its because ODE is Opcode based. This is how it works with PhysX. PhysX objects interact beautifully with TriangleMesh cooking.

Thats why I believe the problem actually lies elsewhere in that I have to teach the engine to genuinely react with the PhysX collision as it would with a convex. Hopefully without having to actually create a convex in the process as that is just more memory that should not be needed.
Page«First 1 2 Next»