本文整理汇总了C++中LLVOAvatar::startMotion方法的典型用法代码示例。如果您正苦于以下问题:C++ LLVOAvatar::startMotion方法的具体用法?C++ LLVOAvatar::startMotion怎么用?C++ LLVOAvatar::startMotion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLVOAvatar
的用法示例。
在下文中一共展示了LLVOAvatar::startMotion方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onSliderMove
//-----------------------------------------------------------------------------
// onSliderMove()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onSliderMove(LLUICtrl* ctrl, void*user_data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)user_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();
}
F32 slider_value = (F32)previewp->childGetValue("playback_slider").asReal();
LLUUID base_id = previewp->mIDList[previewp->childGetValue("preview_base_anim").asString()];
LLMotion* motionp = avatarp->findMotion(previewp->mMotionID);
F32 duration = motionp->getDuration();// + motionp->getEaseOutDuration();
F32 delta_time = duration * slider_value;
avatarp->deactivateAllMotions();
avatarp->startMotion(base_id, delta_time + BASE_ANIM_TIME_OFFSET);
avatarp->startMotion(previewp->mMotionID, delta_time);
previewp->mPauseRequest = avatarp->requestPause();
previewp->refresh();
}
示例2: resetMotion
//-----------------------------------------------------------------------------
// resetMotion()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::resetMotion()
{
LLVOAvatar* avatarp;
if (mInWorld)
{
avatarp = gAgent.getAvatarObject();
}
else
{
avatarp = mAnimPreview->getDummyAvatar();
}
if (!avatarp)
{
return;
}
BOOL paused = avatarp->areAnimationsPaused();
// *TODO: Fix awful casting hack
LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID);
// Set emotion
std::string emote = childGetValue("emote_combo").asString();
motionp->setEmote(mIDList[emote]);
LLUUID base_id = mIDList[childGetValue("preview_base_anim").asString()];
avatarp->deactivateAllMotions();
avatarp->startMotion(base_id, BASE_ANIM_TIME_OFFSET);
avatarp->startMotion(mMotionID, 0.0f);
childSetValue("playback_slider", 0.0f);
// Set pose
std::string handpose = childGetValue("hand_pose_combo").asString();
avatarp->startMotion( ANIM_AGENT_HAND_MOTION, 0.0f );
motionp->setHandPose(LLHandMotion::getHandPose(handpose));
if (paused)
{
mPauseRequest = avatarp->requestPause();
}
else
{
mPauseRequest = NULL;
}
}
示例3:
//-----------------------------------------------------------------------------
// LLFloaterAnimPreview()
//-----------------------------------------------------------------------------
LLFloaterAnimPreview::~LLFloaterAnimPreview()
{
if (mInWorld)
{
LLVOAvatar* avatarp = gAgent.getAvatarObject();
if (avatarp)
{
if (mMotionID.notNull())
{
avatarp->stopMotion(mMotionID, TRUE);
avatarp->removeMotion(mMotionID);
}
avatarp->deactivateAllMotions();
avatarp->startMotion(ANIM_AGENT_HEAD_ROT);
avatarp->startMotion(ANIM_AGENT_EYE);
avatarp->startMotion(ANIM_AGENT_BODY_NOISE);
avatarp->startMotion(ANIM_AGENT_BREATHE_ROT);
avatarp->startMotion(ANIM_AGENT_HAND_MOTION);
avatarp->startMotion(ANIM_AGENT_PELVIS_FIX);
avatarp->startMotion(ANIM_AGENT_STAND, BASE_ANIM_TIME_OFFSET);
}
}
delete mAnimPreview;
mAnimPreview = NULL;
setEnabled(FALSE);
}
示例4:
//-----------------------------------------------------------------------------
// shutdown()
//-----------------------------------------------------------------------------
void LLMorphView::shutdown()
{
LLVOAvatar::onCustomizeEnd();
LLVOAvatar *avatarp = gAgent.getAvatarObject();
if(avatarp && !avatarp->isDead())
{
avatarp->startMotion( ANIM_AGENT_BODY_NOISE );
avatarp->mSpecialRenderMode = 0;
// reset camera
LLViewerCamera::getInstance()->setNear(mOldCameraNearClip);
}
}