ParticleSystem3D QML Type

A system which includes particle, emitter, and affector types. 更多...

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

Node

特性

方法

详细描述

This element is the root of the particle system, which handles the system timing and groups all the other related elements like particles, emitters, and affectors together. To group the system elements, they either need to be direct children of the ParticleSystem3D like this:

ParticleSystem3D {
    ParticleEmitter3D {
        ...
    }
    SpriteParticle3D {
        ...
    }
}
					

Or if the system elements are not direct children, they need to use system property to point which ParticleSystem3D they belong to. Like this:

ParticleSystem3D {
    id: psystem
}
ParticleEmitter3D {
    system: psystem
    ...
}
SpriteParticle3D {
    system: psystem
    ...
}
					

特性文档编制

logging : bool

Set this to true to collect loggingData .

注意: This property has some performance impact, so it should not be enabled in releases.

默认值为 false .

另请参阅 loggingData .

loggingData : ParticleSystem3DLogging [read-only]

This property contains logging data which can be useful when developing and optimizing the particle effects.

注意: This property contains correct data only when logging 被设为 true and particle system is running.

另请参阅 logging .

paused : bool

This property defines if system is currently paused. If paused is set to true , the particle system will not advance the simulation. When paused is set to false again, the simulation will resume from the same point where it was paused.

默认值为 false .

running : bool

This property defines if system is currently running. If running is set to false , the particle system will stop the simulation. All particles will be destroyed when the system is set to running again.

Running should be set to false when manually modifying/animating the time 特性。

默认值为 true .

seed : int

This property defines the seed value used for particles randomization. With the same seed, particles effect will be identical on every run. This is useful when deterministic behavior is desired over random behavior.

默认值为 0 useRandomSeed 被设为 false , and something in between 1..INT32_MAX useRandomSeed 被设为 true .

注意: This property should not be modified during the particle animations.

另请参阅 useRandomSeed .

startTime : int

This property defines time in milliseconds where the system starts. This can be useful to warm up the system so that a set of particles has already been emitted. If for example startTime is set to 2000 and system time is animating from 0 to 1000, actually animation shows particles from 2000 to 3000ms.

默认值为 0 .

time : int

This property defines time in milliseconds for the system.

注意: When modifying the time property, running should usually be set to false .

Here is an example how to manually animate the system for 3 seconds, in a loop, at half speed:

ParticleSystem3D {
    running: false
    NumberAnimation on time {
        loops: Animation.Infinite
        from: 0
        to: 3000
        duration: 6000
    }
}
					

useRandomSeed : bool

This property defines if particle system seed should be random or user defined. When true , a new random value for seed is generated every time particle system is restarted.

默认值为 true .

注意: This property should not be modified during the particle animations.

另请参阅 seed .

方法文档编制

reset ()

This method resets the internal state of the particle system to it's initial state. This can be used when running 特性为 false to reset the system. The running is true this method does not need to be called as the system is managing the internal state, but when it is false the system needs to be told when the system should be reset.