Inherits from NSObject
Declared in PXSoundListener.h
PXSoundListener.m

Overview

Represents a listener in a three-dimensional coordinate system. A listener’s orientation is defined by two vectors; the forward-vector and the up-vector. These vectors can quickly be set by using the setRotation:using2DPerspective: method.

            |
            |  _ +z
            |  /|
            | /
            |/
------------*-----------> +x
           /|
          / |
         /  |
            |
            V
           +y

Tasks

Properties

defaultLogarithmicExponent

The default logarithmic exponent for PXSoundTransform3D

@property (nonatomic) float defaultLogarithmicExponent

Discussion

Default: 2.0f

Declared In

PXSoundListener.h

defaultReferenceDistance

The default reference distance for PXSoundTransform3D

@property (nonatomic) float defaultReferenceDistance

Discussion

Default: 64.0f

Declared In

PXSoundListener.h

forward

The forward facing vector.

@property (nonatomic, assign) PXVector3D *forward

Discussion

Default: [0,0,-1]

Declared In

PXSoundListener.h

transform

The sound transform.

@property (nonatomic, copy) PXSoundTransform3D *transform

Discussion

Default: [1,1]

Declared In

PXSoundListener.h

up

The up facing vector.

@property (nonatomic, assign) PXVector3D *up

Discussion

Default: [0,1,0]

Declared In

PXSoundListener.h

velocityX

The horizontal velocity.

@property (nonatomic) float velocityX

Discussion

Default: 0.0f

Declared In

PXSoundListener.h

velocityY

The vertical velocity.

@property (nonatomic) float velocityY

Discussion

Default: 0.0f

Declared In

PXSoundListener.h

velocityZ

The depth velocity.

@property (nonatomic) float velocityZ

Discussion

Default: 0.0f

Declared In

PXSoundListener.h

x

The horizontal coordinate.

@property (nonatomic) float x

Discussion

Default: 0.0f

Declared In

PXSoundListener.h

y

The vertical coordinate.

@property (nonatomic) float y

Discussion

Default: 0.0f

Declared In

PXSoundListener.h

z

The depth coordinate.

@property (nonatomic) float z

Discussion

Default: 0.0f

Declared In

PXSoundListener.h

Instance Methods

setPositionWithX:y:z:

Sets the position of the listener.

- (void)setPositionWithX:(float)x y:(float)y z:(float)z

Parameters

x

The x-position in 3 space.

y

The y-position in 3 space.

z

The z-position in 3 space.

Example:

[[PXSoundMixer soundListener] setPositionWithX:240.0f y:160.0f z:0.0f];
// Set's the position of the listener to [240.0f, 160.0f, 0.0f];

Declared In

PXSoundListener.m

setRotation:using2DPerspective:

Changes the forward and up vectors to match the perspective at the given angle.

- (void)setRotation:(float)rotation using2DPerspective:(PXSoundListener2DPerspective)perspective

Parameters

rotation

The angle in degrees of rotation.

perspective

The perspective of rotation.

Example:

[[PXSoundMixer soundListener] setRotation:-90.0f using2DPerspective:PXSoundListener2DPerspective_SideView];
// forward[0,0,-1], up[0,1,0]

Declared In

PXSoundListener.m

setVelocityWithX:y:z:

Sets the velocity of the listener.

- (void)setVelocityWithX:(float)x y:(float)y z:(float)z

Parameters

x

The x-velocity in 3 space.

y

The y-velocity in 3 space.

z

The z-velocity in 3 space.

Example:

[[PXSoundMixer soundListener] setVelocityWithX:10.0f y:-5.0f z:0.0f];
// Set's the velocity of the listener to [10.0f, -5.0f, 0.0f];

Declared In

PXSoundListener.m