Updated AudioEmitter (markdown)

Chuck Walbourn 2022-08-24 15:13:10 -07:00
Родитель e4a968d86e
Коммит 5aa8dfc1c9
1 изменённых файлов: 7 добавлений и 5 удалений

@ -47,11 +47,7 @@ In addition to setting the members of ``X3DAUDIO_EMITTER`` directly, these helpe
* **Update** (XMVECTOR newPos, XMVECTOR upDir, float dt): Computes a direction and velocity for the emitter based on the current Position value, the new position, and the provided delta time (Δt). This updates the OrientFront/OrientTop to match, and then sets the Position to the new position. If dt is 0, the update is skipped.
* **SetOmnidirectional** sets the ``pCone`` value to nullptr indicating an omnidirectional emitter (the default).
* **SetCone** (X3DAUDIO_CONE) sets the ``pCone`` value to point to ``EmitterCone`` and copies the passed in cone parameters.
* **EnableDefaultCurves** sets default volume, LFE, LPF, and reverb curves. Note that for X3DAudio, ``pVolumeCurve`` and ``pLFECurve`` must be non-null.
* **EnableDefaultCurves** sets default volume, LFE, LPF, and reverb curves.
> You must use a distinct instance of ``AudioEmitter`` for each active 3D sound if using the **Update** method. Otherwise, if you reuse the emitter instance for multiple sounds you need to explicitly initialize both the position and velocity before each ``Apply3D`` call.
@ -92,11 +88,17 @@ emitter.EnableDefaultMultiChannel(effect->GetChannelCount(), 10.f);
# Directional Emitters
AudioEmitter defaults to an omnidirectional emitter. To create a sound-cone, set the **pCone** member to point to a ``X3DAUDIO_CONE`` structure. The pointer must point to valid memory at the time Apply3D is called. The **SetCone** helper uses the ``EmitterCone`` variable to store the cone settings.
* **SetOmnidirectional** sets the ``pCone`` value to nullptr indicating an omnidirectional emitter (the default).
* **SetCone** (X3DAUDIO_CONE) sets the ``pCone`` value to point to ``EmitterCone`` and copies the passed in cone parameters.
Be aware that ``pCone`` is ignored for multi-channel emitters.
# Custom distance curves
The AudioEmitter constructor sets pVolumeCurve, pLFECurve, pLPFDirectCurve, pLPFReverbCurve, and pReverbCurve to nullptr which uses XAudio2 default curves. Any custom curve definitions must have a pointer to valid memory at the time Apply3D is called.
Note that for X3DAudio, ``pVolumeCurve`` and ``pLFECurve`` must be non-null. Use the **EnableDefaultCurves** if you don't wish to make use of custom curves.
# Example
```cpp