If I may have one more question:
So a particle will be a class having some basic position, velocity, color information, and a sf::Vertex verices[4] array.
If I want to scale, rotate a particle, am I supposed to write my own rotateQuad(sf::Vertex v[4]) function, where I deal with the individual vertices, or are there some SFML functions that can handle transformations that I could use, like sf::Sprite.SetRotation()?
EDIT: Should I make my Particle class inherit from sf::Transformable?
If yes, what do I need to do in order for the transformations to be "linked" with the 4 vertices, so that if I rotate/scale my particle, each particle's vertices' positions will be changed accordingly?
I see in the documentation, a custom Transformable class can be created like this:
class MyEntity : public sf::Transformable, public sf::Drawable
{
virtual void Draw(sf::RenderTarget& target, sf::RenderStates states) const
{
states.Transform *= GetTransform();
target.Draw(..., states);
}
};
But my Particle is not Drawable, the VertexArray is, and for all the particles, there is only one draw call with one RenderStates in it, so if RenderStates contains the transformation information, then I am not sure how to pass a separate RenderStates for each Particle in the VertexArray.