In questa pagina

QAudioListener Class

Definisce la posizione e l'orientamento della persona che ascolta un campo sonoro definito da QAudioEngine. Per saperne di più...

Intestazione: #include <QAudioListener>
CMake: find_package(Qt6 REQUIRED COMPONENTS SpatialAudio)
target_link_libraries(mytarget PRIVATE Qt6::SpatialAudio)
qmake: QT += spatialaudio
Eredita da: QObject

Funzioni pubbliche

QAudioListener(QAudioEngine *engine)
virtual ~QAudioListener() override
QAudioEngine *engine() const
QVector3D position() const
QQuaternion rotation() const
void setPosition(QVector3D pos)
void setRotation(const QQuaternion &q)

Descrizione dettagliata

Un oggetto ` QAudioEngine ` può avere esattamente un listener che definisce la posizione e l'orientamento della persona che ascolta il campo sonoro.

Documentazione delle funzioni membro

[explicit] QAudioListener::QAudioListener(QAudioEngine *engine)

Crea un listener per il motore audio spaziale di engine.

Nota: deve essere chiamato con un QAudioEngine

[override virtual noexcept] QAudioListener::~QAudioListener()

Elimina l'ascoltatore.

QAudioEngine *QAudioListener::engine() const

Restituisce il motore associato a questo listener.

QVector3D QAudioListener::position() const

Restituisce la posizione corrente del listener.

Vedi anche setPosition().

QQuaternion QAudioListener::rotation() const

Restituisce l'orientamento del listener nello spazio 3D.

Vedi anche setRotation().

void QAudioListener::setPosition(QVector3D pos)

Imposta la posizione del listener nello spazio 3D su pos. Per impostazione predefinita, le unità sono espresse in centimetri.

Vedi anche position() e QAudioEngine::distanceScale.

void QAudioListener::setRotation(const QQuaternion &q)

Imposta l'orientamento del listener nello spazio 3D su q.

Vedi anche rotation().

© 2026 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.