Get or set which way the listener faces, in WORLD coordinates.
Two vectors: the direction the listener looks along, and which way is up for
it. This is what decides left from right, so a game that only moves the
listener around a flat plane can leave it alone.
World up in melonJS is (0, -1, 0), because render space is Y-down, and
that is what to pass here. The conversion to Web Audio's Y-up is applied
for you, which matters: handing Web Audio a Y-down up vector mirrors the
stereo image, since it derives right from forward × up.
Param: fx
forward x, or omitted to read
Param: fy
forward y
Param: fz
forward z
Param: ux
up x
Param: uy
up y
Param: uz
up z
Returns
the current [fx, fy, fz, ux, uy, uz] when reading
Example
// face the way the player is walking, with melonJS world up audio.listenerOrientation(dir.x, dir.y, 0, 0, -1, 0);
Get or set which way the listener faces, in WORLD coordinates.
Two vectors: the direction the listener looks along, and which way is up for it. This is what decides left from right, so a game that only moves the listener around a flat plane can leave it alone.
World up in melonJS is
(0, -1, 0), because render space is Y-down, and that is what to pass here. The conversion to Web Audio's Y-up is applied for you, which matters: handing Web Audio a Y-down up vector mirrors the stereo image, since it derives right fromforward × up.Param: fx
forward x, or omitted to read
Param: fy
forward y
Param: fz
forward z
Param: ux
up x
Param: uy
up y
Param: uz
up z
Returns
the current
[fx, fy, fz, ux, uy, uz]when readingExample