Defines the position and orientation of the person listening to a sound field defined by QAudioEngine . 更多...
头: | #include <QAudioListener> |
CMake: |
find_package(Qt6 REQUIRED COMPONENTS SpatialAudio)
target_link_libraries(mytarget PRIVATE Qt6::SpatialAudio) |
qmake: | QT += spatialaudio |
继承: | QObject |
QAudioListener (QAudioEngine * engine ) | |
virtual | ~QAudioListener () |
QAudioEngine * | engine () const |
QVector3D | position () const |
QQuaternion | rotation () const |
void | setPosition (QVector3D pos ) |
void | setRotation (const QQuaternion & q ) |
A QAudioEngine can have exactly one listener that defines the position and orientation of the person listening to the sound field.
[explicit]
QAudioListener::
QAudioListener
(
QAudioEngine
*
engine
)
Creates a listener for the spatial audio engine for engine .
[virtual noexcept]
QAudioListener::
~QAudioListener
()
Destroys the listener.
Returns the engine associated with this listener.
Returns the current position of the listener.
另请参阅 setPosition ().
Returns the listener's orientation in 3D space.
另请参阅 setRotation ().
Sets the listener's position in 3D space to pos . Units are in centimeters by default.
另请参阅 position () 和 QAudioEngine::distanceScale .
Sets the listener's orientation in 3D space to q .
另请参阅 rotation ().