com.jogamp.openal.sound3d
Class Listener

java.lang.Object
  extended by com.jogamp.openal.sound3d.Listener

public class Listener
extends Object

This class represents the human listener in the Sound3D environment. It provides methods for controlling the position, orientation as well as other properties associated with the listener.

Author:
Athomas Goldberg

Method Summary
 float getGain()
          Gets the value of the gain, or volume of the audio in the environment relative to the listener.
 float[] getOrientation()
          Gets the orientation of the Listener in the Sound3D environment.
 Vec3f getPosition()
          Gets the position in (x-y-z coordinates) of the Listener in the Sound3D environment.
 Vec3f getVelocity()
          Gets the velocity in (x-y-z coordinates) of the Listener in the Sound3D environment.
 void setGain(float gain)
          Sets the Gain, or volume of the audio in the environment relative to the listener
 void setOrientation(float[] orientation)
          Sets the orientation of the Listener in the Sound3D environment.
 void setPosition(float x, float y, float z)
          Sets the position in (x-y-z coordinates) of the Listener in the Sound3D environment.
 void setPosition(Vec3f position)
          Sets the position in (x-y-z coordinates) of the Listener in the Sound3D environment.
 void setVelocity(Vec3f velocity)
          Sets the velocity in (x-y-z coordinates) of the Listener in the Sound3D environment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setGain

public void setGain(float gain)
Sets the Gain, or volume of the audio in the environment relative to the listener

Parameters:
gain - the gain, or volume

getGain

public float getGain()
Gets the value of the gain, or volume of the audio in the environment relative to the listener.

Returns:
the gain value.

setPosition

public void setPosition(float x,
                        float y,
                        float z)
Sets the position in (x-y-z coordinates) of the Listener in the Sound3D environment.

Parameters:
x - The position of the listener along the X-axis in the Sound3D environment
y - The position of the listener along the Y-axis in the Sound3D environment
z - The position of the listener along the Z-axis in the Sound3D environment

setPosition

public void setPosition(Vec3f position)
Sets the position in (x-y-z coordinates) of the Listener in the Sound3D environment.

Parameters:
position - a Vec3f object containing the x,y and z coordinates of Listener.

getPosition

public Vec3f getPosition()
Gets the position in (x-y-z coordinates) of the Listener in the Sound3D environment.

Returns:
a Vec3f object containing the x,y and z coordinates of Listener.

setVelocity

public void setVelocity(Vec3f velocity)
Sets the velocity in (x-y-z coordinates) of the Listener in the Sound3D environment. Used in determining doppler shift.

Parameters:
velocity - a Vec3f object containing the velicity in x,y and z coordinates of Listener.

getVelocity

public Vec3f getVelocity()
Gets the velocity in (x-y-z coordinates) of the Listener in the Sound3D environment. Used in determining doppler shift.

Returns:
a Vec3f object containing the velicity in x,y and z coordinates of Listener.

setOrientation

public void setOrientation(float[] orientation)
Sets the orientation of the Listener in the Sound3D environment. Orientation is expressed as "up" and "at" vectors.

Parameters:
orientation - The first 3 elements of the array should contain the x,y,z up-vector, the second 3 elements should contain the x,z,z look-at vector.

getOrientation

public float[] getOrientation()
Gets the orientation of the Listener in the Sound3D environment. Orientation is expressed as "up" and "at" vectors.

Returns:
an array containing the orientation of the listener. The first 3 elements of the array contain the x,y,z up-vector, the second 3 elements contain the x,z,z look-at vector.