Files
XCEngine/docs/api/components/light-component/set-casts-shadows.md
ssdfasd 10ee1fa3fa docs: 更新 audioclip 和 audio-source-component 文档
- audioclip: 新增 set 方法文档
- audio-source-component: 新增 set-output-mixer 文档
2026-03-26 02:04:27 +08:00

41 lines
785 B
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.
# SetCastsShadows
**所属类**: `LightComponent`
**头文件**: `XCEngine/Components/LightComponent.h`
**描述**: 设置光源是否投射阴影。
## 函数签名
```cpp
void SetCastsShadows(bool value);
```
## 参数
| 参数 | 类型 | 描述 |
|------|------|------|
| `value` | `bool` | true 启用阴影投射false 禁用阴影投射 |
## 使用示例
```cpp
#include <XCEngine/Components/LightComponent.h>
using namespace XCEngine::Components;
void SetupShadowCasting(LightComponent* light) {
// 启用阴影
light->SetCastsShadows(true);
// 禁用阴影(性能优化)
light->SetCastsShadows(false);
}
```
## 相关文档
- [LightComponent](light-component.md) - 光源组件
- [GetCastsShadows](get-casts-shadows.md) - 检查阴影投射