Game Development Community

Particle Collisions

by Diego Santos Leao - GameBlox Studio · in Torque X 2D · 10/02/2008 (6:39 pm) · 10 replies

Hello guys,

I'm having problems to set collisions on particles... for example, I want to create a smoke effect that collides with objects in scene spreading around them.

I've tryed everything, but it looks like TorqueX has this limitation... you can't get a reference to the objects that corresponds to the particles themselves. I can only get the emitter.

Does someone else had this problem? I know it is not very efficient, but I will use it only on cutscenes and specific points of the game.

Thanks!!

#1
11/02/2008 (11:31 am)
Not one person ever tried to do that? ^^
It's not even custom colision responses... just "clamp" collisions would do...
#2
11/03/2008 (12:40 am)
I do not think that it currently works in TX. I looked through the code and did not find code that handles particle collisions - but I can be wrong. There have been threads about that before.
#3
01/11/2009 (12:12 pm)
Does anyone knows a way to simulate that? I need to be able to move a fire effect when a sceneobject passes on it (like moving your finger on candle fire, or blowing the fire of it).

One of the ways I imagined was to create various emmiters, for each part I need to "move", and then use linkpoints to keep them together after the collision.

Any more ideas?
#4
01/11/2009 (1:47 pm)
I tried doing something similar to that. It was a flamethrower where each particle damages the object it touches.

Anyway, I couldn't get it to do what I wanted, so I am curious about this too.
#5
01/14/2009 (9:26 am)
You'd have to modify or augment the particle code in the engine I believe.
#6
04/28/2010 (2:52 pm)
A per particle flamethrower would be nice, I'm not sure if performance would be good for that though.

I'm trying to make a flamethrower as well, all I really need is for the collision polygon to equal the extent of the particle effect at any given time. I think this is possible. If you know how to do this please post :)
#7
04/28/2010 (3:07 pm)
Yea right now you can set collision on the effect, but not on the particles themselves. If you were to create a particle effect that say spread in a cone shape set the collison to match this cone it would work. I have made projectiles that were particle effects. Explosions with collision as well.
#8
04/28/2010 (3:38 pm)
Yeah, I set my collision polygon as a cone shape but the problem is that it is always this cone shape, at the beginning of the flamethrow the particle effect is a lot smaller than its collision polygon. I could mess around with the graphs to just make the effect a constant shape perhaps.

Silva's Zombie shooter has a particle effect flamethrower I think, I don't know if it's per particle collisions though. I'll ask him what he did.
#9
04/28/2010 (6:29 pm)
He wrote his own particle emitter code for one. You could change the cone on the fly, or even turn collision on and off depending on if you are firing.
#10
04/28/2010 (8:00 pm)
Yeah I figured he did. I looked at the torquex emitter code, I think I made a sceneobject out of every particle but that didn't work lol.

I think you can grab the bounds of every particle and then create a collision polygon based on that, but I'm not quite sure how to do the former and I have no idea how to do the latter in code.