当前位置: 首页>>代码示例>>C++>>正文


C++ LLVOAvatar::areAnimationsPaused方法代码示例

本文整理汇总了C++中LLVOAvatar::areAnimationsPaused方法的典型用法代码示例。如果您正苦于以下问题:C++ LLVOAvatar::areAnimationsPaused方法的具体用法?C++ LLVOAvatar::areAnimationsPaused怎么用?C++ LLVOAvatar::areAnimationsPaused使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LLVOAvatar的用法示例。


在下文中一共展示了LLVOAvatar::areAnimationsPaused方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
		}
	}
}
开发者ID:Xara,项目名称:Meerkat-Viewer,代码行数:29,代码来源:llfloateranimpreview.cpp

示例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();
			}
		}
	}
}
开发者ID:Xara,项目名称:Meerkat-Viewer,代码行数:31,代码来源:llfloateranimpreview.cpp

示例3: refresh

//-----------------------------------------------------------------------------
// refresh()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::refresh()
{
	if (!mAnimPreview)
	{
		childShow("bad_animation_text");
		mPlayButton->setEnabled(FALSE);
		mStopButton->setEnabled(FALSE);
		childDisable("ok_btn");
	}
	else
	{
		childHide("bad_animation_text");
		mPlayButton->setEnabled(TRUE);
		LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar();
		if (avatarp->isMotionActive(mMotionID))
		{
			mStopButton->setEnabled(TRUE);
			LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID);
			if (avatarp->areAnimationsPaused())
			{

				mPlayButton->setImages(std::string("button_anim_play.tga"),
									   std::string("button_anim_play_selected.tga"));

			}
			else
			{
				if (motionp)
				{
					F32 fraction_complete = motionp->getLastUpdateTime() / motionp->getDuration();
					childSetValue("playback_slider", fraction_complete);
				}
				mPlayButton->setImages(std::string("button_anim_pause.tga"),
									   std::string("button_anim_pause_selected.tga"));

			}
		}
		else
		{
			mPauseRequest = avatarp->requestPause();
			mPlayButton->setImages(std::string("button_anim_play.tga"),
								   std::string("button_anim_play_selected.tga"));

			mStopButton->setEnabled(TRUE); // stop also resets, leave enabled.
		}
		childEnable("ok_btn");
		mAnimPreview->requestUpdate();
	}
}
开发者ID:Xara,项目名称:Meerkat-Viewer,代码行数:52,代码来源:llfloateranimpreview.cpp

示例4: 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;	
	}
}
开发者ID:fractured-crystal,项目名称:SingularityViewer,代码行数:48,代码来源:llfloateranimpreview.cpp

示例5: onBtnPlay

//-----------------------------------------------------------------------------
// onBtnPlay()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onBtnPlay()
{
    if (!getEnabled())
        return;

    if (mMotionID.notNull() && mAnimPreview)
    {
        LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar();

        if (!avatarp->isMotionActive(mMotionID))
        {
            resetMotion();
            mPauseRequest = NULL;
        }
        else if (avatarp->areAnimationsPaused())
        {
            mPauseRequest = NULL;
        }
    }
}
开发者ID:jacek,项目名称:viewer-development,代码行数:23,代码来源:llfloateranimpreview.cpp


注:本文中的LLVOAvatar::areAnimationsPaused方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。