Re-added ParticleSystem:setQuads(q1, q2, ...). Active particles use the quads based on the particle's lifetime in a similar style to ParticleSystem:setColors and ParticleSystem:setSizes.

This commit is contained in:
Alex Szpakowski
2014-06-15 18:20:05 -03:00
parent d2450d5f2e
commit b9cd93e071
4 changed files with 115 additions and 0 deletions
@@ -27,6 +27,7 @@
#include "common/Vector.h"
#include "graphics/Drawable.h"
#include "graphics/Color.h"
#include "graphics/Quad.h"
#include "Texture.h"
// STL
@@ -421,6 +422,17 @@ public:
**/
std::vector<Color> getColor() const;
/**
* Sets a list of Quads to use for particles over their lifetime.
**/
void setQuads(const std::vector<Quad *> &newQuads);
void setQuads();
/**
* Gets the Quads used when drawing the particles.
**/
const std::vector<Quad *> &getQuads() const;
/**
* sets whether particle angles & rotations are relative to their velocities.
**/
@@ -531,6 +543,8 @@ protected:
float spinEnd;
Colorf color;
int quadIndex;
};
// Pointer to the beginning of the allocated memory.
@@ -625,6 +639,9 @@ protected:
// Color.
std::vector<Colorf> colors;
// Quads.
std::vector<Quad *> quads;
bool relativeRotation;
void createBuffers(size_t size);