docs: 新增 light-component 全部方法文档及更新其他模块
- components: 新增 light-component 全部12个方法文档 - resources: 更新 audio-loader, resource-file-system 文档 - rhi: 更新 opengl/fence 文档
This commit is contained in:
37
docs/api/components/light-component/set-range.md
Normal file
37
docs/api/components/light-component/set-range.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# SetRange
|
||||
|
||||
**所属类**: `LightComponent`
|
||||
|
||||
**头文件**: `XCEngine/Components/LightComponent.h`
|
||||
|
||||
**描述**: 设置光源的作用范围(仅对点光源和聚光灯有效)。
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
void SetRange(float value);
|
||||
```
|
||||
|
||||
## 参数
|
||||
|
||||
| 参数 | 类型 | 描述 |
|
||||
|------|------|------|
|
||||
| `value` | `float` | 作用范围(米) |
|
||||
|
||||
## 使用示例
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Components/LightComponent.h>
|
||||
|
||||
using namespace XCEngine::Components;
|
||||
|
||||
void SetupLightRange(LightComponent* light) {
|
||||
light->SetLightType(LightType::Point);
|
||||
light->SetRange(15.0f); // 15米范围
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [LightComponent](./light-component.md) - 光源组件
|
||||
- [GetRange](./get-range.md) - 获取作用范围
|
||||
Reference in New Issue
Block a user