Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Check the age
- int $randAge = rand(1,7);
- if (frame < 400) {
- if (particleSplittingTest_original:nParticleShape1.age > $randAge) {
- //OK, it's old enough. Let's get the particle's position
- vector $pos = particleSplittingTest_original:nParticleShape1.position;
- //Let's get some velocity values
- //vector $vel0 = rand(-.5,.5) + nParticleShape1.velocity;
- //vector $vel1 = rand(-.5,.5) - nParticleShape1.velocity;
- float $randP = rand(0,.5);
- vector $vel0 = rand(0,1) + particleSplittingTest_original:nParticleShape1.velocity;
- vector $vel1 = rand(0,1) - particleSplittingTest_original:nParticleShape1.velocity;
- //Now let's kill the particle
- particleSplittingTest_original:nParticleShape1.lifespanPP = 0;
- //Let's create two new particles at the old position
- emit -object nParticle1 -position ($pos.x+$randP) ($pos.y) ($pos.z + $randP)
- -position ($pos.x+$randP ) ($pos.y) ($pos.z + $randP)
- -attribute velocity -vectorValue ($vel0.x) ($vel0.y) ($vel0.z)
- -vectorValue ($vel1.x) ($vel1.y) ($vel1.z);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment