本文整理汇总了C++中BL_DeformableGameObject::GetKey方法的典型用法代码示例。如果您正苦于以下问题:C++ BL_DeformableGameObject::GetKey方法的具体用法?C++ BL_DeformableGameObject::GetKey怎么用?C++ BL_DeformableGameObject::GetKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BL_DeformableGameObject
的用法示例。
在下文中一共展示了BL_DeformableGameObject::GetKey方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
//.........这里部分代码省略.........
m_localtime=m_startframe;
keepgoing = false;
}
}
break;
case ACT_ACTION_LOOP_END:
if (wrap){
if (m_flag & ACT_FLAG_KEYUP){
keepgoing = false;
m_localtime = m_endframe;
m_flag &= ~ACT_FLAG_LOCKINPUT;
}
SetStartTime(curtime);
}
break;
case ACT_ACTION_PLAY:
if (wrap){
m_localtime = m_endframe;
keepgoing = false;
m_flag &= ~ACT_FLAG_LOCKINPUT;
}
break;
default:
keepgoing = false;
break;
}
/* Set the property if its defined */
if (m_framepropname[0] != '\0') {
CValue* propowner = GetParent();
CValue* oldprop = propowner->GetProperty(m_framepropname);
CValue* newval = new CFloatValue(m_localtime);
if (oldprop) {
oldprop->SetValue(newval);
} else {
propowner->SetProperty(m_framepropname, newval);
}
newval->Release();
}
if (bNegativeEvent)
m_blendframe=0.0f;
/* Apply the pose if necessary*/
if (apply) {
/* Priority test */
if (obj->SetActiveAction(this, priority, curtime)){
Key *key = obj->GetKey();
if (!key) {
// this could happen if the mesh was changed in the middle of an action
// and the new mesh has no key, stop the action
keepgoing = false;
}
else {
ListBase tchanbase= {NULL, NULL};
if (m_blendin && m_blendframe==0.0f){
// this is the start of the blending, remember the startup shape
obj->GetShape(m_blendshape);
m_blendstart = curtime;
}
// only interested in shape channel
// in 2.4x was // extract_ipochannels_from_action(&tchanbase, &key->id, m_action, "Shape", m_localtime);
BKE_animsys_evaluate_animdata(&key->id, key->adt, m_localtime, ADT_RECALC_ANIM);
// XXX - in 2.5 theres no way to do this. possibly not that important to support - Campbell
if (0) { // XXX !execute_ipochannels(&tchanbase)) {
// no update, this is possible if action does not match the keys, stop the action
keepgoing = false;
}
else {
// the key have changed, apply blending if needed
if (m_blendin && (m_blendframe<m_blendin)){
newweight = (m_blendframe/(float)m_blendin);
BlendShape(key, 1.0f - newweight);
/* Increment current blending percentage */
m_blendframe = (curtime - m_blendstart)*KX_KetsjiEngine::GetAnimFrameRate();
if (m_blendframe>m_blendin)
m_blendframe = m_blendin;
}
m_lastUpdate = m_localtime;
}
BLI_freelistN(&tchanbase);
}
}
else{
m_blendframe = 0.0f;
}
}
if (!keepgoing){
m_blendframe = 0.0f;
}
return keepgoing;
};