I need someone with deep knowledge of the collision system
by Manoel Neto · in Torque Game Engine · 07/22/2005 (2:12 pm) · 9 replies
Hi,
I've been working in getting a modified player class to support non-uniform-scaled and rotated collision boxes. I've made progress, to a certain point.
I've managed to replace the OrhtoBoxConvex by a boxConvex, and adjust all those polylist operations in updatePos, step and some other functions to take the object rotation in account when generating polylists. It works like a charm, but only when the rotation is not changing too much. There isn't any code to resolve collisions caused by angular movement, and I'm having lots of problems in doing that.
I tried using the findClosestStates and getCollisionInfo, like vehicles do, but it didn't properly. I failed to find out how far the convex was penetrating the other polygons. Right now I'm trying to generate a polylist, in updatePos(), to find out intersecting objects, but none of the existing polylists seem to store information in an way that make sense. Only the extrudedPolyList features the setCollisionList method, but in other hand it only works when a velocity is passed to setup the extrusion. I set a small velocity only to get it working, but it always return 0 for collision distance.
Can someone shed me some light on this all? Replacing this class's movement code entirely by vehicle movement code has far too many unknowns to be viable, specially when we got so close to the solution. All I need is to push the object away when it's convex penetrates another convex, but the TGE collision system is making this a nightmare.
I've been working in getting a modified player class to support non-uniform-scaled and rotated collision boxes. I've made progress, to a certain point.
I've managed to replace the OrhtoBoxConvex by a boxConvex, and adjust all those polylist operations in updatePos, step and some other functions to take the object rotation in account when generating polylists. It works like a charm, but only when the rotation is not changing too much. There isn't any code to resolve collisions caused by angular movement, and I'm having lots of problems in doing that.
I tried using the findClosestStates and getCollisionInfo, like vehicles do, but it didn't properly. I failed to find out how far the convex was penetrating the other polygons. Right now I'm trying to generate a polylist, in updatePos(), to find out intersecting objects, but none of the existing polylists seem to store information in an way that make sense. Only the extrudedPolyList features the setCollisionList method, but in other hand it only works when a velocity is passed to setup the extrusion. I set a small velocity only to get it working, but it always return 0 for collision distance.
Can someone shed me some light on this all? Replacing this class's movement code entirely by vehicle movement code has far too many unknowns to be viable, specially when we got so close to the solution. All I need is to push the object away when it's convex penetrates another convex, but the TGE collision system is making this a nightmare.
About the author
Recent Threads
#2
I'm using the horse class from Robert. I heavily modified it so far, since it was simply the player class inheriting from vehicle class instead of shapebase, but using all of the orignal player movement code, and none from the vehicles, with a few animation modifications and the align to terrain resource threwn in.
The modifications we have done are working nicely, we just need the final step that is to resolve collisions generated by the rotation. The simpliest route seems to push the horse away if form whatever it intersects after a rotation, but I just can't find a way to get the existing collision features to tell me the information I need to do the correction.
I need a way to find out how far a convex has penetrated another one
07/23/2005 (7:17 pm)
It's a horse. The player code works fine when the box is has the same values on X and Y scale. A rectangular box breaks everything, since it originally doesn't rotate as the object does.I'm using the horse class from Robert. I heavily modified it so far, since it was simply the player class inheriting from vehicle class instead of shapebase, but using all of the orignal player movement code, and none from the vehicles, with a few animation modifications and the align to terrain resource threwn in.
The modifications we have done are working nicely, we just need the final step that is to resolve collisions generated by the rotation. The simpliest route seems to push the horse away if form whatever it intersects after a rotation, but I just can't find a way to get the existing collision features to tell me the information I need to do the correction.
I need a way to find out how far a convex has penetrated another one
#3
07/25/2005 (12:08 pm)
Hmm... Well, you're getting a polylist back from the world, so all you need to do is implement a rotated box-triangle collision routine and use that. Make sure the box you're passing to the working set build code is bigger than any possible rotation of the box.
#4
I would have emailed you but you dont have a public email listed. THere is one in my profile if you'd like to email i\them to me. Let me know :)
07/26/2005 (1:37 pm)
Manoel... Would it be possible to get a hold of your player.cc and .h files? I completed a player modification dealing with rotating the player, but I didn't figure out how to do a rotated collision box. I instead used a gigantic OrthoBoxConvex which didn't work well at all (but worked none the less).I would have emailed you but you dont have a public email listed. THere is one in my profile if you'd like to email i\them to me. Let me know :)
#5
The current changes work fine, but it breaks up if you rotate in place (since the player collision scheme will do nothing if there's no linear velocity). Since our deadling is on Friday, we've put together a quick hack to push the horse when it interesects stuff. It's not that pretty, not taht accurate, but it solves most of the collision problems.
And Ben, thanks for the help. It's just that the player collision code is too overwhelming and split in many non-obvious steps, with not enough comments. The many kinds of polylists also puzzle me, but I really dindn't try to extract triangles out of them, I was looking at how they updated the collisionList.
07/26/2005 (3:35 pm)
I can't quite handle out the files, because they're modificaitons on Robert's horse.cc and horse.h files, but I can isolate the changes and post them here. I'll do that later, when I'm at home. The current changes work fine, but it breaks up if you rotate in place (since the player collision scheme will do nothing if there's no linear velocity). Since our deadling is on Friday, we've put together a quick hack to push the horse when it interesects stuff. It's not that pretty, not taht accurate, but it solves most of the collision problems.
And Ben, thanks for the help. It's just that the player collision code is too overwhelming and split in many non-obvious steps, with not enough comments. The many kinds of polylists also puzzle me, but I really dindn't try to extract triangles out of them, I was looking at how they updated the collisionList.
#6
Thank you. I really appreciate you taking the time to help me. :)
07/26/2005 (5:55 pm)
Manoel, the rotation issue shouldnt matter to my application. Thank you. I really appreciate you taking the time to help me. :)
#7
08/03/2005 (1:50 pm)
Manoel - Just bumping this to make sure you didnt forget about me :)
#8
08/04/2005 (5:53 am)
Sorry, I didn't forget. It's just that it's 10:00 AM, and I am still at work (since yesterday), waiting for the other guys to finish packing up the goldmaster version of our project. Whenever I become able to use my brain again, I'll post it.
#9
08/04/2005 (7:15 am)
Thank you. Take as much time as you need :)
Associate Kyle Carter