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


C++ Aggregate::AddChild方法代码示例

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


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

示例1: BuildScene


//.........这里部分代码省略.........
 
                case aggregate_plugin:
                    obj = (Object*)plg;
                    obj->shader   = shd;
                    obj->envmap   = env;
                    obj->material = Copy( mat, material );
                    obj->parent   = agg;
                    if( Emitter( material ) )
                        {
                        cerr << "Error: An aggregate object cannot be an emitter.  Line "
                             << line_num << ": "
                             << input_line << endl;
                        return false;
                        }
                    if( agg != NULL ) // If there is alrealy an agg obj, this one is a child.
                        {
                        // agg->AddChild( obj );
                        // Do not add aggregates as children until they are complete.
                        agg->material = Copy( mat, material );
                        }
                    else if( scene.object == NULL ) scene.object = obj;
	            agg = (Aggregate *)obj;
                    break;

                case primitive_plugin:
                    obj = (Object*)plg;
                    obj->shader   = shd;
                    obj->envmap   = env;
                    obj->material = Copy( mat, material );
                    obj->parent   = agg;
                    if( Emitter( material ) ) scene.lights.push_back( obj );
                    if( agg != NULL )
                        {
                        agg->AddChild( obj );
                        agg->material = Copy( mat, material );
                        }
                    else if( scene.object == NULL ) scene.object = obj;
                    break;

                case envmap_plugin:
                    env = (Envmap*)plg;
                    // If an environment map is set before any object is created, use it as
                    // the background.
                    if( obj == NULL ) scene.envmap = env;
                    break;

                case rasterizer_plugin:
                    if( scene.rasterize != NULL )
                        {
                         cerr << "Error: More than one rasterizer specified.  Line "
                             << line_num << ": "
                             << input_line << endl;
                        return false;
                        }
                    scene.rasterize = (Rasterizer *)plg;
                    break;
                } 
            continue;
            }

        // Now look for all the other stuff...  materials, camera, lights, etc.

        ParamReader get( input_line );
 
        if( get["eye"]          && get[camera.eye]            ) continue;
        if( get["lookat"]       && get[camera.lookat]         ) continue;            
开发者ID:zackattacknyu,项目名称:CS211B_Assigment3,代码行数:67,代码来源:basic_builder.cpp


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