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


C++ Projector::IsOf方法代码示例

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


在下文中一共展示了Projector::IsOf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CalcRenderOrderRecurse

void OctLevel::CalcRenderOrderRecurse(const Vect &eye, const ViewClip &clip, MeshOrderInfo &meshOrder, OctNode *curNode, BOOL bFullyVisible)
{
    OctNode *node = (curNode != NULL) ? curNode : objectTree->GetRoot();

    DWORD i;
    BOOL bCheckBounds = (node->numChildren > 1) || (node->Leaves.Num() > 0);
    if(!bFullyVisible && bCheckBounds)
    {
        int testVal = clip.BoundsTest(node->bounds);
        if(testVal == BOUNDS_INSIDE)
            bFullyVisible = TRUE;
        else if(testVal == BOUNDS_OUTSIDE)
            return;
    }

    if(node->numChildren)
    {
        for(i=0; i<8; i++)
        {
            if(!node->children[i])
                continue;

            OctNode *child = node->children[i];
            CalcRenderOrderRecurse(eye, clip, meshOrder, child, bFullyVisible);
        }
    }

    for(i=0; i<node->Leaves.Num(); i++)
    {
        LevelObject *leaf = node->Leaves[i];

        if(!bFullyVisible && !clip.BoundsVisible(leaf->bounds))
            continue;

        if(leaf->type == ObjectType_Entity)
        {
            if(leaf->ent->IsOf(GetClass(MeshEntity)))
            {
                MeshEntity *meshEnt = (MeshEntity*)leaf->ent;

                if(meshEnt->bRenderable)
                {
                    EntityVisible(meshEnt) = TRUE;
                    meshOrder.AddEntity(meshEnt);
                }
            }
            else if(leaf->ent->IsOf(GetClass(Projector)))
            {
                Projector *projector = (Projector*)leaf->ent;
                if(projector->bRenderable)
                {
                    if(projector->IsOf(GetClass(LitDecal)))
                        renderLitDecals << (LitDecal*)projector;
                    else
                        renderProjectors << projector;

                    EntityVisible(projector) = TRUE;
                }
            }
            else if(leaf->ent->IsOf(GetClass(Light)))
            {
                Light *light = (Light*)leaf->ent;

                if(light->IsOf(GetClass(SpotLight)))
                {
                    SpotLight *spotLight = (SpotLight*)light;
                    if(spotLight->IsLightmapped() && !spotLight->NumLitEntities())
                        continue;

                    renderSpotLights << spotLight;
                }
                else if(light->IsOf(GetClass(PointLight)))
                {
                    PointLight *pointLight = (PointLight*)light;
                    if(pointLight->IsLightmapped() && !pointLight->NumLitEntities())
                        continue;

                    renderPointLights << pointLight;
                }
            }
            else
            {
                Entity *ent = leaf->ent;

                if(ent->bRenderable)
                {
                    EntityVisible(ent) = TRUE;
                    renderEntities << ent;
                }
            }
        }
        else if(leaf->type == ObjectType_Brush)
        {
            Brush *brush = leaf->brush;

            brush->bVisible = TRUE;
            renderBrushes << brush;
        }
    }
}
开发者ID:alanzw,项目名称:JimEngine,代码行数:100,代码来源:OctRender.cpp


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