This repository has been archived by the owner on Jan 4, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d6e7201
commit 383ffae
Showing
4 changed files
with
195 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,87 @@ | ||
// MonoGame - Copyright (C) The MonoGame Team | ||
// This file is subject to the terms and conditions defined in | ||
// file 'LICENSE.txt', which is part of this source code package. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Microsoft.Xna.Framework.Audio | ||
{ | ||
/// <summary> | ||
/// Represents a 3D audio emitter. Used to simulate 3D audio effects. | ||
/// </summary> | ||
public class AudioEmitter | ||
{ | ||
/// <summary>Initializes a new AudioEmitter instance.</summary> | ||
public AudioEmitter () | ||
{ | ||
_dopplerScale = 1.0f; | ||
Forward = Vector3.Forward; | ||
Position = Vector3.Zero; | ||
Up = Vector3.Up; | ||
Velocity = Vector3.Zero; | ||
} | ||
|
||
private float _dopplerScale; | ||
|
||
/// <summary>Gets or sets a scale applied to the Doppler effect between the AudioEmitter and an AudioListener.</summary> | ||
/// <remarks> | ||
/// <para>Defaults to 1.0</para> | ||
/// <para>A value of 1.0 leaves the Doppler effect unmodified.</para> | ||
/// </remarks> | ||
public float DopplerScale | ||
{ | ||
get | ||
{ | ||
return _dopplerScale; | ||
} | ||
|
||
set | ||
{ | ||
if (value < 0.0f) | ||
throw new ArgumentOutOfRangeException("AudioEmitter.DopplerScale must be greater than or equal to 0.0f"); | ||
|
||
_dopplerScale = value; | ||
} | ||
} | ||
|
||
/// <summary>Gets or sets the emitter's forward vector.</summary> | ||
/// <remarks> | ||
/// <para>Defaults to Vector3.Forward. (new Vector3(0, 0, -1))</para> | ||
/// <para>Used with AudioListener.Velocity to calculate Doppler values.</para> | ||
/// <para>The Forward and Up values must be orthonormal.</para> | ||
/// </remarks> | ||
public Vector3 Forward { | ||
get; | ||
set; | ||
} | ||
|
||
/// <summary>Gets or sets the position of this emitter.</summary> | ||
public Vector3 Position { | ||
get; | ||
set; | ||
} | ||
|
||
/// <summary>Gets or sets the emitter's Up vector.</summary> | ||
/// <remarks> | ||
/// <para>Defaults to Vector3.Up. (new Vector3(0, -1, 1)).</para> | ||
/// <para>The Up and Forward vectors must be orthonormal.</para> | ||
/// </remarks> | ||
public Vector3 Up { | ||
get; | ||
set; | ||
} | ||
|
||
/// <summary>Gets or sets the emitter's velocity vector.</summary> | ||
/// <remarks> | ||
/// <para>Defaults to Vector3.Zero.</para> | ||
/// <para>This value is only used when calculating Doppler values.</para> | ||
/// </remarks> | ||
public Vector3 Velocity { | ||
get; | ||
set; | ||
} | ||
|
||
} | ||
} | ||
// // MonoGame - Copyright (C) The MonoGame Team | ||
// // This file is subject to the terms and conditions defined in | ||
// // file 'LICENSE.txt', which is part of this source code package. | ||
// | ||
// using System; | ||
// using System.Collections.Generic; | ||
// using System.Text; | ||
// | ||
// namespace Microsoft.Xna.Framework.Audio | ||
// { | ||
// /// <summary> | ||
// /// Represents a 3D audio emitter. Used to simulate 3D audio effects. | ||
// /// </summary> | ||
// public class AudioEmitter | ||
// { | ||
// /// <summary>Initializes a new AudioEmitter instance.</summary> | ||
// public AudioEmitter () | ||
// { | ||
// _dopplerScale = 1.0f; | ||
// Forward = Vector3.Forward; | ||
// Position = Vector3.Zero; | ||
// Up = Vector3.Up; | ||
// Velocity = Vector3.Zero; | ||
// } | ||
// | ||
// private float _dopplerScale; | ||
// | ||
// /// <summary>Gets or sets a scale applied to the Doppler effect between the AudioEmitter and an AudioListener.</summary> | ||
// /// <remarks> | ||
// /// <para>Defaults to 1.0</para> | ||
// /// <para>A value of 1.0 leaves the Doppler effect unmodified.</para> | ||
// /// </remarks> | ||
// public float DopplerScale | ||
// { | ||
// get | ||
// { | ||
// return _dopplerScale; | ||
// } | ||
// | ||
// set | ||
// { | ||
// if (value < 0.0f) | ||
// throw new ArgumentOutOfRangeException("AudioEmitter.DopplerScale must be greater than or equal to 0.0f"); | ||
// | ||
// _dopplerScale = value; | ||
// } | ||
// } | ||
// | ||
// /// <summary>Gets or sets the emitter's forward vector.</summary> | ||
// /// <remarks> | ||
// /// <para>Defaults to Vector3.Forward. (new Vector3(0, 0, -1))</para> | ||
// /// <para>Used with AudioListener.Velocity to calculate Doppler values.</para> | ||
// /// <para>The Forward and Up values must be orthonormal.</para> | ||
// /// </remarks> | ||
// public Vector3 Forward { | ||
// get; | ||
// set; | ||
// } | ||
// | ||
// /// <summary>Gets or sets the position of this emitter.</summary> | ||
// public Vector3 Position { | ||
// get; | ||
// set; | ||
// } | ||
// | ||
// /// <summary>Gets or sets the emitter's Up vector.</summary> | ||
// /// <remarks> | ||
// /// <para>Defaults to Vector3.Up. (new Vector3(0, -1, 1)).</para> | ||
// /// <para>The Up and Forward vectors must be orthonormal.</para> | ||
// /// </remarks> | ||
// public Vector3 Up { | ||
// get; | ||
// set; | ||
// } | ||
// | ||
// /// <summary>Gets or sets the emitter's velocity vector.</summary> | ||
// /// <remarks> | ||
// /// <para>Defaults to Vector3.Zero.</para> | ||
// /// <para>This value is only used when calculating Doppler values.</para> | ||
// /// </remarks> | ||
// public Vector3 Velocity { | ||
// get; | ||
// set; | ||
// } | ||
// | ||
// } | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,69 @@ | ||
// MonoGame - Copyright (C) The MonoGame Team | ||
// This file is subject to the terms and conditions defined in | ||
// file 'LICENSE.txt', which is part of this source code package. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Microsoft.Xna.Framework.Audio | ||
{ | ||
/// <summary> | ||
/// Represents a 3D audio listener. Used when simulating 3D Audio. | ||
/// </summary> | ||
public class AudioListener | ||
{ | ||
public AudioListener () | ||
{ | ||
Forward = Vector3.Forward; | ||
Position = Vector3.Zero; | ||
Up = Vector3.Up; | ||
Velocity = Vector3.Zero; | ||
} | ||
|
||
/// <summary>Gets or sets the listener's forward vector.</summary> | ||
/// <remarks> | ||
/// <para>Defaults to Vector3.Forward. (new Vector3(0, 0, -1))</para> | ||
/// <para>Used with AudioListener.Velocity and AudioEmitter.Velocity to calculate Doppler values.</para> | ||
/// <para>The Forward and Up vectors must be orthonormal.</para> | ||
/// </remarks> | ||
public Vector3 Forward { | ||
get; | ||
set; | ||
} | ||
|
||
/// <summary>Gets or sets the listener's position.</summary> | ||
/// <remarks> | ||
/// Defaults to Vector3.Zero. | ||
/// </remarks> | ||
public Vector3 Position { | ||
get; | ||
set; | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the listener's up vector.. | ||
/// </summary> | ||
/// <remarks> | ||
/// <para>Defaults to Vector3.Up (New Vector3(0, -1, 0)).</para> | ||
/// <para>Used with AudioListener.Velocity and AudioEmitter.Velocity to calculate Doppler values.</para> | ||
/// <para>The values of the Forward and Up vectors must be orthonormal.</para> | ||
/// </remarks> | ||
public Vector3 Up { | ||
get; | ||
set; | ||
} | ||
|
||
/// <summary>Gets or sets the listener's velocity vector.</summary> | ||
/// <remarks> | ||
/// <para>Defaults to Vector3.Zero.</para> | ||
/// <para>Scaled by DopplerScale to calculate the Doppler effect value applied to a Cue.</para> | ||
/// <para>This value is only used to calculate Doppler values.</para> | ||
/// </remarks> | ||
public Vector3 Velocity { | ||
get; | ||
set; | ||
} | ||
} | ||
} | ||
|
||
// // MonoGame - Copyright (C) The MonoGame Team | ||
// // This file is subject to the terms and conditions defined in | ||
// // file 'LICENSE.txt', which is part of this source code package. | ||
// | ||
// using System; | ||
// using System.Collections.Generic; | ||
// using System.Text; | ||
// | ||
// namespace Microsoft.Xna.Framework.Audio | ||
// { | ||
// /// <summary> | ||
// /// Represents a 3D audio listener. Used when simulating 3D Audio. | ||
// /// </summary> | ||
// public class AudioListener | ||
// { | ||
// public AudioListener () | ||
// { | ||
// Forward = Vector3.Forward; | ||
// Position = Vector3.Zero; | ||
// Up = Vector3.Up; | ||
// Velocity = Vector3.Zero; | ||
// } | ||
// | ||
// /// <summary>Gets or sets the listener's forward vector.</summary> | ||
// /// <remarks> | ||
// /// <para>Defaults to Vector3.Forward. (new Vector3(0, 0, -1))</para> | ||
// /// <para>Used with AudioListener.Velocity and AudioEmitter.Velocity to calculate Doppler values.</para> | ||
// /// <para>The Forward and Up vectors must be orthonormal.</para> | ||
// /// </remarks> | ||
// public Vector3 Forward { | ||
// get; | ||
// set; | ||
// } | ||
// | ||
// /// <summary>Gets or sets the listener's position.</summary> | ||
// /// <remarks> | ||
// /// Defaults to Vector3.Zero. | ||
// /// </remarks> | ||
// public Vector3 Position { | ||
// get; | ||
// set; | ||
// } | ||
// | ||
// /// <summary> | ||
// /// Gets or sets the listener's up vector.. | ||
// /// </summary> | ||
// /// <remarks> | ||
// /// <para>Defaults to Vector3.Up (New Vector3(0, -1, 0)).</para> | ||
// /// <para>Used with AudioListener.Velocity and AudioEmitter.Velocity to calculate Doppler values.</para> | ||
// /// <para>The values of the Forward and Up vectors must be orthonormal.</para> | ||
// /// </remarks> | ||
// public Vector3 Up { | ||
// get; | ||
// set; | ||
// } | ||
// | ||
// /// <summary>Gets or sets the listener's velocity vector.</summary> | ||
// /// <remarks> | ||
// /// <para>Defaults to Vector3.Zero.</para> | ||
// /// <para>Scaled by DopplerScale to calculate the Doppler effect value applied to a Cue.</para> | ||
// /// <para>This value is only used to calculate Doppler values.</para> | ||
// /// </remarks> | ||
// public Vector3 Velocity { | ||
// get; | ||
// set; | ||
// } | ||
// } | ||
// } | ||
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.