Since the position the camera follows is just kept track of through a pointer to a memory location, it's inevitable that this gets screwed up by changing the size of the vector that contains that position.
To fix this, give camera a pointer to a pointer, which points to a pointer in the simulation component, which will then be adjusted or set to null depending on how data is rearranged.
Since the position the camera follows is just kept track of through a pointer to a memory location, it's inevitable that this gets screwed up by changing the size of the vector that contains that position. To fix this, give camera a pointer to a pointer, which points to a pointer in the simulation component, which will then be adjusted or set to null depending on how data is rearranged.