当前位置: 首页>>代码示例>>C++>>正文


C++ CLight::SetAngleAttenuation方法代码示例

本文整理汇总了C++中CLight::SetAngleAttenuation方法的典型用法代码示例。如果您正苦于以下问题:C++ CLight::SetAngleAttenuation方法的具体用法?C++ CLight::SetAngleAttenuation怎么用?C++ CLight::SetAngleAttenuation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CLight的用法示例。


在下文中一共展示了CLight::SetAngleAttenuation方法的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;
}
开发者ID:KalDragon,项目名称:urde,代码行数:49,代码来源:CGuiLight.cpp

示例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;
}
开发者ID:KalDragon,项目名称:urde,代码行数:22,代码来源:CGuiLight.cpp


注:本文中的CLight::SetAngleAttenuation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。