Game Development Community

onCollision with polysoup?

by Lee Latham · in Torque Game Engine Advanced · 04/11/2009 (12:08 am) · 5 replies

I'm wondering if it's possible to, say, have a StaticShape with no traditional collision meshes, and have it work with polysoup collision?

What I'm finding is that if I have no collision meshes, the polysoup collision doesn't work for StaticShapes. From what I see in the code, it does seem to support polysoup.

Any input would be greatly appreciated!

#1
04/11/2009 (6:35 am)
Polysoup doesn't require collision meshes or collision nodes in the DTS hierarcy.

1. Is your mesh single sided? If it's double-sided they'll be problems, usually sticking.
2. Are your normals all pointing outwards? Or your collision will be on the wrong side.
3. If you have really small parts to the mesh, polysoup won't work.
4. Save your mission and reload.

edit: And you are checking the "use polysoup" box on the shape yes?
#2
04/11/2009 (8:38 pm)
Thanks for the response!

It's only when I bring it in as a StaticShape that it doesn't collide. TSstatic works without issue.

I'm trying to bring it in as a StaticShape so that I can take advantage of onCollision for it.
#3
04/12/2009 (7:06 am)
Oh, so you want to be able to put in a "do something" to the onCollision function for a certain object?

Not sure about that and polysoup. You might have to make a new shape/mask class to get it to work. (though I'm blindly fumbling there)
#4
04/12/2009 (7:20 pm)
Yeah me too. Thanks for thinking about it though.

I'm wondering how hard it might be to add an onCollision method to TSStatic. I don't know C, but sometimes I can really get a way with a lot by just following the internal logic of the code. Although I'm thinking this might be more than I can chew :-)

I'll post if I get it working.
#5
04/12/2009 (7:21 pm)
You know...it has to have an onCollision, because you can collide with TSstatics. Maybe it's just not exposed to script?