fix(docs): fix MeshLoader constructor and Fence doc references
This commit is contained in:
40
docs/api/components/audio-source-component/set-3d-params.md
Normal file
40
docs/api/components/audio-source-component/set-3d-params.md
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# Set3DParams
|
||||||
|
|
||||||
|
**所属类**: `AudioSourceComponent`
|
||||||
|
|
||||||
|
**头文件**: `XCEngine/Components/AudioSourceComponent.h`
|
||||||
|
|
||||||
|
**描述**: 设置音频源的3D音频参数。
|
||||||
|
|
||||||
|
## 函数签名
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
void Set3DParams(const Audio::Audio3DParams& params);
|
||||||
|
```
|
||||||
|
|
||||||
|
## 参数
|
||||||
|
|
||||||
|
| 参数 | 类型 | 描述 |
|
||||||
|
|------|------|------|
|
||||||
|
| `params` | `const Audio::Audio3DParams&` | 3D音频参数引用,包含多普勒等级、扩散角度、混响混合等 |
|
||||||
|
|
||||||
|
## 使用示例
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
#include <XCEngine/Components/AudioSourceComponent.h>
|
||||||
|
|
||||||
|
using namespace XCEngine::Components;
|
||||||
|
|
||||||
|
void Setup3DParams(AudioSourceComponent* source) {
|
||||||
|
Audio::Audio3DParams params;
|
||||||
|
params.dopplerLevel = 1.0f; // 正常多普勒效应
|
||||||
|
params.spread = 0.0f; // 点声源
|
||||||
|
params.reverbZoneMix = 1.0f; // 最大混响混合
|
||||||
|
source->Set3DParams(params);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 相关文档
|
||||||
|
|
||||||
|
- [AudioSourceComponent](./audio-source-component.md) - 音频源组件
|
||||||
|
- [Get3DParams](./get-3d-params.md) - 获取3D参数
|
||||||
36
docs/api/components/audio-source-component/set-volume.md
Normal file
36
docs/api/components/audio-source-component/set-volume.md
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
# SetVolume
|
||||||
|
|
||||||
|
**所属类**: `AudioSourceComponent`
|
||||||
|
|
||||||
|
**头文件**: `XCEngine/Components/AudioSourceComponent.h`
|
||||||
|
|
||||||
|
**描述**: 设置音频源的音量。
|
||||||
|
|
||||||
|
## 函数签名
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
void SetVolume(float volume);
|
||||||
|
```
|
||||||
|
|
||||||
|
## 参数
|
||||||
|
|
||||||
|
| 参数 | 类型 | 描述 |
|
||||||
|
|------|------|------|
|
||||||
|
| `volume` | `float` | 音量,范围 0.0 到 1.0 |
|
||||||
|
|
||||||
|
## 使用示例
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
#include <XCEngine/Components/AudioSourceComponent.h>
|
||||||
|
|
||||||
|
using namespace XCEngine::Components;
|
||||||
|
|
||||||
|
void SetAudioVolume(AudioSourceComponent* source) {
|
||||||
|
source->SetVolume(0.5f); // 50% 音量
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 相关文档
|
||||||
|
|
||||||
|
- [AudioSourceComponent](./audio-source-component.md) - 音频源组件
|
||||||
|
- [GetVolume](./get-volume.md) - 获取音量
|
||||||
@@ -21,7 +21,7 @@ MeshLoader();
|
|||||||
## 示例
|
## 示例
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
#include "Resources/MeshLoader.h"
|
#include <XCEngine/Resources/Mesh/MeshLoader.h>
|
||||||
|
|
||||||
using namespace XCEngine::Resources;
|
using namespace XCEngine::Resources;
|
||||||
|
|
||||||
|
|||||||
@@ -43,11 +43,6 @@ fence->Signal();
|
|||||||
// 在 CPU 端等待 GPU 完成
|
// 在 CPU 端等待 GPU 完成
|
||||||
fence->Wait(fence->GetCompletedValue());
|
fence->Wait(fence->GetCompletedValue());
|
||||||
|
|
||||||
// 检查是否已完成
|
|
||||||
if (fence->IsSignaled()) {
|
|
||||||
// GPU 工作已完成
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取原生句柄用于平台特定操作
|
// 获取原生句柄用于平台特定操作
|
||||||
void* nativeHandle = fence->GetNativeHandle();
|
void* nativeHandle = fence->GetNativeHandle();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user