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


C++ LLMotion::getDuration方法代码示例

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


在下文中一共展示了LLMotion::getDuration方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: onInitialize

//-----------------------------------------------------------------------------
// LLKeyframeMotionParam::onInitialize(LLCharacter *character)
//-----------------------------------------------------------------------------
LLMotion::LLMotionInitStatus LLKeyframeMotionParam::onInitialize(LLCharacter *character)
{
	mCharacter = character;

	if (!loadMotions())
	{
		return STATUS_FAILURE;	
	}
	
	for (motion_map_t::iterator iter = mParameterizedMotions.begin();
		 iter != mParameterizedMotions.end(); ++iter)
	{
		motion_list_t& motionList = iter->second;
		for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2)
		{
			const ParameterizedMotion& paramMotion = *iter2;
			LLMotion* motion = paramMotion.mMotion;
			motion->onInitialize(character);

			// <FS> Fix copy paste error
			//if (motion->getDuration() > mEaseInDuration)
			if (motion->getEaseInDuration() > mEaseInDuration)
			// </FS>
			{
				mEaseInDuration = motion->getEaseInDuration();
			}

			if (motion->getEaseOutDuration() > mEaseOutDuration)
			{
				mEaseOutDuration = motion->getEaseOutDuration();
			}

			if (motion->getDuration() > mDuration)
			{
				mDuration = motion->getDuration();
			}

			if (motion->getPriority() > mPriority)
			{
				mPriority = motion->getPriority();
			}

			LLPose *pose = motion->getPose();

			mPoseBlender.addMotion(motion);
			for (LLJointState *jsp = pose->getFirstJointState(); jsp; jsp = pose->getNextJointState())
			{
				LLPose *blendedPose = mPoseBlender.getBlendedPose();
				blendedPose->addJointState(jsp);
			}
		}
	}

	return STATUS_SUCCESS;
}
开发者ID:CaseyraeStarfinder,项目名称:Firestorm-Viewer,代码行数:58,代码来源:llkeyframemotionparam.cpp

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


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