本文整理汇总了C++中LLFloaterAnimPreview::resetMotion方法的典型用法代码示例。如果您正苦于以下问题:C++ LLFloaterAnimPreview::resetMotion方法的具体用法?C++ LLFloaterAnimPreview::resetMotion怎么用?C++ LLFloaterAnimPreview::resetMotion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLFloaterAnimPreview
的用法示例。
在下文中一共展示了LLFloaterAnimPreview::resetMotion方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onCommitBaseAnim
//-----------------------------------------------------------------------------
// onCommitBaseAnim()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onCommitBaseAnim(LLUICtrl* ctrl, void* data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;
if (!previewp->getEnabled())
return;
if (previewp->mAnimPreview)
{
LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar();
BOOL paused = avatarp->areAnimationsPaused();
// stop all other possible base motions
avatarp->stopMotion(ANIM_AGENT_STAND, TRUE);
avatarp->stopMotion(ANIM_AGENT_WALK, TRUE);
avatarp->stopMotion(ANIM_AGENT_SIT, TRUE);
avatarp->stopMotion(ANIM_AGENT_HOVER, TRUE);
previewp->resetMotion();
if (!paused)
{
previewp->mPauseRequest = NULL;
}
}
}
示例2: onBtnPlay
//-----------------------------------------------------------------------------
// onBtnPlay()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onBtnPlay(void* user_data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)user_data;
if (!previewp->getEnabled())
return;
if (previewp->mMotionID.notNull() && previewp->mAnimPreview)
{
LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar();
if(!avatarp->isMotionActive(previewp->mMotionID))
{
previewp->resetMotion();
previewp->mPauseRequest = NULL;
}
else
{
if (avatarp->areAnimationsPaused())
{
previewp->mPauseRequest = NULL;
}
else
{
previewp->mPauseRequest = avatarp->requestPause();
}
}
}
}
示例3: onCommitLoopOut
//-----------------------------------------------------------------------------
// onCommitLoopOut()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onCommitLoopOut(LLUICtrl* ctrl, void* data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;
if (!previewp->getEnabled())
return;
LLVOAvatar* avatarp;
if (previewp->mInWorld)
{
if (!gAgent.getAvatarObject())
{
return;
}
avatarp = gAgent.getAvatarObject();
}
else
{
if (!previewp->mAnimPreview)
{
return;
}
avatarp = previewp->mAnimPreview->getDummyAvatar();
}
LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID);
if (motionp)
{
motionp->setLoopOut((F32)previewp->childGetValue("loop_out_point").asReal() * 0.01f * motionp->getDuration());
previewp->resetMotion();
previewp->childSetValue("loop_check", LLSD(TRUE));
onCommitLoop(ctrl, data);
}
}
示例4: onBtnStop
//-----------------------------------------------------------------------------
// onBtnStop()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onBtnStop(void* user_data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)user_data;
if (!previewp->getEnabled())
return;
if (previewp->mMotionID.notNull())
{
LLVOAvatar* avatarp;
if (previewp->mInWorld)
{
if (!gAgent.getAvatarObject())
{
return;
}
avatarp = gAgent.getAvatarObject();
}
else
{
if (!previewp->mAnimPreview)
{
return;
}
avatarp = previewp->mAnimPreview->getDummyAvatar();
}
previewp->resetMotion();
previewp->mPauseRequest = avatarp->requestPause();
}
}
示例5: onCommitEaseOut
//-----------------------------------------------------------------------------
// onCommitEaseOut()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onCommitEaseOut(LLUICtrl* ctrl, void* data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;
if (!previewp->getEnabled())
return;
LLVOAvatar* avatarp;
if (previewp->mInWorld)
{
if (!gAgent.getAvatarObject())
{
return;
}
avatarp = gAgent.getAvatarObject();
}
else
{
if (!previewp->mAnimPreview)
{
return;
}
avatarp = previewp->mAnimPreview->getDummyAvatar();
}
LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID);
motionp->setEaseOut((F32)previewp->childGetValue("ease_out_time").asReal());
previewp->resetMotion();
}
示例6: onCommitEmote
//-----------------------------------------------------------------------------
// onCommitEmote()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onCommitEmote(LLUICtrl* ctrl, void* data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;
if (!previewp->getEnabled())
return;
previewp->resetMotion(); // ssts emote
}
示例7: onCommitHandPose
//-----------------------------------------------------------------------------
// onCommitHandPose()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onCommitHandPose(LLUICtrl* ctrl, void* data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;
if (!previewp->getEnabled())
return;
previewp->resetMotion(); // sets hand pose
}
示例8: onBtnOK
//-----------------------------------------------------------------------------
// onBtnOK()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onBtnOK(void* userdata)
{
LLFloaterAnimPreview* floaterp = (LLFloaterAnimPreview*)userdata;
if (!floaterp->getEnabled()) return;
if (floaterp->mAnimPreview)
{
LLKeyframeMotion* motionp = (LLKeyframeMotion*)floaterp->mAnimPreview->getPreviewAvatar()->findMotion(floaterp->mMotionID);
S32 file_size = motionp->getFileSize();
U8* buffer = new U8[file_size];
LLDataPackerBinaryBuffer dp(buffer, file_size);
if (motionp->serialize(dp))
{
LLVFile file(gVFS, motionp->getID(), LLAssetType::AT_ANIMATION, LLVFile::APPEND);
S32 size = dp.getCurrentSize();
file.setMaxSize(size);
if (file.write((U8*)buffer, size))
{
std::string name = floaterp->getChild<LLUICtrl>("name_form")->getValue().asString();
std::string desc = floaterp->getChild<LLUICtrl>("description_form")->getValue().asString();
LLAssetStorage::LLStoreAssetCallback callback = NULL;
S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
void *userdata = NULL;
upload_new_resource(floaterp->mTransactionID, // tid
LLAssetType::AT_ANIMATION,
name,
desc,
0,
LLFolderType::FT_NONE,
LLInventoryType::IT_ANIMATION,
LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
name,
callback, expected_upload_cost, userdata);
}
else
{
llwarns << "Failure writing animation data." << llendl;
LLNotificationsUtil::add("WriteAnimationFail");
}
}
delete [] buffer;
// clear out cache for motion data
floaterp->resetMotion();
floaterp->mAnimPreview->getPreviewAvatar()->removeMotion(floaterp->mMotionID);
LLKeyframeDataCache::removeKeyframeData(floaterp->mMotionID);
floaterp->mMotionID.setNull();
}
floaterp->closeFloater(false);
}
示例9: onCommitEaseIn
//-----------------------------------------------------------------------------
// onCommitEaseIn()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onCommitEaseIn(LLUICtrl* ctrl, void* data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;
if (!previewp->getEnabled())
return;
LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar();
LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID);
motionp->setEaseIn((F32)previewp->childGetValue("ease_in_time").asReal());
previewp->resetMotion();
}
示例10: onBtnStop
//-----------------------------------------------------------------------------
// onBtnStop()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onBtnStop(void* user_data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)user_data;
if (!previewp->getEnabled())
return;
if (previewp->mMotionID.notNull() && previewp->mAnimPreview)
{
LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar();
previewp->resetMotion();
previewp->mPauseRequest = avatarp->requestPause();
}
}
示例11: onCommitLoopIn
//-----------------------------------------------------------------------------
// onCommitLoopIn()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onCommitLoopIn(LLUICtrl* ctrl, void* data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;
if (!previewp->getEnabled())
return;
LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar();
LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID);
if (motionp)
{
motionp->setLoopIn((F32)previewp->childGetValue("loop_in_point").asReal() / 100.f);
previewp->resetMotion();
previewp->childSetValue("loop_check", LLSD(TRUE));
onCommitLoop(ctrl, data);
}
}