Share via


XACT3DApply

XACT3DApply

Applies a 3D calculation returned by XACT3DCalculate to a cue.

  HRESULT 
  XACT3DApply(
  X3DAUDIO_DSP_SETTINGS *pDSPSettings,
  IXACTCue *pCue
);

Parameters

  • pDSPSettings
    [in] Pointer to an X3DAUDIO_DSP_SETTINGS structure that contains the 3D calculation results generated by XACT3DCalculate.
  • pCue
    [in] Pointer to an IXACTCue cue to which the DSP settings (pDSPSettings) are to be applied.

Return Values

Returns S_OK if successful, an error code otherwise.

Remarks

XACT3DApply must be called at least once before playing the cue instance.

This function can be used only with the IXACTEngine interface methods. XACT3DApply does not work with the flat XACT functions.

XACT3DApply performs the following:

  • Applies speaker coefficients to the playing cue instance, to position it in 3D space.
  • Applies the Doppler setting to the playing cue instance. The sound designer can exaggerate this by using the DopplerPitchScalar variable.
  • Updates the cue instance variables of this cue instance (Distance, OrientationAngle, DopplerPitchScalar).

The following elements of X3DAudio are not applied or used when content can be used to drive behavior. The library's calculations of that behavior are ignored by XACT.

  • X3DAUDIO_DISTANCE_CURVE structures. In particular, distance-based attenuation is provided by the content creator, not by way of a programmatic curve passed to X3DAudio.
  • X3DAUDIO_CONE. Orientation-based behavior is similarly driven by content.

Requirements

Header: Declared in Xact3d.h.

See Also

XACT Functions