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


C++ LLKeyframeMotion::getLoop方法代码示例

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


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

示例1: validateEaseOut

//-----------------------------------------------------------------------------
// validateEaseOut()
//-----------------------------------------------------------------------------
BOOL LLFloaterAnimPreview::validateEaseOut(LLUICtrl* spin, void* data)
{
	LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;

	if (!previewp->getEnabled())
		return FALSE;

	LLVOAvatar* avatarp;
	if (previewp->mInWorld)
	{
		if (!gAgent.getAvatarObject())
		{
			return FALSE;
		}
		avatarp = gAgent.getAvatarObject();
	}
	else
	{
		if (!previewp->mAnimPreview)
		{
			return FALSE;
		}
		avatarp = previewp->mAnimPreview->getDummyAvatar();
	}
	LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID);
	
	if (!motionp->getLoop())
	{
		F32 new_ease_out = llclamp((F32)previewp->childGetValue("ease_out_time").asReal(), 0.f, motionp->getDuration() - motionp->getEaseInDuration());
		previewp->childSetValue("ease_out_time", LLSD(new_ease_out));
	}

	return TRUE;
}
开发者ID:fractured-crystal,项目名称:SingularityViewer,代码行数:37,代码来源:llfloateranimpreview.cpp

示例2: validateEaseIn

//-----------------------------------------------------------------------------
// validateEaseIn()
//-----------------------------------------------------------------------------
BOOL LLFloaterAnimPreview::validateEaseIn(LLUICtrl* spin, void* data)
{
	LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;	
	if (!previewp->getEnabled())
		return FALSE;

	LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar();
	LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID);
	
	if (!motionp->getLoop())
	{
		F32 new_ease_in = llclamp((F32)previewp->childGetValue("ease_in_time").asReal(), 0.f, motionp->getDuration() - motionp->getEaseOutDuration());
		previewp->childSetValue("ease_in_time", LLSD(new_ease_in));
	}
	
	return TRUE;
}
开发者ID:Xara,项目名称:Meerkat-Viewer,代码行数:20,代码来源:llfloateranimpreview.cpp

示例3: postBuild


//.........这里部分代码省略.........
	{
		// generate unique id for this motion
		mTransactionID.generate();
		mMotionID = mTransactionID.makeAssetID(gAgent.getSecureSessionID());

		mAnimPreview = new LLPreviewAnimation(256, 256);

		// motion will be returned, but it will be in a load-pending state, as this is a new motion
		// this motion will not request an asset transfer until next update, so we have a chance to 
		// load the keyframe data locally
		motionp = (LLKeyframeMotion*)mAnimPreview->getDummyAvatar()->createMotion(mMotionID);

		// create data buffer for keyframe initialization
		S32 buffer_size = loaderp->getOutputSize();
		U8* buffer = new U8[buffer_size];

		LLDataPackerBinaryBuffer dp(buffer, buffer_size);

		// pass animation data through memory buffer
		loaderp->serialize(dp);
		dp.reset();
		BOOL success = motionp && motionp->deserialize(dp);

		delete []buffer;

		if (success)
		{
			setAnimCallbacks() ;
			
			const LLBBoxLocal &pelvis_bbox = motionp->getPelvisBBox();

			LLVector3 temp = pelvis_bbox.getCenter();
			// only consider XY?
			//temp.mV[VZ] = 0.f;
			F32 pelvis_offset = temp.magVec();

			temp = pelvis_bbox.getExtent();
			//temp.mV[VZ] = 0.f;
			F32 pelvis_max_displacement = pelvis_offset + (temp.magVec() * 0.5f) + 1.f;
			
			F32 camera_zoom = LLViewerCamera::getInstance()->getDefaultFOV() / (2.f * atan(pelvis_max_displacement / PREVIEW_CAMERA_DISTANCE));
		
			mAnimPreview->setZoom(camera_zoom);

			motionp->setName(childGetValue("name_form").asString());
			mAnimPreview->getDummyAvatar()->startMotion(mMotionID);
			childSetMinValue("playback_slider", 0.0);
			childSetMaxValue("playback_slider", 1.0);

			childSetValue("loop_check", LLSD(motionp->getLoop()));
			childSetValue("loop_in_point", LLSD(motionp->getLoopIn() / motionp->getDuration() * 100.f));
			childSetValue("loop_out_point", LLSD(motionp->getLoopOut() / motionp->getDuration() * 100.f));
			childSetValue("priority", LLSD((F32)motionp->getPriority()));
			childSetValue("hand_pose_combo", LLHandMotion::getHandPoseName(motionp->getHandPose()));
			childSetValue("ease_in_time", LLSD(motionp->getEaseInDuration()));
			childSetValue("ease_out_time", LLSD(motionp->getEaseOutDuration()));
			setEnabled(TRUE);
			std::string seconds_string;
			seconds_string = llformat(" - %.2f seconds", motionp->getDuration());

			setTitle(mFilename + std::string(seconds_string));
		}
		else
		{
			delete mAnimPreview;
			mAnimPreview = NULL;
			mMotionID.setNull();
			childSetValue("bad_animation_text", getString("failed_to_initialize"));
		}
	}
	else
	{
		if ( loaderp )
		{
			if (loaderp->getDuration() > MAX_ANIM_DURATION)
			{
				LLUIString out_str = getString("anim_too_long");
				out_str.setArg("[LENGTH]", llformat("%.1f", loaderp->getDuration()));
				out_str.setArg("[MAX_LENGTH]", llformat("%.1f", MAX_ANIM_DURATION));
				childSetValue("bad_animation_text", out_str.getString());
			}
			else
			{
				LLUIString out_str = getString("failed_file_read");
				out_str.setArg("[STATUS]", loaderp->getStatus()); // *TODO:Translate
				childSetValue("bad_animation_text", out_str.getString());
			}
		}

		//setEnabled(FALSE);
		mMotionID.setNull();
		mAnimPreview = NULL;
	}

	refresh();

	delete loaderp;

	return TRUE;
}
开发者ID:Xara,项目名称:Meerkat-Viewer,代码行数:101,代码来源:llfloateranimpreview.cpp


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