Files
XCEngine/docs/api/components/components.md
ssdfasd 161a0896d5 docs: 添加 Audio 模块和 Components 模块 API 文档
- 新增 Audio 模块文档 (54 个文件)
  - AudioSystem 单例类及 20 个方法页
  - AudioMixer 混音器类及 11 个方法页
  - IAudioBackend、IAudioEffect 接口
  - FFTFilter、Reverbation、Equalizer、HRTF 效果类
  - WASAPIBackend Windows 后端
  - AudioConfig、Audio3DParams 等结构体
  - 9 个枚举类型文档
- 新增 Components 模块文档 (3 个文件)
  - AudioSourceComponent 音频源组件
  - AudioListenerComponent 音频监听器组件
- 更新 docs/api/main.md 添加模块导航
2026-03-22 01:56:16 +08:00

52 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Components 模块概览
**命名空间**: `XCEngine::Components`
**类型**: `module`
**描述**: XCEngine 的 ECS实体组件系统组件模块。
## 概述
Components 模块是 XCEngine ECS 架构中的组件层提供各种游戏对象组件。这些组件附加到实体Entity定义了游戏对象的行为和数据。组件系统支持 Transform、Audio、Render 等功能。
## 模块内容
### 音频组件
| 组件 | 文件 | 描述 |
|------|------|------|
| [AudioSourceComponent](audio-source/audio-source-component.md) | `AudioSourceComponent.h` | 音频源组件,负责播放音频 |
| [AudioListenerComponent](audio-listener/audio-listener-component.md) | `AudioListenerComponent.h` | 音频监听器组件,接收声音 |
### 变换组件
| 组件 | 文件 | 描述 |
|------|------|------|
| TransformComponent | `TransformComponent.h` | 变换组件,包含位置、旋转、缩放 |
## 使用示例
```cpp
#include <XCEngine/Components/GameObject.h>
#include <XCEngine/Components/TransformComponent.h>
#include <XCEngine/Components/AudioSourceComponent.h>
using namespace XCEngine::Components;
void CreateAudioEntity() {
GameObject* entity = new GameObject("AudioEntity");
auto transform = entity->AddComponent<TransformComponent>();
transform->SetPosition(Vector3(0, 0, 0));
auto audioSource = entity->AddComponent<AudioSourceComponent>();
audioSource->SetVolume(0.8f);
}
```
## 相关文档
- [Audio 模块](../audio/audio.md) - 音频系统模块
- [Core 模块](../core/core.md) - ECS 核心类型