Audio · function

ambisonicFromWorld

A direction in this engine's world axes, as the ambisonic frame reads it.

Explained in Your first game.

function ambisonicFromWorld(x: number, y: number, z: number, out: Float32Array): void
import { ambisonicFromWorld } from '@driftengine/audio';

Parameters

ParameterTypeDescription
xnumber
ynumber
znumber
outFloat32Array

In depth

The engine is y up and −z forward, the OpenGL convention every other part of it uses. Ambisonics is x forward, y left, z up. So forward is −z, left is −x, and up is y, and this is the one function that knows it: a second conversion anywhere would be the drift this repository has been bitten by twice.