@Nedelstein wrote:
Hi All,
I am fairly new to OF (and coding in general) so please excuse the noob questions. I am working on a small interactive particle system project and have some questions.
Any help would be greatly appreciated!
I am trying to do some collision (both between particles in the same particle system and between those particles and string elements) and I am running into some issues:
The particles read and react correctly when they collide into each other, but they also seem to be running the collision function on themselves. I have nested for loops and run the collision function only when the particles[i].pos != particles[j].pos, but it doesn’t seem to be making a difference.
I am using drawStringsAsShapes for my string variables, but how do I do collision between them and the particles? I have a letterCollide function in my ParticleSystemTop class, but I think I need to be more specific with the location of the string. Eventually I want the particles to bounce off the letter (when the appropriate key is pressed). Also, I’ll have the particles coming from all directions (right now they’re just coming from the top).
I am running into memory issues. I think this is related to my first question, as the computer is running too many calculations at once. After a little while, the movement of the particles gets really choppy and eventually the project freezes. What am I doing wrong?
Code: https://github.com/Nedelstein/edeln591_dtOF_2018/tree/master/interactiveLettersMidterm
Thanks in advance for your help!
Posts: 2
Participants: 1