toxi.audio
Class SoundListener

java.lang.Object
  extended by toxi.geom.Vec3D
      extended by toxi.audio.SoundListener
All Implemented Interfaces:
java.lang.Comparable<toxi.geom.ReadonlyVec3D>, toxi.geom.ReadonlyVec3D

public class SoundListener
extends toxi.geom.Vec3D

The concept of a SoundListener refers directly to the user's instance in the virtual (audio) world. By setting the 3D position, velocity and orientation of the listener, the underlying audio hardware can produce a realistic 3D spatial sound simulation (incl. doppler effect, volume falloff etc.).

Like AudioSource, this class extends Vec3D and so if the position of the listener is changed via the public x,y,z vector components, the updatePosition() method needs to be called afterwards in order to reflect these changes in the OpenAL context.


Nested Class Summary
 
Nested classes/interfaces inherited from class toxi.geom.Vec3D
toxi.geom.Vec3D.Axis
 
Field Summary
 
Fields inherited from class toxi.geom.Vec3D
MAX_VALUE, MIN_VALUE, x, X_AXIS, y, Y_AXIS, z, Z_AXIS, ZERO
 
Method Summary
 float[] getOrientation()
           
 float[] getPosition()
           
 float[] getVelocity()
           
 SoundListener setGain(float gain)
           
 SoundListener setOrientation(float[] o)
           
 SoundListener setOrientation(float upX, float upY, float upZ, float forwardX, float forwardY, float forwardZ)
           
 SoundListener setPosition(float[] p)
           
 SoundListener setPosition(float xx, float yy, float zz)
           
 SoundListener setVelocity(float[] v)
           
 SoundListener setVelocity(float xx, float yy, float zz)
           
 SoundListener updatePosition()
           
 
Methods inherited from class toxi.geom.Vec3D
abs, add, add, add, addSelf, addSelf, angleBetween, angleBetween, clear, compareTo, constrain, constrain, copy, cross, cross, crossInto, crossSelf, distanceTo, distanceToSquared, dot, dot, equals, equalsWithTolerance, floor, frac, fromXYTheta, fromXZTheta, fromYZTheta, getAbs, getComponent, getComponent, getConstrained, getFloored, getFrac, getInverted, getLimited, getNormalized, getNormalizedTo, getReciprocal, getReflected, getRotatedAroundAxis, getRotatedX, getRotatedY, getRotatedZ, getSignum, hashCode, headingXY, headingXZ, headingYZ, immutable, interpolateTo, interpolateTo, interpolateTo, interpolateTo, interpolateToSelf, interpolateToSelf, invert, isInAABB, isInAABB, isMajorAxis, isZeroVector, jitter, jitter, jitter, jitter, jitter, jitter, limit, magnitude, magSquared, max, maxSelf, min, minSelf, modSelf, modSelf, normalize, normalizeTo, randomVector, randomVector, reciprocal, reflect, rotateAroundAxis, rotateX, rotateY, rotateZ, roundToAxis, scale, scale, scale, scale, scaleSelf, scaleSelf, scaleSelf, set, set, set, setComponent, setComponent, setXY, shuffle, signum, sub, sub, sub, subSelf, subSelf, to2DXY, to2DXZ, to2DYZ, toArray, toArray4, toCartesian, toSpherical, toString, x, y, z
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getOrientation

public final float[] getOrientation()

getPosition

public final float[] getPosition()

getVelocity

public final float[] getVelocity()

setGain

public SoundListener setGain(float gain)

setOrientation

public SoundListener setOrientation(float upX,
                                    float upY,
                                    float upZ,
                                    float forwardX,
                                    float forwardY,
                                    float forwardZ)

setOrientation

public SoundListener setOrientation(float[] o)

setPosition

public SoundListener setPosition(float xx,
                                 float yy,
                                 float zz)

setPosition

public SoundListener setPosition(float[] p)

setVelocity

public SoundListener setVelocity(float xx,
                                 float yy,
                                 float zz)

setVelocity

public SoundListener setVelocity(float[] v)

updatePosition

public SoundListener updatePosition()