Particle3D QML Type

Abstract logical particle. 更多...

导入语句: import QtQuick3D.Particles3D
Since: Qt 6.2
继承:

Object3D

继承者:

ModelBlendParticle3D , ModelParticle3D ,和 SpriteParticle3D

特性

详细描述

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

注意: 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.

特性文档编制

AlignMode : enumeration

Defines the type of the alignment.

常量 描述
Particle3D.AlignNone No alignment. Particles rotation can be defined with particleRotation .
Particle3D.AlignTowardsTarget Align the particles towards alignTargetPosition direction.
Particle3D.AlignTowardsStartVelocity Align the particles towards their starting velocity direction.

FadeType : enumeration

Defines the type of the fading effect.

常量 描述
Particle3D.FadeNone No fading.
Particle3D.FadeOpacity Fade the particle opacity from/to 0.0.
Particle3D.FadeScale Fade 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.

常量 描述
Particle3D.SortNone No sorting.
Particle3D.SortNewest Sort based on particle lifetime, newest first.
Particle3D.SortOldest Sort based on particle lifetime, oldest first.
Particle3D.SortDistance Sort 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.

注意: SpriteParticle3D billboard property is set to true , alignMode does not have an effect.

默认值为 Particle3D.AlignNone .

另请参阅 alignTargetPosition .


alignTargetPosition : vector3d

This property defines the position particles are aligned to. This property has effect only when the alignMode 被设为 Particle3D.AlignTowardsTarget .

另请参阅 alignMode .


color : color

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

默认值为 "#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)
}

默认值为 (0, 0, 0, 0) (no variation).

另请参阅 unifiedColorVariation .


fadeInDuration : int

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

注意: 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.

默认值为 250 .

另请参阅 fadeInEffect and fadeOutDuration .


fadeInEffect : FadeType

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

默认值为 Particle3D.FadeOpacity .

另请参阅 fadeInDuration and fadeOutEffect .


fadeOutDuration : int

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

默认值为 250 .

另请参阅 fadeOutEffect and fadeInDuration .


fadeOutEffect : FadeType

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

默认值为 Particle3D.FadeOpacity .

另请参阅 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.

默认值为 true .

另请参阅 color , fadeInEffect ,和 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.

注意: Changing the maxAmount resets all the particles in the particle system.

默认值为 100 .


sortMode : SortMode

This property defines the sort mode used for the particles.

默认值为 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
}

默认值为 false .

另请参阅 colorVariation .

内容