- resources: 更新 asyncloader, audioclip, mesh-import-settings, texture-loader 文档 - rhi: 更新 opengl render-target-view 文档 - components: 新增 camera-component 全部方法文档 (15个文件)
39 lines
871 B
Markdown
39 lines
871 B
Markdown
# Get3DParams
|
|
|
|
**所属类**: `AudioSourceComponent`
|
|
|
|
**头文件**: `XCEngine/Components/AudioSourceComponent.h`
|
|
|
|
**描述**: 获取音频源的3D音频参数。
|
|
|
|
## 函数签名
|
|
|
|
```cpp
|
|
const Audio::Audio3DParams& Get3DParams() const;
|
|
```
|
|
|
|
## 返回值
|
|
|
|
| 类型 | 描述 |
|
|
|------|------|
|
|
| `const Audio::Audio3DParams&` | 3D音频参数引用 |
|
|
|
|
## 使用示例
|
|
|
|
```cpp
|
|
#include <XCEngine/Components/AudioSourceComponent.h>
|
|
|
|
using namespace XCEngine::Components;
|
|
|
|
void Print3DParams(AudioSourceComponent* source) {
|
|
const auto& params = source->Get3DParams();
|
|
printf("Doppler: %.2f, Spread: %.2f, ReverbZoneMix: %.2f\n",
|
|
params.dopplerLevel, params.spread, params.reverbZoneMix);
|
|
}
|
|
```
|
|
|
|
## 相关文档
|
|
|
|
- [AudioSourceComponent](audio-source-component.md) - 音频源组件
|
|
- [Set3DParams](../../audio/audio-mixer/set-3d-params.md) - 设置3D参数
|