![]() |
CUGL 3.0
Cornell University Game Library
|
#include <CUParticleSystem.h>
Public Member Functions | |
ParticleInstance () | |
Public Attributes | |
Vec4 | position |
Color4 | color |
Vec2 | texOffset |
float | distance |
This class is a struct representing the data for a particle instance
A particle system takes the template and multiplies using instancing. This struct represents the data unique to each instance.
Sprite animation is handled via the attribute texOffset. This value is added to the texture coordinates of the template to produce the new texture coordinates. This requires each texture component to have the same size. Set this value to (0,0) to disable animation.
Particle Instances are used by InstanceBuffer
to render the particle instances. So we do not refer to them with shared pointers, or have fancy constructor for them.
|
inline |
Creates an empty particle instance
Color4 cugl::graphics::ParticleInstance::color |
The color of the particle
float cugl::graphics::ParticleInstance::distance |
The squared distance to the camera. If dead, this value is -1.0f
Vec4 cugl::graphics::ParticleInstance::position |
The position of the particle in 3d space; w is the radius
Vec2 cugl::graphics::ParticleInstance::texOffset |
The texture offset of this particle (for animation)