Game Development Community

Particles from 2 different emitters colliding

by janet kim · in Torque Game Engine · 04/22/2005 (8:41 am) · 4 replies

I've been trying to figure out the best way to go about this - I want to have two different particle groups running at the same time along the same axis, either in the same direction or opposite. However, while particles in group A will go on their merry way, the particles in group B will, when colliding with a particle in group B, bounce back. Is this the best way to go about this scenerio, and if so, any ideas of how to go about this? Otherwise, is there a better option to do this? I've tried raycasting with EnvironmentTypeObject, but I'm thinking that this mask is for the emitter itself, not the particles, so maybe I've been barking up the wrong tree.

Or let me rephrase: I need objects/shapes/or particles that flow in one direction. Another group of objects/shapes/particles flows in the same path either against or with the first group's. Individuals in the 2nd group should be able to detect the individuals in the 1st group and react accordingly (bounce, in this case).

#1
04/22/2005 (9:09 am)
You're going to do a raycast for each particle? Yikes, that sounds quite intensive. Are you getting good performance with that method?

- Brett
#2
04/22/2005 (9:16 am)
Well, I'm not sure what the best way would be. I already have a bounce method that raycasts for interior masks so that the particles bounce off of interiors, which seems to be working out fine. anyways, I don't think that there is a current container raycast method to detect other particles (because particles don't have collision meshes?), and I'm trying to figure out how to go about this. Any ideas?
#3
04/24/2005 (5:56 pm)
You basically have to compare each particle's radius against every other particle's radius. This is pretty costly and I'd suggest doing a custom implementation rather than trying to use castRay, since then you'd have to incur a SceneObject overhead, potentially for every particle!
#4
04/24/2005 (6:31 pm)
Thanks for responding, Ben. Would it be easier to try using Projectiles to try to bounce off of the particles? That's what I'm trying now, but I'm having problems using ProjectileObjectType in particleEngine.cc.

I'll try the radius method too...