clip particles

Posted By: zSteam

clip particles - 01/28/10 17:47

hi,

it is possible to clip particles if they touch blocks or models?
Posted By: Lion_Ts

Re: clip particles - 01/28/10 22:53

yes, check particle position (what do you like: directly check xyz, use c_content, etc.) and modify particle's lifespan.
Posted By: zSteam

Re: clip particles - 01/29/10 10:53

hi thanks for reply.


but if use c_content, i don't see any particle

Code:
BMAP* scatter_map = "steam.dds";

// Hilfsfunktion: setzt den Vektor auf zufällige Richtung und Länge
void vec_randomize (var* vec, var range)
{
   vec[0] = random(0.05) - 0.025;
   vec[1] = random(0.05) - 0.025;
   vec[2] = random(0.05) - 0.025;
   vec_normalize(vec,random(range));
}

// Hilfsfunktion: blendet einen Partikel aus
void part_alphafade(PARTICLE *p)
{
	p.alpha -= 2*time_step;
	if (p.alpha <= 0) p.lifespan = 0;
	p.size += (0.75 * time_step);

	if(c_content(p.x,3))
	{
		p.lifespan = 0;
	}
}

// Partikelfunktion: generiert eine verblassende Explosion in vel-Richtung
void effect_smoke(PARTICLE *p)
{
   var temp[3];
   vec_randomize(temp,10);
   vec_add (p.vel_x, temp);

   p.alpha = 25 + random(25);
   p.bmap = scatter_map;
   p.flags |= (BRIGHT | MOVE);
   p.event = part_alphafade; // wechsle zu einer kürzeren, schnelleren Funktion
}


Posted By: Widi

Re: clip particles - 01/29/10 15:11

From the manual: Don`t use c_content for newer projects...
Posted By: zSteam

Re: clip particles - 02/22/10 14:18

wich command should I use?
© 2024 lite-C Forums