本文整理汇总了C++中fairy::LogicModel::getCurrentAnimName方法的典型用法代码示例。如果您正苦于以下问题:C++ LogicModel::getCurrentAnimName方法的具体用法?C++ LogicModel::getCurrentAnimName怎么用?C++ LogicModel::getCurrentAnimName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fairy::LogicModel
的用法示例。
在下文中一共展示了LogicModel::getCurrentAnimName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnBtn
void AnimationSelector::OnBtn(wxCommandEvent & e)
{
if (e.GetId() == ID_BTN_PLAY)
{
if (!m_bPause)
{
return;
}
}
else
{
if (m_bPause)
{
return;
}
}
m_bPause = !m_bPause;
m_btnPause->Enable(!m_bPause);
m_btnPlay->Enable(m_bPause);
Fairy::LogicModel* pObjModel = GetDataManipulator()->m_pObjTemplate;
if ( pObjModel && !pObjModel->getCurrentAnimName().empty())
{
pObjModel->setAnimEditing(m_bPause);
}
}
示例2: wxASSERT
void
AnimationSelector::OnAnimationListSelChanged(wxTreeEvent& e)
{
// reset the state
resetState();
wxTreeItemId item = e.GetItem();
wxASSERT(item.IsOk());
wxTreeCtrl* tree = wxStaticCast(e.GetEventObject(), wxTreeCtrl);
mActivedItem = e.GetItem();
wxArrayTreeItemIds selections;
int nCount = tree->GetSelections(selections);
if(nCount <= 0)
return;
if (mIsMeshAnim)
{
GetDataManipulator()->changeMeshAnimation(DoActiveItem(item));
return;
}
GetDataManipulator()->changeAnimation(DoActiveItem(item),0.0);
Fairy::LogicModel* pObjModel = GetDataManipulator()->m_pObjTemplate;
if ( pObjModel && !pObjModel->getCurrentAnimName().empty())
{
m_btnPause->Enable(true);
pObjModel->setAnimEditing(m_bPause);
Ogre::String animationName = pObjModel->getCurrentAnimName();
bool bLoop = pObjModel->getAnimationLoop();
Ogre::Real timeTotal = pObjModel->getAnimationLength(animationName);
m_endTimeText->SetValue(Ogre::StringConverter::toString(timeTotal));
m_endFrameText->SetValue(Ogre::StringConverter::toString(timeTotal*STATIC_FPS));
}
}
示例3: OnSliderUpdate
void AnimationSelector::OnSliderUpdate(wxCommandEvent & e)
{
if (!m_bPause)
{
return;
}
int pos = m_slider->GetValue();
Fairy::LogicModel* pObjModel = GetDataManipulator()->m_pObjTemplate;
if ( pObjModel && !pObjModel->getCurrentAnimName().empty())
{
Ogre::Real timeTotal = pObjModel->getAnimationLength(pObjModel->getCurrentAnimName());
Ogre::Real posValue = ((Ogre::Real)pos)/m_slider->GetMax();
pObjModel->setAnimTimePos(posValue);
m_curTimeText->SetValue(Ogre::StringConverter::toString(posValue*timeTotal));
m_curFrameText->SetValue(Ogre::StringConverter::toString(posValue*timeTotal*STATIC_FPS));
}
}
示例4: pauseAnimation
void AnimationSelector::pauseAnimation(bool bPause)
{
if (!GetDataManipulator())
{
return;
}
Fairy::LogicModel* pObjModel = GetDataManipulator()->m_pObjTemplate;
if ( !pObjModel || pObjModel->getCurrentAnimName().empty())
{
return;
}
if (!bPause)
{
if (!m_bPause)
{
return;
}
}
else
{
if (m_bPause)
{
return;
}
}
m_bPause = !m_bPause;
m_btnPause->Enable(!m_bPause);
m_btnPlay->Enable(m_bPause);
if ( pObjModel && !pObjModel->getCurrentAnimName().empty())
{
pObjModel->setAnimEditing(m_bPause);
}
}