Tone.Listener
↳ EXTENDS ToneBoth Tone.Panner3D and Tone.Listener have a position in 3D space using a right-handed cartesian coordinate system. The units used in the coordinate system are not defined; these coordinates are independent/invariant of any particular units such as meters or feet. Tone.Panner3D objects have an forward vector representing the direction the sound is projecting. Additionally, they have a sound cone representing how directional the sound is. For example, the sound could be omnidirectional, in which case it would be heard anywhere regardless of its forward, or it can be more directional and heard only if it is facing the listener. Tone.Listener objects (representing a person’s ears) have an forward and up vector representing in which direction the person is facing. Because both the source stream and the listener can be moving, they both have a velocity vector representing both the speed and direction of movement. Taken together, these two velocities can be used to generate a doppler shift effect which changes the pitch.
Note: the position of the Listener will have no effect on nodes not connected to a Tone.Panner3D
CONSTRUCTOR
new Tone.Listener ( )DEFAULTS
Members
.upZ
↝ Number #The z coordinate of the listener’s up direction. i.e. the direction the listener is standing in.
.forwardY
↝ Number #The y coordinate of the listeners front direction. i.e. which way they are facing.
.forwardZ
↝ Number #The z coordinate of the listeners front direction. i.e. which way they are facing.
.upX
↝ Number #The x coordinate of the listener’s up direction. i.e. the direction the listener is standing in.
.upY
↝ Number #The y coordinate of the listener’s up direction. i.e. the direction the listener is standing in.
.forwardX
↝ Number #The x coordinate of the listeners front direction. i.e. which way they are facing.
Methods
.setOrientation ( )
#this
Sets the orientation of the listener using two vectors, the forward vector (which direction the listener is facing) and the up vector (which the up direction of the listener). An up vector of 0, 0, 1 is equivalent to the listener standing up in the Z direction.
.setPosition ( )
#Sets the position of the listener in 3d space.