Particle system that controls emission and the various properties or particles over their lifetime. More...
Header: | #include <Kuesa/Particles> |
Since: | Kuesa 1.3 |
This class was introduced in Kuesa 1.3.
enum class | AlignMode { FaceCamera, Velocity } |
|
|
Kuesa::Particles::AlignMode | alignMode() const |
QVector3D | emitterPosition() const |
QVector3D | emitterPositionRandom() const |
QVector3D | emitterVelocity() const |
QVector3D | emitterVelocityRandom() const |
QVector4D | finalColor() const |
QVector2D | finalSize() const |
float | frameTime() const |
QVector3D | gravity() const |
float | initialAngle() const |
float | initialAngleRandom() const |
QVector4D | initialColor() const |
QVector2D | initialSize() const |
int | maxParticlesEmittedPerFrame() const |
int | particleCount() const |
float | particleLifespan() const |
float | particleLifespanRandom() const |
float | rotationRate() const |
float | rotationRateRandom() const |
Qt3DRender::QAbstractTexture * | spriteTexture() const |
void | setAlignMode(Kuesa::Particles::AlignMode alignMode) |
void | setEmitterPosition(const QVector3D &emitterPosition) |
void | setEmitterPositionRandom(const QVector3D &emitterPositionRandom) |
void | setEmitterVelocity(const QVector3D &emitterVelocity) |
void | setEmitterVelocityRandom(const QVector3D &emitterVelocityRandom) |
void | setFinalColor(const QVector4D &finalColor) |
void | setFinalSize(const QVector2D &finalSize) |
void | setFrameTime(float frameTime) |
void | setGravity(const QVector3D &gravity) |
void | setInitialAngle(float initialAngle) |
void | setInitialAngleRandom(float initialAngleRandom) |
void | setInitialColor(const QVector4D &initialColor) |
void | setInitialSize(const QVector2D &initialSize) |
void | setMaxParticlesEmittedPerFrame(int maxParticlesEmittedPerFrame) |
void | setParticleCount(int particleCount) |
void | setParticleLifespan(float lifespan) |
void | setParticleLifespanRandom(float lifespanRandom) |
void | setRotationRate(float rotationRate) |
void | setRotationRateRandom(float rotationRateRandom) |
void | setSpriteTexture(Qt3DRender::QAbstractTexture *spriteTexture) |
void | alignModeChanged(Kuesa::Particles::AlignMode alignMode) |
void | emitterPositionChanged(const QVector3D &emitterPosition) |
void | emitterPositionRandomChanged(const QVector3D &emitterPositionRandom) |
void | emitterVelocityChanged(const QVector3D &emitterVelocity) |
void | emitterVelocityRandomChanged(const QVector3D &emitterVelocityRandom) |
void | finalColorChanged(const QVector4D &finalColor) |
void | finalSizeChanged(const QVector2D &finalSize) |
void | frameTimeChanged(float frameTime) |
void | gravityChanged(const QVector3D &gravity) |
void | initialAngleChanged(float initialAngle) |
void | initialAngleRandomChanged(float initialAngleRandom) |
void | initialColorChanged(const QVector4D &initialColor) |
void | initialSizeChanged(const QVector2D &initialSize) |
void | maxParticlesEmittedPerFrameChanged(int maxParticlesEmittedPerFrame) |
void | particleCountChanged(int particleCount) |
void | particleLifespanChanged(float particleLifespan) |
void | particleLifespanRandomChanged(float particleLifespanRandom) |
void | rotationRateChanged(float rotationRate) |
void | rotationRateRandomChanged(float rotationRateRandom) |
void | spriteTextureChanged(const Qt3DRender::QAbstractTexture *spriteTexture) |
#include <Qt3DExtras/Qt3DWindow> #include <ForwardRenderer> #include <SceneEntity> #include <Particles> Qt3DExtras::Qt3DWindow win; Kuesa::SceneEntity *root = new Kuesa::SceneEntity(); Kuesa::ForwardRenderer *frameGraph = new Kuesa::ForwardRenderer(); frameGraph->setParticlesEnabled(true) Kuesa::Particles *particles = new Kuesa::Particles(root); particles->setParticleCount(128); particles->setMaxParticlesEmittedPerFrame(4); particles->setGravity(QVector3D(0.0f, -1.0f, 0.0f)); ... win->setRootEntity(root); win->setActiveFrameGraph(forwardRenderer); ...
This enum type describes the available particle alignment modes.
Constant | Value | Description |
---|---|---|
Kuesa::Particles::AlignMode::FaceCamera | 0 | The particle faces the camera at all times. |
Kuesa::Particles::AlignMode::Velocity | 1 | The particle's local Y axis is aligned to its direction. |
Holds the alignment mode for the particles.
If the Velocity alignment mode is used, the initialAngle and rotationRate properties are ignored.
This property was introduced in Kuesa 1.3.
Access functions:
Kuesa::Particles::AlignMode | alignMode() const |
void | setAlignMode(Kuesa::Particles::AlignMode alignMode) |
Notifier signal:
void | alignModeChanged(Kuesa::Particles::AlignMode alignMode) |
Holds the world position of the particle emitter.
This property was introduced in Kuesa 1.3.
Access functions:
QVector3D | emitterPosition() const |
void | setEmitterPosition(const QVector3D &emitterPosition) |
Notifier signal:
void | emitterPositionChanged(const QVector3D &emitterPosition) |
Holds the randomness factor applied to the world position.
This property was introduced in Kuesa 1.3.
Access functions:
QVector3D | emitterPositionRandom() const |
void | setEmitterPositionRandom(const QVector3D &emitterPositionRandom) |
Notifier signal:
void | emitterPositionRandomChanged(const QVector3D &emitterPositionRandom) |
Holds the velocity applied to the particles.
This property was introduced in Kuesa 1.3.
Access functions:
QVector3D | emitterVelocity() const |
void | setEmitterVelocity(const QVector3D &emitterVelocity) |
Notifier signal:
void | emitterVelocityChanged(const QVector3D &emitterVelocity) |
Holds the velocity randomness factor applied to the particles.
This property was introduced in Kuesa 1.3.
Access functions:
QVector3D | emitterVelocityRandom() const |
void | setEmitterVelocityRandom(const QVector3D &emitterVelocityRandom) |
Notifier signal:
void | emitterVelocityRandomChanged(const QVector3D &emitterVelocityRandom) |
Holds the final color of the particles.
This property was introduced in Kuesa 1.3.
Access functions:
QVector4D | finalColor() const |
void | setFinalColor(const QVector4D &finalColor) |
Notifier signal:
void | finalColorChanged(const QVector4D &finalColor) |
Holds the final size of the particles.
This property was introduced in Kuesa 1.3.
Access functions:
QVector2D | finalSize() const |
void | setFinalSize(const QVector2D &finalSize) |
Notifier signal:
void | finalSizeChanged(const QVector2D &finalSize) |
Holds the speed at which updates need to be made in milliseconds.
This property was introduced in Kuesa 1.3.
Access functions:
float | frameTime() const |
void | setFrameTime(float frameTime) |
Notifier signal:
void | frameTimeChanged(float frameTime) |
Holds the gravity value to apply to the particles.
This property was introduced in Kuesa 1.3.
Access functions:
QVector3D | gravity() const |
void | setGravity(const QVector3D &gravity) |
Notifier signal:
void | gravityChanged(const QVector3D &gravity) |
Holds the initial rotation angle in radians of the particles.
This property was introduced in Kuesa 1.3.
Access functions:
float | initialAngle() const |
void | setInitialAngle(float initialAngle) |
Notifier signal:
void | initialAngleChanged(float initialAngle) |
Holds the initial rotation randomness factor applied to the particles.
This property was introduced in Kuesa 1.3.
Access functions:
float | initialAngleRandom() const |
void | setInitialAngleRandom(float initialAngleRandom) |
Notifier signal:
void | initialAngleRandomChanged(float initialAngleRandom) |
Holds the initial color of the particles.
This property was introduced in Kuesa 1.3.
Access functions:
QVector4D | initialColor() const |
void | setInitialColor(const QVector4D &initialColor) |
Notifier signal:
void | initialColorChanged(const QVector4D &initialColor) |
Holds the initial size of the particles.
This property was introduced in Kuesa 1.3.
Access functions:
QVector2D | initialSize() const |
void | setInitialSize(const QVector2D &initialSize) |
Notifier signal:
void | initialSizeChanged(const QVector2D &initialSize) |
Holds the maximum number of new particles that can be created each frame.
This property was introduced in Kuesa 1.3.
Access functions:
int | maxParticlesEmittedPerFrame() const |
void | setMaxParticlesEmittedPerFrame(int maxParticlesEmittedPerFrame) |
Notifier signal:
void | maxParticlesEmittedPerFrameChanged(int maxParticlesEmittedPerFrame) |
Holds the maximum number of particles the system can handle. Currently the maximum value is 2048.
This property was introduced in Kuesa 1.3.
Access functions:
int | particleCount() const |
void | setParticleCount(int particleCount) |
Notifier signal:
void | particleCountChanged(int particleCount) |
Holds the lifetime of the particles.
This property was introduced in Kuesa 1.3.
Access functions:
float | particleLifespan() const |
void | setParticleLifespan(float lifespan) |
Notifier signal:
void | particleLifespanChanged(float particleLifespan) |
Holds the lifetime randomness factor applied to the particles.
This property was introduced in Kuesa 1.3.
Access functions:
float | particleLifespanRandom() const |
void | setParticleLifespanRandom(float lifespanRandom) |
Notifier signal:
void | particleLifespanRandomChanged(float particleLifespanRandom) |
Holds the rotation speed applied to the particles.
This property was introduced in Kuesa 1.3.
Access functions:
float | rotationRate() const |
void | setRotationRate(float rotationRate) |
Notifier signal:
void | rotationRateChanged(float rotationRate) |
Holds the rotation speed randomness factor applied to the particles.
This property was introduced in Kuesa 1.3.
Access functions:
float | rotationRateRandom() const |
void | setRotationRateRandom(float rotationRateRandom) |
Notifier signal:
void | rotationRateRandomChanged(float rotationRateRandom) |
Holds the 2D sprite texture to apply to the particles.
This property was introduced in Kuesa 1.3.
Access functions:
Qt3DRender::QAbstractTexture * | spriteTexture() const |
void | setSpriteTexture(Qt3DRender::QAbstractTexture *spriteTexture) |
Notifier signal:
void | spriteTextureChanged(const Qt3DRender::QAbstractTexture *spriteTexture) |