Kuesa::Qt3D::Particles
Module: Kuesa Qt 3D API
Particle system that controls emission and the various properties or particles over their lifetime. More...
#include <Kuesa/Qt3D/api/particles.h>
Inherits from Qt3DCore::QEntity
Public Types
|
Name |
enum class |
AlignMode { FaceCamera, Velocity} |
Public Slots
Public Signals
Public Functions
Public Properties
Detailed Description
| class Kuesa::Qt3D::Particles;
|
Particle system that controls emission and the various properties or particles over their lifetime.
Since: Kuesa 2.0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 | #include <Qt3DExtras/Qt3DWindow>
#include <ForwardRenderer>
#include <SceneEntity>
#include <Particles>
Qt3DExtras::Qt3DWindow win;
Kuesa::Qt3D::SceneEntity *root = new Kuesa::Qt3D::SceneEntity();
Kuesa::Qt3D::ForwardRenderer *frameGraph = new Kuesa::Qt3D::ForwardRenderer();
frameGraph->setParticlesEnabled(true)
Kuesa::Qt3D::Particles *particles = new Kuesa::Qt3D::Particles(root);
particles->setParticleCount(128);
particles->setMaxParticlesEmittedPerFrame(4);
particles->setGravity(QVector3D(0.0f, -1.0f, 0.0f));
...
win->setRootEntity(root);
win->setActiveFrameGraph(forwardRenderer);
...
|
Public Types Documentation
enum AlignMode
Enumerator |
Value |
Description |
FaceCamera |
|
|
Velocity |
|
|
This enum type describes the available particle alignment modes.
- FaceCamera The particle faces the camera at all times.
- Velocity The particle's local Y axis is aligned to its direction.
Public Slots Documentation
slot setParticleCount
| void setParticleCount(
int particleCount
)
|
slot setFrameTime
| void setFrameTime(
float frameTime
)
|
slot setMaxParticlesEmittedPerFrame
| void setMaxParticlesEmittedPerFrame(
int maxParticlesEmittedPerFrame
)
|
slot setGravity
| void setGravity(
const QVector3D & gravity
)
|
slot setEmitterPosition
| void setEmitterPosition(
const QVector3D & emitterPosition
)
|
slot setEmitterPositionRandom
| void setEmitterPositionRandom(
const QVector3D & emitterPositionRandom
)
|
slot setEmitterVelocity
| void setEmitterVelocity(
const QVector3D & emitterVelocity
)
|
slot setEmitterVelocityRandom
| void setEmitterVelocityRandom(
const QVector3D & emitterVelocityRandom
)
|
slot setParticleLifespan
| void setParticleLifespan(
float lifespan
)
|
slot setParticleLifespanRandom
| void setParticleLifespanRandom(
float lifespanRandom
)
|
slot setInitialSize
| void setInitialSize(
const QVector2D & initialSize
)
|
slot setFinalSize
| void setFinalSize(
const QVector2D & finalSize
)
|
slot setInitialColor
| void setInitialColor(
const QVector4D & initialColor
)
|
slot setFinalColor
| void setFinalColor(
const QVector4D & finalColor
)
|
slot setInitialAngle
| void setInitialAngle(
float initialAngle
)
|
slot setInitialAngleRandom
| void setInitialAngleRandom(
float initialAngleRandom
)
|
slot setRotationRate
| void setRotationRate(
float rotationRate
)
|
slot setRotationRateRandom
| void setRotationRateRandom(
float rotationRateRandom
)
|
slot setSpriteTexture
| void setSpriteTexture(
Qt3DRender::QAbstractTexture * spriteTexture
)
|
slot setAlignMode
| void setAlignMode(
AlignMode alignMode
)
|
Public Signals Documentation
signal particleCountChanged
| void particleCountChanged(
int particleCount
)
|
signal frameTimeChanged
| void frameTimeChanged(
float frameTime
)
|
signal maxParticlesEmittedPerFrameChanged
| void maxParticlesEmittedPerFrameChanged(
int maxParticlesEmittedPerFrame
)
|
signal gravityChanged
| void gravityChanged(
const QVector3D & gravity
)
|
signal emitterPositionChanged
| void emitterPositionChanged(
const QVector3D & emitterPosition
)
|
signal emitterPositionRandomChanged
| void emitterPositionRandomChanged(
const QVector3D & emitterPositionRandom
)
|
signal emitterVelocityChanged
| void emitterVelocityChanged(
const QVector3D & emitterVelocity
)
|
signal emitterVelocityRandomChanged
| void emitterVelocityRandomChanged(
const QVector3D & emitterVelocityRandom
)
|
signal particleLifespanChanged
| void particleLifespanChanged(
float particleLifespan
)
|
signal particleLifespanRandomChanged
| void particleLifespanRandomChanged(
float particleLifespanRandom
)
|
signal initialSizeChanged
| void initialSizeChanged(
const QVector2D & initialSize
)
|
signal finalSizeChanged
| void finalSizeChanged(
const QVector2D & finalSize
)
|
signal initialColorChanged
| void initialColorChanged(
const QVector4D & initialColor
)
|
signal finalColorChanged
| void finalColorChanged(
const QVector4D & finalColor
)
|
signal initialAngleChanged
| void initialAngleChanged(
float initialAngle
)
|
signal initialAngleRandomChanged
| void initialAngleRandomChanged(
float initialAngleRandom
)
|
signal rotationRateChanged
| void rotationRateChanged(
float rotationRate
)
|
signal rotationRateRandomChanged
| void rotationRateRandomChanged(
float rotationRateRandom
)
|
signal spriteTextureChanged
| void spriteTextureChanged(
const Qt3DRender::QAbstractTexture * spriteTexture
)
|
signal alignModeChanged
| void alignModeChanged(
AlignMode alignMode
)
|
Public Functions Documentation
function Q_ENUM
function Particles
| explicit Particles(
Qt3DCore::QEntity * parent =nullptr
)
|
function particleCount
| int particleCount() const
|
function frameTime
function maxParticlesEmittedPerFrame
| int maxParticlesEmittedPerFrame() const
|
function gravity
| QVector3D gravity() const
|
function emitterPosition
| QVector3D emitterPosition() const
|
function emitterPositionRandom
| QVector3D emitterPositionRandom() const
|
function emitterVelocity
| QVector3D emitterVelocity() const
|
function emitterVelocityRandom
| QVector3D emitterVelocityRandom() const
|
function particleLifespan
| float particleLifespan() const
|
function particleLifespanRandom
| float particleLifespanRandom() const
|
function initialSize
| QVector2D initialSize() const
|
function finalSize
| QVector2D finalSize() const
|
function initialColor
| QVector4D initialColor() const
|
function finalColor
| QVector4D finalColor() const
|
function initialAngle
| float initialAngle() const
|
function initialAngleRandom
| float initialAngleRandom() const
|
function rotationRate
| float rotationRate() const
|
function rotationRateRandom
| float rotationRateRandom() const
|
function spriteTexture
| Qt3DRender::QAbstractTexture * spriteTexture() const
|
function alignMode
| AlignMode alignMode() const
|
Public Property Documentation
property particleCount
Since: Kuesa 2.0
Holds the maximum number of particles the system can handle. Currently the maximum value is 2048.
\default 32
property frameTime
Since: Kuesa 2.0
Holds the speed at which updates need to be made in milliseconds.
\default 1/60
property maxParticlesEmittedPerFrame
| int maxParticlesEmittedPerFrame;
|
Since: Kuesa 2.0
Holds the maximum number of new particles that can be created each frame.
\default 4
property gravity
Since: Kuesa 2.0
Holds the gravity value to apply to the particles.
property emitterPosition
| QVector3D emitterPosition;
|
Since: Kuesa 2.0
Holds the world position of the particle emitter.
property emitterPositionRandom
| QVector3D emitterPositionRandom;
|
Since: Kuesa 2.0
Holds the randomness factor applied to the world position.
property emitterVelocity
| QVector3D emitterVelocity;
|
Since: Kuesa 2.0
Holds the velocity applied to the particles.
property emitterVelocityRandom
| QVector3D emitterVelocityRandom;
|
Since: Kuesa 2.0
Holds the velocity randomness factor applied to the particles.
property particleLifespan
Since: Kuesa 2.0 \default 1
Holds the lifetime of the particles.
property particleLifespanRandom
| float particleLifespanRandom;
|
Since: Kuesa 2.0
Holds the lifetime randomness factor applied to the particles.
property initialSize
Since: Kuesa 2.0 \default 0
Holds the initial size of the particles.
property finalSize
Since: Kuesa 2.0
Holds the final size of the particles.
property initialColor
Since: Kuesa 2.0
Holds the initial color of the particles.
property finalColor
Since: Kuesa 2.0
Holds the final color of the particles.
property initialAngle
Since: Kuesa 2.0
Holds the initial rotation angle in radians of the particles.
property initialAngleRandom
| float initialAngleRandom;
|
Since: Kuesa 2.0
Holds the initial rotation randomness factor applied to the particles.
property rotationRate
Since: Kuesa 2.0
Holds the rotation speed applied to the particles.
property rotationRateRandom
| float rotationRateRandom;
|
Since: Kuesa 2.0
Holds the rotation speed randomness factor applied to the particles.
property spriteTexture
| Qt3DRender::QAbstractTexture * spriteTexture;
|
Since: Kuesa 2.0
Holds the 2D sprite texture to apply to the particles.
property alignMode
Since: Kuesa 2.0
Holds the alignment mode for the particles.
- FaceCamera The particle faces the camera at all times.
- Velocity The particle's local Y axis is aligned to its direction.
If the Velocity alignment mode is used, the initialAngle and rotationRate properties are ignored.
Updated on 2023-07-03 at 11:02:09 +0000