It seems it might just be that particles are overlapping. somthning todo with the generation code. cause if i just generate one particle at a time it fades correctly then disapears
Weird problem with my new particle engine class
If either a->draft equals to zero, or deltaT equals to zero, then your particles'' life will never decrease.
So, 2 questions :
1- how do you compute deltaT ?
2- what is the function randfloat(0,1) ?
I suggest looking at what randfloat returns.
If this function/method returns 0 (which will happen, for instance, if the returned value is an integer) then that''s the problem.
So, 2 questions :
1- how do you compute deltaT ?
2- what is the function randfloat(0,1) ?
I suggest looking at what randfloat returns.
If this function/method returns 0 (which will happen, for instance, if the returned value is an integer) then that''s the problem.
well.. here is that other code before im late for school oiy
|
Hey, I already talked about overlapping in a previous post ! 
Well, you should try to display 1 particle. see what happens.
Then try with 2 particles, and see if they overlap.
Then try with something like 10 and count them, and see if some particles seems brighter than other.
Is it''s the case then probably some particles are overlapping.

Well, you should try to display 1 particle. see what happens.
Then try with 2 particles, and see if they overlap.
Then try with something like 10 and count them, and see if some particles seems brighter than other.
Is it''s the case then probably some particles are overlapping.
I hope that mod, currenttime and lasttime are floats (or doubles).
If any of those 3 is an int, then there''s the problem.
Also, I suggest using the header :
float randfloat(float min, float max)
instead of :
float randfloat(const float& min, const float& max)
It''s faster, it''s safer, it uses les memory, and it may even solve your problem (not sure though).
If any of those 3 is an int, then there''s the problem.
Also, I suggest using the header :
float randfloat(float min, float max)
instead of :
float randfloat(const float& min, const float& max)
It''s faster, it''s safer, it uses les memory, and it may even solve your problem (not sure though).
Nope... should I just do ctrl-a del? ... it looks like 10 particles when i limit to that many but its going so fast its difficult to count
more or less its just that they all die at like the same time...
any ideas... not only that they seem to overlap but i dont knw
more or less its just that they all die at like the same time...
any ideas... not only that they seem to overlap but i dont knw
To see if they overlap, you may stop the time... and it won''t go too fast 
Otherwise, I can''t see where''s the prob.
All the code "looks" ok.
If you tried setting the randfloat parameters from "const float&" to "float" and it still doesn''t work, then I don''t know where to look for without the source code. Sorry

Otherwise, I can''t see where''s the prob.
All the code "looks" ok.
If you tried setting the randfloat parameters from "const float&" to "float" and it still doesn''t work, then I don''t know where to look for without the source code. Sorry

This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement