Particle3D QML Type

Abstract logical particle. More...

Import Statement: import QtQuick3D.Particles3D
Since: Qt 6.2
Inherits:

Object3D

Inherited By:

ModelBlendParticle3D, ModelParticle3D, and SpriteParticle3D

Properties

Detailed Description

This element defines the common properties of the logical particles. Particle3D is an abstract base class of particles, use ModelParticle3D or SpriteParticle3D instead.

Note: Unlike the materials used with the models, particles default to being rendered with assuming semi-transparency, and so with blending enabled. This is the desired behavior most of the time due to particle textures, color (alpha) variations, fadings etc. If you don't need the blending, set the hasTransparency to false for possible performance gains.

Property Documentation

AlignMode : enumeration

Defines the type of the alignment.

ConstantDescription
Particle3D.AlignNoneNo alignment. Particles rotation can be defined with particleRotation.
Particle3D.AlignTowardsTargetAlign the particles towards alignTargetPosition direction.
Particle3D.AlignTowardsStartVelocityAlign the particles towards their starting velocity direction.

FadeType : enumeration

Defines the type of the fading effect.

ConstantDescription
Particle3D.FadeNoneNo fading.
Particle3D.FadeOpacityFade the particle opacity from/to 0.0.
Particle3D.FadeScaleFade the particle scale from/to 0.0.

SortMode : enumeration

Defines the sorting mode of the particle. The sorting mode determines the order in which the particles are drawn.

ConstantDescription
Particle3D.SortNoneNo sorting.
Particle3D.SortNewestSort based on particle lifetime, newest first.
Particle3D.SortOldestSort based on particle lifetime, oldest first.
Particle3D.SortDistanceSort based on distance to the camera, farthest first.

alignMode : AlignMode

This property defines the align mode used for the particles. Particle alignment means the direction that particles face.

Note: When the SpriteParticle3D billboard property is set to true, alignMode does not have an effect.

The default value is Particle3D.AlignNone.

See also alignTargetPosition.


alignTargetPosition : vector3d

This property defines the position particles are aligned to. This property has effect only when the alignMode is set to Particle3D.AlignTowardsTarget.

See also alignMode.


color : color

This property defines the base color that is used for colorizing the particles.

The default value is "#FFFFFF" (white).


colorVariation : vector4d

This property defines the color variation that is used for colorizing the particles. The values are in RGBA order and each value should be between 0.0 (no variation) and 1.0 (full variation).

For example, to create particles which will have translucent red colors between #ff0000 and #e50000, with 40% to 60% opacity:

ModelParticle3D {
    ...
    color: "#7fff0000"
    colorVariation: Qt.vector4d(0.1, 0.0, 0.0, 0.2)
}

The default value is (0, 0, 0, 0) (no variation).

See also unifiedColorVariation.


fadeInDuration : int

This property defines the duration in milliseconds for the fading in effect.

Note: The fading durations are part of the particles lifeSpan. So e.g. if lifeSpan is 3000, fadeInDuration is 500 and fadeOutDuration is 500, the fully visible time of the particle is 2000ms.

The default value is 250.

See also fadeInEffect and fadeOutDuration.


fadeInEffect : FadeType

This property defines the fading effect used when the particles appear.

The default value is Particle3D.FadeOpacity.

See also fadeInDuration and fadeOutEffect.


fadeOutDuration : int

This property defines the duration in milliseconds for the fading out effect.

The default value is 250.

See also fadeOutEffect and fadeInDuration.


fadeOutEffect : FadeType

This property defines the fading effect used when the particles reach their lifeSpan and disappear.

The default value is Particle3D.FadeOpacity.

See also fadeOutDuration and fadeInEffect.


hasTransparency : bool

This property defines if the particle has any transparency and should be blended with the background. Usually this should be true, like when the particle color doesn't have full alpha, texture contains semi-transparent pixels or particles opacity is faded in or out. Setting this to false can be an optimization in specific cases.

The default value is true.

See also color, fadeInEffect, and fadeOutEffect.


maxAmount : int

This property defines the maximum amount of particles that can exist at the same time. You can use particlesUsed for debugging how efficiently the allocated particles are used. If the maxAmount is too small, particles are reused before they reach the end of their lifeSpan. If the maxAmount is too big, unnecessary memory is allocated for the particles.

Note: Changing the maxAmount resets all the particles in the particle system.

The default value is 100.


sortMode : SortMode

This property defines the sort mode used for the particles.

The default value is Particle3D.SortNone.


unifiedColorVariation : bool

This property defines if the colorVariation should be applied uniformly for all the color channels. This means that all variations are applied with the same random amount.

For example, to create particles which will have yellow colors between #ffff00 and #7f7f00, so that the values of R and G color channels are always the same:

ModelParticle3D {
    ...
    color: "#ffff00"
    colorVariation: Qt.vector4d(0.5, 0.5, 0.0, 0.0)
    unifiedColorVariation: true
}

The default value is false.

See also colorVariation.


© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.