Oblong/Pointed Shape Collisions?
by Jeff Leigh · in Torque Game Engine · 07/15/2005 (9:38 am) · 2 replies
Does anyone have a working example of how to collide two shapes that are not simple squares or rectangles? (e.g. a ship or airplane with a pointed bow and stern)
I've been fighting for days to try to get this working. I've tried all kinds of approaches using a bunch of different functions (polyLists, extrudedPolylists, buildConvexHull, getFeatures, ConvexFeatures::collide, ...) and tons of relevant forum posts with no luck.
I've got a convex collision detail on the model. I can render it so I know when it should be hitting and I can collide (and stop against each other) with castRay provided the unit is traveling straight ahead and the front hits first. But that doesn't help to find the detailed collision point when the curved sides come in contact and not the front/back, or when the pointed tips meet at an angle.
I can get ConvexFeature::collide working for the Player and AIPlayer to identify that they overlap but I can't get it to work in a "predictive" manner (i.e. they have to be already overlapped and by then its too late to stop them).
I can't figure out how to collide the convexes like the normal collision system determining the time of collision and backing off to stop them. I even tried extruding the ConvexFeature before testing. I think I've been close a few times but then the CPU goes to lala land because the shapes don't stop on collision and are then massively overlapped causing tons of poly collisions to analyze.
I must be missing something somewhere on how to use these functions properly and I can't believe I'm the only one trying to do this.
Anybody know how any of these functions are supposed to work?
I've been fighting for days to try to get this working. I've tried all kinds of approaches using a bunch of different functions (polyLists, extrudedPolylists, buildConvexHull, getFeatures, ConvexFeatures::collide, ...) and tons of relevant forum posts with no luck.
I've got a convex collision detail on the model. I can render it so I know when it should be hitting and I can collide (and stop against each other) with castRay provided the unit is traveling straight ahead and the front hits first. But that doesn't help to find the detailed collision point when the curved sides come in contact and not the front/back, or when the pointed tips meet at an angle.
I can get ConvexFeature::collide working for the Player and AIPlayer to identify that they overlap but I can't get it to work in a "predictive" manner (i.e. they have to be already overlapped and by then its too late to stop them).
I can't figure out how to collide the convexes like the normal collision system determining the time of collision and backing off to stop them. I even tried extruding the ConvexFeature before testing. I think I've been close a few times but then the CPU goes to lala land because the shapes don't stop on collision and are then massively overlapped causing tons of poly collisions to analyze.
I must be missing something somewhere on how to use these functions properly and I can't believe I'm the only one trying to do this.
Anybody know how any of these functions are supposed to work?
#2
The returned .t parameter is always 2.0 which is what it's initialized to.
07/15/2005 (4:13 pm)
How do I tell - it looks like they are to me in Show Tool Pro? And ConvexFeature returns a valid list of polys (i.e. the faces, edges, and vertices are all what I expect them to be).The returned .t parameter is always 2.0 which is what it's initialized to.
Associate Matt Fairfax
Night Heron Games