Exemplo n.º 1
0
        private void Update()
        {
            if (_voice.IsDisposed)
            {
                return;
            }

            var listener = new Listener
            {
                OrientFront = Vector3DToVector3(QuaternionHelper.FrontVectorFromQuaternion(Rotation)),
                OrientTop   = Vector3DToVector3(QuaternionHelper.UpVectorFromQuaternion(Rotation)),
                Position    = Vector3DToVector3(Position),
                Velocity    = new Vector3(0, 0, 0)
            };

            var dspSettings = _x3dAudio.Calculate(listener, _emitter, CalculateFlags.Matrix, _format.Channels, _deviceFormat.Channels);

            _voice.SetOutputMatrix(_format.Channels, _deviceFormat.Channels, dspSettings.MatrixCoefficients);
        }