public void SetOrientation(Vector3 forward) { Listener3DOrientation orientation = _listener.Orientation; orientation.Front = MdxHelpers.ToMdx(forward); orientation.Top = MdxHelpers.ToMdx(Vector3.Up); _listener.Orientation = orientation; }
public Listener() { // Create the listener BufferDescription desc = new BufferDescription(); desc.PrimaryBuffer = true; desc.Control3D = true; listener = new Listener3D( new Microsoft.DirectX.DirectSound.Buffer(desc, SoundManager.Device)); // Set the listener orientation orientation = new Listener3DOrientation(); orientation.Front = new Vector3(0, 0, 1); orientation.Top = new Vector3(0, 1, 0); listener.Orientation = orientation; }
/// <summary> /// Funkcja aktualizujaca pozycje oraz kierunek patrzenia listenera /// </summary> /// <param name="position">Pozycja listenera</param> /// <param name="frontOrientation">Przod orientacji glowy listenera</param> /// <param name="topOrientation">Gora orientacji glowy listenera</param> public static void Update(Vector3 position, Vector3 frontOrientation, Vector3 topOrientation) { listener.Position = position; Listener3DOrientation orientation = new Listener3DOrientation(frontOrientation, topOrientation); listener.Orientation = orientation; //listener.Orientation.Top = topOrientation; }