本文整理汇总了C++中CLight::SetAttenuation方法的典型用法代码示例。如果您正苦于以下问题:C++ CLight::SetAttenuation方法的具体用法?C++ CLight::SetAttenuation怎么用?C++ CLight::SetAttenuation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLight
的用法示例。
在下文中一共展示了CLight::SetAttenuation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Create
CGuiLight* CGuiLight::Create(CGuiFrame* frame, CInputStream& in, bool flag)
{
CGuiWidgetParms parms = ReadWidgetHeader(frame, in, flag);
ELightType tp = ELightType(in.readUint32Big());
float distC = in.readFloatBig();
float distL = in.readFloatBig();
float distQ = in.readFloatBig();
float angC = in.readFloatBig();
float angL = in.readFloatBig();
float angQ = in.readFloatBig();
u32 loadedIdx = in.readUint32Big();
CGuiLight* ret = nullptr;
switch (tp)
{
case ELightType::Spot:
{
float cutoff = in.readFloatBig();
CLight lt = CLight::BuildSpot(zeus::CVector3f::skZero, zeus::CVector3f::skZero,
parms.x10_color, cutoff);
lt.SetAttenuation(distC, distL, distQ);
lt.SetAngleAttenuation(angC, angL, angQ);
lt.x40_loadedIdx = loadedIdx;
ret = new CGuiLight(parms, lt);
break;
}
case ELightType::Point:
{
CLight lt = CLight::BuildPoint(zeus::CVector3f::skZero, parms.x10_color);
lt.SetAttenuation(distC, distL, distQ);
lt.x40_loadedIdx = loadedIdx;
ret = new CGuiLight(parms, lt);
break;
}
case ELightType::Directional:
{
CLight lt = CLight::BuildDirectional(zeus::CVector3f::skZero, parms.x10_color);
lt.x40_loadedIdx = loadedIdx;
ret = new CGuiLight(parms, lt);
break;
}
default: break;
}
ret->ParseBaseInfo(frame, in, parms);
frame->AddLight(ret);
return ret;
}
示例2: BuildLight
CLight CGuiLight::BuildLight() const
{
CLight ret = CLight::BuildLocalAmbient(zeus::CVector3f::skZero, zeus::CColor::skBlack);
switch (xf8_type)
{
case ELightType::Spot:
ret = CLight::BuildSpot(GetWorldPosition(), x34_worldXF.m_basis[1], xbc_color, xfc_spotCutoff);
break;
case ELightType::Point:
ret = CLight::BuildPoint(GetWorldPosition(), xbc_color);
break;
case ELightType::Directional:
ret = CLight::BuildDirectional(x34_worldXF.m_basis[1], xbc_color);
break;
default: break;
}
ret.SetAttenuation(x100_distC, x104_distL, x108_distQ);
ret.SetAngleAttenuation(x10c_angleC, x110_angleL, x114_angleQ);
return ret;
}