Finer collision in large projectiles
by Lee Latham · in Torque Game Engine · 03/31/2008 (3:23 pm) · 4 replies
Ok, here I think I have an interesting qustion. Is it possible to define a collision mesh for projectiles? Say I have these Bubbles of Death:

As you can see, they sink into the ground before bouncing or exploding. It looks like it's colliding with the center of the projectiles. I should mention they start off with a muzzlevelocity of 10--real slow.
Anything I can do about that? I should observe that I'm using the polysoup collision stuff the ground you see there. But I'm thinking that's not relevant, for some reason.
Any ideas would be greatly appreciated!

As you can see, they sink into the ground before bouncing or exploding. It looks like it's colliding with the center of the projectiles. I should mention they start off with a muzzlevelocity of 10--real slow.
Anything I can do about that? I should observe that I'm using the polysoup collision stuff the ground you see there. But I'm thinking that's not relevant, for some reason.
Any ideas would be greatly appreciated!
#2
I see where you're coming from. A bit hairy though to try the source method unless I want all projectiles to have that larger radius. So I suppose it would be possible to set up a new datablock value for them, etc.
But I like your rigidshape idea. It didn't occur to me to change the weapon that dramatically. Hmmm but they wouldn't behave like projectiles though. I could apply impulses to fling them around, but not have the creepy, slow projectile inexorably coming toward the enemy.
Well, this is a drag. I was hoping there was some method built in. I've noticed that this affects player collision as well, so my big bubbles pass harmlessly through a player unless they're dead on center.
edit: It occurs to me that you could turn gravity off, essentially, for rigidshapes. But the bigger problem I forsee there is load. Those guys have the same load as a full fledged vehicle, which is probably why we have a special projectile class in the first place.
04/01/2008 (8:05 am)
Thanks, Kirk!I see where you're coming from. A bit hairy though to try the source method unless I want all projectiles to have that larger radius. So I suppose it would be possible to set up a new datablock value for them, etc.
But I like your rigidshape idea. It didn't occur to me to change the weapon that dramatically. Hmmm but they wouldn't behave like projectiles though. I could apply impulses to fling them around, but not have the creepy, slow projectile inexorably coming toward the enemy.
Well, this is a drag. I was hoping there was some method built in. I've noticed that this affects player collision as well, so my big bubbles pass harmlessly through a player unless they're dead on center.
edit: It occurs to me that you could turn gravity off, essentially, for rigidshapes. But the bigger problem I forsee there is load. Those guys have the same load as a full fledged vehicle, which is probably why we have a special projectile class in the first place.
#3
Pretty acceptable! But it does appear to be magic.
04/01/2008 (9:00 am)
Actually, I sat down and did some testing, and projectiles appear to collide if I reduce their size by only about half--still a pretty darn big (human sized) projectile. The ones you see in the screenie are about double human sized.Pretty acceptable! But it does appear to be magic.
#4
Fortunately, things are rarely lined up quite that well in real play! I do think I may get a way with some fairly large projectiles. Since we're in 3D, the center is somewhat likely to collide with the object at _some point_ along the side of it, for example, even if it appears to be passing through at first. And in the speed and excitement of the game, it doesn't seem too noticeable.
04/02/2008 (10:19 am)
For anyone who comes later, I discovered that my previous statement is an illusion. If I sit and line things up very carefully, I find that it is still colliding with the center of the projectile.Fortunately, things are rarely lined up quite that well in real play! I do think I may get a way with some fairly large projectiles. Since we're in 3D, the center is somewhat likely to collide with the object at _some point_ along the side of it, for example, even if it appears to be passing through at first. And in the speed and excitement of the game, it doesn't seem too noticeable.
Torque Owner Kirk Longendyke
look arround where the code says:
oversimplified answer, I know. You'll likely need to make a few additions for the onCollision et al, but seems like that'd be the place to start looking, anyway.
Alternatively I suppose with a bit of scripting, theres the notion of attempting to spawn a ridgidshape, and modify the scoring accordingly...