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


C++ IParamBlock2::GetPoint3方法代码示例

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


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

示例1: color

Abc::C4f AlembicPoints::GetColor(IParticleObjectExt *pExt, int particleId,
                                 TimeValue ticks)
{
  Abc::C4f color(0.5, 0.5, 0.5, 1.0);

  // Go into the particle's action list
  INode *particleGroupNode = pExt->GetParticleGroup(particleId);
  Object *particleGroupObj = (particleGroupNode != NULL)
                                 ? particleGroupNode->EvalWorldState(ticks).obj
                                 : NULL;

  if (!particleGroupObj) {
    return color;
  }

  IParticleGroup *particleGroup = GetParticleGroupInterface(particleGroupObj);
  INode *particleActionListNode = particleGroup->GetActionList();
  Object *particleActionObj =
      (particleActionListNode != NULL
           ? particleActionListNode->EvalWorldState(ticks).obj
           : NULL);

  if (!particleActionObj) {
    return color;
  }

  PFSimpleOperator *pSimpleOperator = NULL;

  // In the case of multiple shape operators in an action list, the one furthest
  // down the list seems to be the one that applies
  IPFActionList *particleActionList =
      GetPFActionListInterface(particleActionObj);

  for (int p = particleActionList->NumActions() - 1; p >= 0; p -= 1) {
    INode *pActionNode = particleActionList->GetAction(p);
    Object *pActionObj =
        (pActionNode != NULL ? pActionNode->EvalWorldState(ticks).obj : NULL);

    if (pActionObj == NULL) {
      continue;
    }

    if (pActionObj->ClassID() == PFOperatorDisplay_Class_ID) {
      pSimpleOperator = static_cast<PFSimpleOperator *>(pActionObj);
      break;
    }
  }

  if (pSimpleOperator) {
    IParamBlock2 *pblock = pSimpleOperator->GetParamBlockByID(0);
    Point3 c = pblock->GetPoint3(kDisplay_color);
    color.r = c.x;
    color.g = c.y;
    color.b = c.z;
    color.a = 1.0;
  }

  return color;
}
开发者ID:BlackGinger,项目名称:ExocortexCrate,代码行数:59,代码来源:AlembicPoints.cpp

示例2: exportEffectParameters

    void HwShaderExporter::exportEffectParameters ( 
        StdMat2* material 
        )
    {
        COLLADASW::StreamWriter* streamWriter = &mDocumentExporter->getStreamWriter();

        IParamBlock2 * pblock = material->GetParamBlock ( 0 );
        int parameterCount = pblock->NumParams();
        
        for ( int i = 0; i < parameterCount; i++ )
        {
            ParamID parameterID = pblock->IndextoID( i );
            ParamType2 parameterType = pblock->GetParameterType( parameterID );
            ParamDef parameterDef = pblock->GetParamDef( parameterID );

            const TCHAR* paramName = parameterDef.int_name;

            switch ( parameterType )
            {
                case TYPE_FLOAT:
                {
                    COLLADASW::NewParam<> newParam ( streamWriter );
                    newParam.setParamType ( COLLADASW::ValueType::FLOAT );

                    int numOfValues = 1;
                    float paramValue = pblock->GetFloat( parameterID );

                    exportParam ( paramName, &newParam, &paramValue, numOfValues );

                    break;
                }

                case TYPE_INT:
                {
                    COLLADASW::NewParam<> newParam ( streamWriter );
                    newParam.setParamType ( COLLADASW::ValueType::INT );

                    int numOfValues = 1;
                    int paramValue = pblock->GetInt( parameterID );

                    exportParam ( paramName, &newParam, &paramValue, numOfValues );

                    break;
                }

                case TYPE_RGBA:
                case TYPE_FRGBA:
                {
                    COLLADASW::NewParam<> newParam ( streamWriter );
                    newParam.setParamType ( COLLADASW::ValueType::FLOAT4 );

                    int numOfValues = 4;
                    AColor paramPoint3Value = pblock->GetAColor( parameterID );
                    float* paramValue = (float*)paramPoint3Value;

                    exportParam ( paramName, &newParam, paramValue, numOfValues );

                    break;
                }

                case TYPE_POINT3:
                {
                    COLLADASW::NewParam<> newParam ( streamWriter );
                    newParam.setParamType ( COLLADASW::ValueType::FLOAT3 );

                    int numOfValues = 3;
                    Point3 paramPoint3Value = pblock->GetPoint3( parameterID );
                    float* paramValue = (float*)paramPoint3Value;

                    exportParam ( paramName, &newParam, paramValue, numOfValues );

                    break;
                }

                case TYPE_BOOL:
                {
                    COLLADASW::NewParam<> newParam ( streamWriter );
                    newParam.setParamType ( COLLADASW::ValueType::BOOL );

                    int numOfValues = 1;
                    /*bool*/ int paramValue = pblock->GetInt( parameterID );

                    exportParam ( paramName, &newParam, &paramValue, numOfValues );

                    break;
                }

                //TYPE_ANGLE   
                //TYPE_PCNT_FRAC   
                //TYPE_WORLD   

                case TYPE_STRING:
                {
                    COLLADASW::NewParam<> newParam ( streamWriter );

                    const MCHAR * paramValue = pblock->GetStr( parameterID );
                    exportParam ( paramName, &newParam, paramValue );

                    break;
                }
//.........这里部分代码省略.........
开发者ID:3dfreeman,项目名称:OpenCOLLADA,代码行数:101,代码来源:COLLADAMaxHwShaderExporter.cpp


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