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