本文整理汇总了C++中ogre::TransformKeyFrame::getTime方法的典型用法代码示例。如果您正苦于以下问题:C++ TransformKeyFrame::getTime方法的具体用法?C++ TransformKeyFrame::getTime怎么用?C++ TransformKeyFrame::getTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::TransformKeyFrame
的用法示例。
在下文中一共展示了TransformKeyFrame::getTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RefreshCodeText
void CameraTrackSettingDialog::RefreshCodeText(void)
{
if (mCameraTrack)
{
mCodeText.Clear();
mCameraInfoListBox->Clear();
mModifySpinCtrl->SetValue("1");
mPointIndexTextCtrl->Clear();
mPositionTextCtrl->Clear();
mOrientationTextCtrl->Clear();
mTimeTextCtrl->Clear();
mCodeText += "Ogre::TransformKeyFrame* ";
for (unsigned short index = 0; index < mCameraTrack->getNumKeyFrames(); ++index)
{
Ogre::TransformKeyFrame* keyFrame = static_cast<Ogre::TransformKeyFrame*>( mCameraTrack->getKeyFrame(index) );
const Ogre::Vector3& pos = keyFrame->getTranslate();
const Ogre::Quaternion& ori = keyFrame->getRotation();
float time = keyFrame->getTime();
mCodeText += "key = mCameraTrack->createNodeKeyFrame(" + Ogre::StringConverter::toString(time) + ");\n";
mCodeText += "key->setTranslate(Ogre::Vector3(" + Ogre::StringConverter::toString(pos.x) + "," +
Ogre::StringConverter::toString(pos.y) + "," + Ogre::StringConverter::toString(pos.z) + "));\n";
mCodeText += "key->setRotation(Ogre::Quaternion(" + Ogre::StringConverter::toString(ori.w) + "," +
Ogre::StringConverter::toString(ori.x) + "," + Ogre::StringConverter::toString(ori.y) + "," +
Ogre::StringConverter::toString(ori.z) +"));\n";
// 刷新listbox
mCameraInfoListBox->Append(Ogre::StringConverter::toString(pos) + "," +
Ogre::StringConverter::toString(ori) + "," + Ogre::StringConverter::toString(time));
}
mCodeTextCtrl->SetValue(mCodeText);
mModifySpinCtrl->SetRange(1, mCameraTrack->getNumKeyFrames());
}
}
示例2: OnSaveTrack
void CameraTrackSettingDialog::OnSaveTrack(wxCommandEvent& event)
{
assert (mCameraTrack);
assert (mCameraAnimState);
wxFileDialog fileDialog(this,
_("Save track file"),
"",
"",
"Track files (*.track)|*.track",
wxSAVE | wxOVERWRITE_PROMPT);
if (fileDialog.ShowModal() != wxID_OK)
return;
wxString fullFileName = fileDialog.GetPath();
std::ofstream stream(fullFileName.c_str());
Ogre::String trackStr;
trackStr += Ogre::StringConverter::toString( mCameraAnimState->getLength() ) + ","
+ Ogre::StringConverter::toString( mCameraTrack->getNumKeyFrames() ) + ",";
for (unsigned short index = 0; index < mCameraTrack->getNumKeyFrames(); ++index)
{
Ogre::TransformKeyFrame* keyFrame = static_cast<Ogre::TransformKeyFrame*>( mCameraTrack->getKeyFrame(index) );
const Ogre::Vector3& pos = keyFrame->getTranslate();
const Ogre::Quaternion& ori = keyFrame->getRotation();
float time = keyFrame->getTime();
trackStr += Ogre::StringConverter::toString(pos) + ","
+ Ogre::StringConverter::toString(ori) + ","
+ Ogre::StringConverter::toString(time) + ",";
}
stream << trackStr.c_str();
stream.close();
}