本文整理汇总了C++中MorphR3::GetReference方法的典型用法代码示例。如果您正苦于以下问题:C++ MorphR3::GetReference方法的具体用法?C++ MorphR3::GetReference怎么用?C++ MorphR3::GetReference使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MorphR3
的用法示例。
在下文中一共展示了MorphR3::GetReference方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: maxMorpher
/*===========================================================================*\
| Returns the the progressive morph weight
|
\*===========================================================================*/
Value*
wm3_SetProgressiveMorphWeight_cf(Value** arg_list, int count)
{
check_arg_count(WM3_SetProgressiveMorphWeight_cf, 4, count);
type_check(arg_list[0], MAXModifier, _T("WM3_SetProgressiveMorphWeight [Morpher Modifier] [Morph Index] [Progressive Node] [Weight]"));
type_check(arg_list[1], Integer, _T("WM3_SetProgressiveMorphWeight [Morpher Modifier] [Morph Index] [Progressive Node] [Weight]"));
type_check(arg_list[2], MAXNode, _T("WM3_SetProgressiveMorphWeight [Morpher Modifier] [Morph Index] [Progressive Node] [Weight]"));
type_check(arg_list[3], Float, _T("WM3_SetProgressiveMorphWeight [Morpher Modifier] [Morph Index] [Progressive Node] [Weight]"));
ReferenceTarget* obj = arg_list[0]->to_modifier();
if( !check_ValidMorpher(obj,arg_list) ) return &false_value;
MorphR3 *mp = (MorphR3*)arg_list[0]->to_modifier();
int morphIndex = arg_list[1]->to_int();
morphIndex--;
if(morphIndex>=100) morphIndex = 99;
if(morphIndex<0) morphIndex = 0;
INode *node = NULL;
node = arg_list[2]->to_node();
float weight = arg_list[3]->to_float();
if (node == NULL) return &false_value;
MaxMorphModifier maxMorpher(mp);
int pMorphCount = maxMorpher.GetMorphChannel(morphIndex).NumProgressiveMorphTargets();
int pMorphIndex = -1;
if (node == (INode*)mp->GetReference(101+morphIndex))
{
pMorphIndex = 0;
}
else
{
for (int i = 1; i < (pMorphCount); i++)
{
int refnum = 200+i+morphIndex*MAX_PROGRESSIVE_TARGETS;
if (node == (INode*)mp->GetReference(refnum))
{
pMorphIndex = i ;
break;
}
}
}
bool res = maxMorpher.GetMorphChannel(morphIndex).SetProgressiveMorphWeight(pMorphIndex, weight);
if (res)
{
mp->Update_channelFULL();
mp->Update_channelParams();
}
return (res ? &true_value : &false_value);
}
示例2: GetString
void M3Mat::SetSubMtl(int i, Mtl *m) {
if(m && morphp ) {
if( m->ClassID() == M3MatClassID ) {
M3Mat *m3m = static_cast<M3Mat *> (m);
MorphR3 *mp = m3m->morphp;
if(mp){
for(int j=101; j<=200; j++){
for(int k=101; k<=200; k++){
if( morphp->GetReference(j) && morphp->GetReference(j) == mp->GetReference(k) ) {
if(morphp->hMaxWnd)
{
TSTR cyclic;
cyclic = GetString(IDS_CYCLIC_MATERIAL);
MessageBox(morphp->hMaxWnd,cyclic,GetString(IDS_CLASS_NAME),MB_OK);
}
return;
}
}
}
}
}
}
ReplaceReference(i,m);
if (matDlg) matDlg->UpdateSubMtlNames();
}