PXSoundListener Class Reference
| 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
-
transformThe sound transform.
property -
forwardThe forward facing vector.
property -
upThe up facing vector.
property -
xThe horizontal coordinate.
property -
yThe vertical coordinate.
property -
zThe depth coordinate.
property -
velocityXThe horizontal velocity.
property -
velocityYThe vertical velocity.
property -
velocityZThe depth velocity.
property -
defaultReferenceDistanceThe default reference distance for PXSoundTransform3D
property -
defaultLogarithmicExponentThe default logarithmic exponent for PXSoundTransform3D
property -
– setRotation:using2DPerspective:Changes the forward and up vectors to match the perspective at the given angle.
-
– setPositionWithX:y:z:Sets the position of the listener.
-
– setVelocityWithX:y:z:Sets the velocity of the listener.
Properties
defaultLogarithmicExponent
The default logarithmic exponent for PXSoundTransform3D
@property (nonatomic) float defaultLogarithmicExponentDiscussion
Default: 2.0f
See Also
Declared In
PXSoundListener.hdefaultReferenceDistance
The default reference distance for PXSoundTransform3D
@property (nonatomic) float defaultReferenceDistanceDiscussion
Default: 64.0f
See Also
Declared In
PXSoundListener.hforward
The forward facing vector.
@property (nonatomic, assign) PXVector3D *forwardDiscussion
Default: [0,0,-1]
Declared In
PXSoundListener.htransform
The sound transform.
@property (nonatomic, copy) PXSoundTransform3D *transformDiscussion
Default: [1,1]
Declared In
PXSoundListener.hup
The up facing vector.
@property (nonatomic, assign) PXVector3D *upDiscussion
Default: [0,1,0]
Declared In
PXSoundListener.hvelocityX
The horizontal velocity.
@property (nonatomic) float velocityXDiscussion
Default: 0.0f
Declared In
PXSoundListener.hvelocityY
The vertical velocity.
@property (nonatomic) float velocityYDiscussion
Default: 0.0f
Declared In
PXSoundListener.hvelocityZ
The depth velocity.
@property (nonatomic) float velocityZDiscussion
Default: 0.0f
Declared In
PXSoundListener.hx
The horizontal coordinate.
@property (nonatomic) float xDiscussion
Default: 0.0f
Declared In
PXSoundListener.hInstance Methods
setPositionWithX:y:z:
Sets the position of the listener.
- (void)setPositionWithX:(float)x y:(float)y z:(float)zParameters
- 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.msetRotation:using2DPerspective:
Changes the forward and up vectors to match the perspective at the given angle.
- (void)setRotation:(float)rotation using2DPerspective:(PXSoundListener2DPerspective)perspectiveParameters
- 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.msetVelocityWithX:y:z:
Sets the velocity of the listener.
- (void)setVelocityWithX:(float)x y:(float)y z:(float)zParameters
- 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