|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.jinx.audio.AbstractListener
public abstract class AbstractListener
Simple Listener implementation that takes care of storing the AL and ALC
objects for you. It also has a number of utility methods, too.
API Stability: Alpha; this is subject to change at any time.
Constructor Summary | |
---|---|
AbstractListener()
Constructs an AbstractListener. |
Method Summary | |
---|---|
void |
deinit()
Deinitializes this Listener. |
protected net.java.games.joal.AL |
getAL()
Provides the AL object that was used to construct this Listener. |
protected net.java.games.joal.ALC |
getALC()
Provides the ALC object that was used to construct this Listener. |
float |
getGain()
Provides the gain for the listener. |
float[] |
getOrientation()
Provides the orientation of the listener. |
float[] |
getPosition()
Provides the position of the listener. |
float[] |
getVelocity()
Provides the velocity of the listener. |
void |
init(net.java.games.joal.AL al,
net.java.games.joal.ALC alc)
Stores the AL and ALC objects for later. |
boolean |
isInitialized()
Provides a way to determine if this Listener is in an initialized state. |
void |
lookAt(float[] pos,
float[] at,
float[] up)
Utility method meant to be used alongside OpenGL's gluLookAt command, so the video and audio systems can be configured with the same data. |
void |
lookAt(float posx,
float posy,
float posz,
float atx,
float aty,
float atz,
float upx,
float upy,
float upz)
Utility method meant to be used alongside OpenGL's gluLookAt command, so the video and audio systems can be configured with the same data. |
void |
setGain(float gain)
Sets the gain for the listener. |
void |
setOrientation(float[] o)
Sets the orientation of the listener. |
void |
setPosition(float[] pos)
Sets the position of the listener. |
void |
setPosition(float x,
float y,
float z)
Sets the position of the listener. |
void |
setVelocity(float[] v)
Sets the velocity of the listener. |
void |
setVelocity(float x,
float y,
float z)
Sets the velocity of the listener. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.jinx.audio.Listener |
---|
listen |
Constructor Detail |
---|
public AbstractListener()
Method Detail |
---|
protected net.java.games.joal.AL getAL()
protected net.java.games.joal.ALC getALC()
public boolean isInitialized()
public void init(net.java.games.joal.AL al, net.java.games.joal.ALC alc)
init
in interface Listener
al
- the AL object to use for audio rendering.alc
- the ALC object to use for audio rendering.
java.lang.NullPointerException
- if al or alc are null.public void deinit()
deinit
in interface Listener
public void setGain(float gain)
gain
- the gain value to set.public float getGain()
public void setPosition(float x, float y, float z)
x
- the x value.y
- the y value.z
- the z value.public void setPosition(float[] pos)
pos
- the position as a float array. This must be at least three
elements.public float[] getPosition()
public void setVelocity(float x, float y, float z)
x
- the x value.y
- the y value.z
- the z value.public void setVelocity(float[] v)
v
- the velocity as a float array. This must be at least three
elements.public float[] getVelocity()
public void setOrientation(float[] o)
o
- an array of six floats. The first three are the at vector and
the last three are the up vector.public float[] getOrientation()
public void lookAt(float[] pos, float[] at, float[] up)
pos
- the position of the listener.at
- the point in space to turn to face.up
- the direction of up.public void lookAt(float posx, float posy, float posz, float atx, float aty, float atz, float upx, float upy, float upz)
posx
- the position of the listener (X coordinate).posy
- the position of the listener (Y coordinate).posz
- the position of the listener (Z coordinate).atx
- the point in space to turn to face (X coordinate).aty
- the point in space to turn to face (Y coordinate).atz
- the point in space to turn to face (Z coordinate).upx
- the direction of up (X coordinate).upy
- the direction of up (Y coordinate).upz
- the direction of up (Z coordinate).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |