- Qt 6.12
- Qt Quick
- QML Types
- QtQuick.Particles
- Affector
- Qt 6.12.0 Reference Documentation

# Affector QML Type

Applies alterations to the attributes of logical particles at any point in their lifetime. More...

Import Statement: | `import QtQuick.Particles`
Inherits: | ParticleAffector

- List of all members, including inherited members

## Properties

- acceleration : StochasticDirection
- position : StochasticDirection
- relative : bool
- velocity : StochasticDirection

## Signals

- affectParticles(Array particles, real dt)

## Detailed Description

Custom Affector manipulates the properties of the particles directly in JavaScript.

## Property Documentation

### acceleration : StochasticDirection

Affected particles will have their acceleration set to this direction.

### position : StochasticDirection

Affected particles will have their position set to this direction, relative to the ParticleSystem. When interpreting directions as points, imagine it as an arrow with the base at the 0,0 of the ParticleSystem and the tip at where the specified position will be.

### relative : bool

Whether the affected particles have their existing position/velocity/acceleration added to the new one.

Default is true.

### velocity : StochasticDirection

Affected particles will have their velocity set to this direction.

## Signal Documentation

### affectParticles(Array particles, real dt)

This signal is emitted when particles are selected to be affected. particles is an array of particle objects which can be directly manipulated.

dt is the time since the last time it was affected. Use dt to normalize trajectory manipulations to real time.

Note: JavaScript is slower to execute, so it is not recommended to use this in high-volume particle systems.

Note: The corresponding handler is `onAffectParticles`.