本文整理汇总了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;
}
示例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, ¶mValue, 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, ¶mValue, 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, ¶mValue, 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;
}
//.........这里部分代码省略.........