Package toxi.audio
Class SoundListener
java.lang.Object
toxi.geom.Vec3D
toxi.audio.SoundListener
- All Implemented Interfaces:
Comparable<ReadonlyVec3D>
,ReadonlyVec3D
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
Vec3D.Axis
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal float[]
final float[]
final float[]
setGain
(float gain) setOrientation
(float[] o) setOrientation
(float upX, float upY, float upZ, float forwardX, float forwardY, float forwardZ) setPosition
(float[] p) setPosition
(float xx, float yy, float zz) setVelocity
(float[] v) setVelocity
(float xx, float yy, float zz) Methods inherited from class toxi.geom.Vec3D
abs, add, add, add, addSelf, addSelf, addSelf, angleBetween, angleBetween, clear, compareTo, constrain, constrain, copy, cross, cross, crossInto, crossSelf, distanceTo, distanceToSquared, dot, dot, equals, equals, equalsWithTolerance, floor, frac, fromXYTheta, fromXZTheta, fromYZTheta, getAbs, getCartesian, getClosestAxis, getComponent, getComponent, getConstrained, getFloored, getFrac, getInverted, getLimited, getMapped, getNormalized, getNormalizedTo, getReciprocal, getReflected, getRotatedAroundAxis, getRotatedX, getRotatedY, getRotatedZ, getRoundedTo, getSignum, getSpherical, 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, roundTo, scale, scale, scale, scale, scaleSelf, scaleSelf, scaleSelf, scaleSelf, set, set, set, setComponent, setComponent, setX, setXY, setY, setZ, shuffle, signum, snapToAxis, sub, sub, sub, subSelf, subSelf, subSelf, to2DXY, to2DXZ, to2DYZ, to4D, to4D, toArray, toArray4, toCartesian, toSpherical, toString, x, y, z
-
Method Details
-
getOrientation
public final float[] getOrientation() -
getPosition
public final float[] getPosition() -
getVelocity
public final float[] getVelocity() -
setGain
-
setOrientation
public SoundListener setOrientation(float upX, float upY, float upZ, float forwardX, float forwardY, float forwardZ) -
setOrientation
-
setPosition
-
setPosition
-
setVelocity
-
setVelocity
-
updatePosition
-