PDA

View Full Version : particle collisions - one geo kills, other geo doesnt?


parakyl
08-13-2009, 03:14 PM
i've been searching for the better part of a day and am suprised no one else has asked this question that i/google can find :(

very simple:

particles falling down, land on some poly cubes and stick to it. No problem, i just selected both cubes and particle object, make collide, friction 1, done.

however, the ones that don't collide keep falling and slow things down. I don't need the particles if they didn't collide.

So i made a plane below the blocks, made collide, and tried to play with the particle collision event editor. I can make 2 seperate events, one with the kill button on and one with out, but I don't understand how to connect the 2 events to their respective geometry.

Instead I got a work-around going where the lifespanPP has this script on it:
if (particleShape1.collisionU > 0)
{
particleShape1.lifespanPP = 200;
}
else
{
particleShape1.lifespanPP = 15;
}

but that's clunky and if I alter the speed of the particles I'll likely have to change the else pp.


can anyone help? one kill floor among other collisions?

Aikiman
08-14-2009, 10:28 AM
If you are using tradional Maya particles you will see you can add collisionGeometryIndex as a PP. This means each piece of geometry has its own index value. So say your plane is index 2 then write...

if (collisionGeometryIndex == 2)
lifespanPP = 0;

that means you dont have to worry about using the collision editor.

parakyl
08-14-2009, 02:17 PM
yup it's regular particles. I can see where to add the geometry index under the PP array, but where do you find the index number one should use?

i made a fresh scene with a sphere and a plane below, 'make collide'ed the plane second and punched in exactly what you wrote, with the index being '2' and nothing happened, they still bounce off both the sphere and plane.

I assume also that i'd put this script under 'runtime after dynamics', not before right?

Wick3dParticle
08-14-2009, 05:54 PM
Hey parakyl,

If you select the particle and go to your HyperGraph connections, you will see that your collision objects are connected to the particleShape via the geoConnector node. If you look at the connections between the corresponding geoConnector and the particleShape, there is one link between the sweptGeometry and the collisionGeometry. The collisionGeometry input has an index number assigned to it and it appears like this in your hypergraph connection:

collisionGeometry[0]

So that means that the specific geometry linked to that particle has a collision index of 0.

I hope this explanation helped, let us know how it goes.

~Ilan

parakyl
08-14-2009, 06:24 PM
ah! it all worked! yay, thank you, i learnt so much :D Thanks a ton both of you!

CGTalk Moderation
08-14-2009, 06:24 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.