Wasabi
|
#include <WParticles.hpp>
Public Types | |
enum | Type : uint8_t { BILLBOARD = 0, NOVA = 1 } |
Public Member Functions | |
WDefaultParticleBehavior (uint32_t maxParticles) | |
virtual void | UpdateSystem (float curTime, const WMatrix &worldMatrix, class WCamera *camera) |
virtual bool | UpdateParticle (float curTime, void *particleData, WParticlesInstance *outputInstance, const WMatrix &worldMatrix, class WCamera *camera) |
virtual WVector3 & | GetMinPoint () |
virtual WVector3 & | GetMaxPoint () |
![]() | |
WParticlesBehavior (uint32_t maxParticles, uint32_t particleSize) | |
uint32_t | UpdateAndCopyToBuffer (float curTime, void *buffer, uint32_t maxParticles, const WMatrix &worldMatrix, class WCamera *camera) |
Public Attributes | |
WVector3 | m_emissionPosition |
WVector3 | m_emissionRandomness |
float | m_particleLife |
WVector3 | m_particleSpawnVelocity |
bool | m_moveOutwards |
float | m_emissionFrequency |
float | m_emissionSize |
float | m_deathSize |
WDefaultParticleBehavior::Type | m_type |
uint32_t | m_numTilesColumns |
uint32_t | m_numTiles |
std::vector< std::pair< WColor, float > > | m_colorGradient |
Additional Inherited Members | |
![]() | |
void | Emit (void *particle) |
Default particles behavior implementation, good for basic/starter particle systems.
enum WDefaultParticleBehavior::Type : uint8_t |
|
inlinevirtual |
Must be implemented to return the maximum point in the bounding box of the particles in local space of the instances.
Implements WParticlesBehavior.
|
inlinevirtual |
Must be implemented to return the minimum point in the bounding box of the particles in local space of the instances.
Implements WParticlesBehavior.
|
inlinevirtual |
Must be implemented by a derived class to define the per-frame behavior of a single particle.
curTime | The time elapsed since the beginning of the program |
particleData | A pointer to the beginning of the vertices memory to fill. The memory will have sizeof(WParticlesInstance) bytes to be filled with the 4 vertices of the particle billboard. The output vertex must be in VIEW SPACE |
outputInstance | A pointer to the buffer to be filled with the instance data for the particle particleData. The transformation matrix is used as-is to transform from local space to projection space |
worldMatrix | The world matrix of the particles system |
camera | The camera used to render the frame |
Implements WParticlesBehavior.
|
virtual |
Must be implemented by a derived class to define the per-frame behavior of the particle system. Typically this should control emission by calling Emit() when a particle needs to be emitted.
curTime | The time elapsed since the beginning of the program |
worldMatrix | The world matrix of the camera rendering the particles |
camera | The camera used to render the frame |
Implements WParticlesBehavior.
std::vector<std::pair<WColor, float> > WDefaultParticleBehavior::m_colorGradient |
An array of (color, time) where color is the color of the particle (multiplied by the texture) at a given time (starting from 0) and lasting for 'time'. The sum of the time element in the vector elements should be equal to 1, where 1 is the time of the particle's death. (default is {<(1,1,1,0), 0.2>, <(1,1,1,1), 0.8>, <(1,1,1,0), 0.0>}
float WDefaultParticleBehavior::m_deathSize |
Size of a particle at death (default is 3)
float WDefaultParticleBehavior::m_emissionFrequency |
Number of particles to emit per second (default is 20)
WVector3 WDefaultParticleBehavior::m_emissionPosition |
Position at which new particles spawn (default is (0,0,0))
WVector3 WDefaultParticleBehavior::m_emissionRandomness |
Dimensions of a cube at m_emissionPosition where particles randomly spawn (default is (1, 1, 1)
float WDefaultParticleBehavior::m_emissionSize |
Size of a particle at emission (default is 1)
bool WDefaultParticleBehavior::m_moveOutwards |
If set to true, initial particle velocity will not be m_particleSpawnVelocity, but instead it will be calculated as the vector from m_emissionPosition to the spawn position (affected by m_emissionRandomness) with the speed being the length of m_particleSpawnVelocity
uint32_t WDefaultParticleBehavior::m_numTiles |
Total number of tiles in the texture (default is 1)
uint32_t WDefaultParticleBehavior::m_numTilesColumns |
Number of columns in the texture if it is tiled (otherwise 1, which is the default)
float WDefaultParticleBehavior::m_particleLife |
Lifetime (in seconds) of each particle (default is 1.5)
WVector3 WDefaultParticleBehavior::m_particleSpawnVelocity |
A direction/velocity vector for spawned particles default is (0, 2, 0)
WDefaultParticleBehavior::Type WDefaultParticleBehavior::m_type |
Type of the particle (default is BILLBOARD)