venerdì 18 dicembre 2015

Day 102: Fixed copy constructors

Ok, I managed to fix the bug I had yesterday...it was quite stupid but it took me an awfully long time because I was not searching for it where I should have. However this allowed me to find a few problems in several copy constructors, that could have brought to other problems in the future.

Now the  copy constructor of the emitter finally works, and the problem with this was its complexity: each emitter is owner of a vector of particles, which cannot be copied, but should be reinstantiated, so it needed a few tweaks to work correctly, both if used before the emitter initialization or after.

In the picture I created a gameobject with an emitter, and then I just duplicated the game object 3 times (which also copies the emitter component in it). Then I just replaced the update lambda that manages the updates of the particles to have different colors, while in the bottom left one I also modified the creation lambda to spawn different colors from the beginning.


Nessun commento:

Posta un commento