68 this->pointSize = pointSize;
69 this->refDepth = refDepth;
105 virtual std::vector<float>
getData()
const = 0;
const Vec3 RANDOM_COLOR
Sentinel that requests a random RGB color per particle.
Definition AbstractParticleSystem.h:33
const Vec3 RAINBOW_COLOR
Sentinel that can be used by subclasses to generate a rainbow map.
Definition AbstractParticleSystem.h:35
RAII wrapper for an OpenGL Vertex Array Object (VAO).
Thin RAII wrapper for an OpenGL buffer object with upload/binding helpers.
RAII wrapper around an OpenGL shader program with rich uniform/texture setters.
RAII wrapper for an OpenGL 2D texture with byte/half/float upload helpers.
4×4 matrix template for 3D transformations, projections, and stereo sets.
Mat4t< float > Mat4
Single-precision 4×4 matrix.
Definition Mat4.h:567
3D vector template with arithmetic, geometry helpers, and RNG utilities.
Vec3t< float > Vec3
3D float vector (x,y,z).
Definition Vec3.h:424
virtual std::vector< float > getData() const =0
Return interleaved particle attributes.
virtual size_t getParticleCount() const =0
Number of particles to draw.
virtual void setColor(const Vec3 &color)=0
Set a global color used by the emitter (override in derived classes).
void render(const Mat4 &v, const Mat4 &p)
Render all particles using the internal program and point sprite.
Definition AbstractParticleSystem.cpp:144
AbstractParticleSystem(float pointSize, float refDepth=1.0f)
Construct the renderer state.
Definition AbstractParticleSystem.cpp:121
float getPointSize() const
Current point size at the configured reference depth.
Definition AbstractParticleSystem.h:72
virtual void update(float t)=0
Advance simulation by t seconds (override in derived classes).
virtual ~AbstractParticleSystem()
Virtual destructor.
Definition AbstractParticleSystem.h:55
float getRefDepth() const
Current reference depth for size computation.
Definition AbstractParticleSystem.h:74
static Vec3 computeColor(const Vec3 &c)
Interpret special color sentinel values.
Definition AbstractParticleSystem.cpp:170
void setPointSize(float pointSize, float refDepth=1.0f)
Set the base point size and reference depth used by the shader.
Definition AbstractParticleSystem.h:67
OpenGL shader program with helpers for creation and data binding.
Definition GLProgram.h:59
Definition GLTexture2D.h:19