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


C++ CStudioHdr::numflexcontrollers方法代码示例

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


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

示例1: ResetActorFlexesForScene

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void C_SceneEntity::ResetActorFlexesForScene()
{
	int nActorCount = m_pScene->GetNumActors();
	for( int iActor = 0; iActor < nActorCount; ++iActor )
	{
		CChoreoActor *pChoreoActor = m_pScene->GetActor( iActor );
		if ( !pChoreoActor )
			continue;

		C_BaseFlex *pFlexActor = FindNamedActor( pChoreoActor );
		if ( !pFlexActor )
			continue;

		CStudioHdr *pStudioHdr = pFlexActor->GetModelPtr();
		if ( !pStudioHdr )
			continue;

		if ( pStudioHdr->numflexdesc() == 0 )
			continue;

		// Reset the flex weights to their starting position.
		LocalFlexController_t iController;
		for ( iController = LocalFlexController_t(0); iController < pStudioHdr->numflexcontrollers(); ++iController )
		{
			pFlexActor->SetFlexWeight( iController, 0.0f );
		}

		// Reset the prediction interpolation values.
		pFlexActor->m_iv_flexWeight.Reset();
	}
}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:34,代码来源:c_sceneentity.cpp

示例2: CheckResetFlexes

void IFaceposerModels::CheckResetFlexes( void )
{
	int current_render_frame = g_MDLViewer->GetCurrentFrame();
	if ( current_render_frame == m_nLastRenderFrame )
		return;

	m_nLastRenderFrame = current_render_frame;

	// the phoneme editor just adds to the face, so reset the controllers 
	int c = Count();
	for ( int i = 0; i < c; i++ )
	{
		CFacePoserModel *m = GetEntry( i );
		if ( !m )
			continue;

		StudioModel *model = m->GetModel();
		if ( !model )
			continue;

		CStudioHdr *hdr = model->GetStudioHdr();
		if ( !hdr )
			continue;

		for ( LocalFlexController_t i = LocalFlexController_t(0); i < hdr->numflexcontrollers(); i++ )
		{
			model->SetFlexController( i, 0.0f );
		}
	}
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:30,代码来源:faceposer_models.cpp

示例3: GetNumFlexControllers

LocalFlexController_t CAnimating::GetNumFlexControllers( void )
{
	CStudioHdr *pstudiohdr = GetModelPtr( );
	if (! pstudiohdr)
		return LocalFlexController_t(0);

	return pstudiohdr->numflexcontrollers();
}
开发者ID:KissLick,项目名称:sourcemod-npc-in-css,代码行数:8,代码来源:CAnimating.cpp

示例4: SetFlexControllerRaw

void StudioModel::SetFlexControllerRaw( LocalFlexController_t iFlex, float flValue )
{
	CStudioHdr *pStudioHdr = GetStudioHdr();
	if ( !pStudioHdr )
		return;

	if (iFlex >= 0 && iFlex < pStudioHdr->numflexcontrollers())
	{
//		mstudioflexcontroller_t *pflex = pStudioHdr->pFlexcontroller(iFlex);
		m_flexweight[iFlex] = clamp( flValue, 0.0f, 1.0f );
	}
}
开发者ID:newroob,项目名称:bg2-2007,代码行数:12,代码来源:studio_utils.cpp

示例5: GetFlexControllerRaw

float StudioModel::GetFlexControllerRaw( LocalFlexController_t iFlex )
{
	CStudioHdr *pStudioHdr = GetStudioHdr();
	if ( !pStudioHdr )
		return 0.0f;

	if (iFlex >= 0 && iFlex < pStudioHdr->numflexcontrollers())
	{
//		mstudioflexcontroller_t *pflex = pStudioHdr->pFlexcontroller(iFlex);
		return m_flexweight[iFlex];
	}
	return 0.0;
}
开发者ID:newroob,项目名称:bg2-2007,代码行数:13,代码来源:studio_utils.cpp

示例6: LookupFlexController

LocalFlexController_t StudioModel::LookupFlexController( char *szName )
{
	CStudioHdr *pStudioHdr = GetStudioHdr();
	if (!pStudioHdr)
		return LocalFlexController_t(0);

	for (LocalFlexController_t iFlex = LocalFlexController_t(0); iFlex < pStudioHdr->numflexcontrollers(); iFlex++)
	{
		if (stricmp( szName, pStudioHdr->pFlexcontroller( iFlex )->pszName() ) == 0)
		{
			return iFlex;
		}
	}
	return LocalFlexController_t(-1);
}
开发者ID:newroob,项目名称:bg2-2007,代码行数:15,代码来源:studio_utils.cpp

示例7: LookupFlexController

int StudioModel::LookupFlexController( char *szName )
{
	CStudioHdr *pStudioHdr = GetStudioHdr();
	if (!pStudioHdr)
		return false;

	for (int iFlex = 0; iFlex < pStudioHdr->numflexcontrollers(); iFlex++)
	{
		if (stricmp( szName, pStudioHdr->pFlexcontroller( iFlex )->pszName() ) == 0)
		{
			return iFlex;
		}
	}
	return -1;
}
开发者ID:chrizonix,项目名称:RCBot2,代码行数:15,代码来源:studio_utils.cpp

示例8: SetFlexController

void StudioModel::SetFlexController( LocalFlexController_t iFlex, float flValue )
{
	CStudioHdr *pStudioHdr = GetStudioHdr();
	if ( !pStudioHdr )
		return;

	if (iFlex >= 0 && iFlex < pStudioHdr->numflexcontrollers())
	{
		mstudioflexcontroller_t *pflex = pStudioHdr->pFlexcontroller(iFlex);

		if (pflex->min != pflex->max)
		{
			flValue = (flValue - pflex->min) / (pflex->max - pflex->min);
		}
		m_flexweight[iFlex] = clamp( flValue, 0.0f, 1.0f );
	}
}
开发者ID:newroob,项目名称:bg2-2007,代码行数:17,代码来源:studio_utils.cpp

示例9: RunFlexRules

void StudioModel::RunFlexRules( )
{
	CStudioHdr *pStudioHdr = GetStudioHdr();

	float src[MAXSTUDIOFLEXCTRL*4];

	for (LocalFlexController_t i = LocalFlexController_t(0); i < pStudioHdr->numflexcontrollers(); i++)
	{
		mstudioflexcontroller_t *pflex = pStudioHdr->pFlexcontroller( i );
		int j = pStudioHdr->pFlexcontroller( i )->localToGlobal;
		// remap m_flexweights to full dynamic range, global flexcontroller indexes
		if (j >= 0 && j < MAXSTUDIOFLEXCTRL*4)
		{
			src[j] = m_flexweight[i] * (pflex->max - pflex->min) + pflex->min; 
		}
	}
	
	pStudioHdr->RunFlexRules( src, g_flexdescweight );
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:19,代码来源:studio_flex.cpp

示例10: GetFlexController

float StudioModel::GetFlexController( LocalFlexController_t iFlex )
{
	CStudioHdr *pStudioHdr = GetStudioHdr();
	if ( !pStudioHdr )
		return 0.0f;

	if (iFlex >= 0 && iFlex < pStudioHdr->numflexcontrollers())
	{
		mstudioflexcontroller_t *pflex = pStudioHdr->pFlexcontroller(iFlex);

		float flValue = m_flexweight[iFlex];

		if (pflex->min != pflex->max)
		{
			flValue = flValue * (pflex->max - pflex->min) + pflex->min;
		}
		return flValue;
	}
	return 0.0;
}
开发者ID:newroob,项目名称:bg2-2007,代码行数:20,代码来源:studio_utils.cpp

示例11: RunFlexRules

void StudioModel::RunFlexRules(  )
{
	int i;

	CStudioHdr *pStudioHdr = GetStudioHdr();

	float src[MAXSTUDIOFLEXCTRL*4];

	for (i = 0; i < pStudioHdr->numflexcontrollers(); i++)
	{
		mstudioflexcontroller_t *pflex = pStudioHdr->pFlexcontroller( i );
		int j = pStudioHdr->pFlexcontroller( i )->link;
		// remap m_flexweights to full dynamic range, global flexcontroller indexes
		src[j] = m_flexweight[i] * (pflex->max - pflex->min) + pflex->min; 
	}
	
	pStudioHdr->RunFlexRules( src, g_flexdescweight );

	return;
}
开发者ID:chrizonix,项目名称:RCBot2,代码行数:20,代码来源:studio_flex.cpp

示例12: FindPoseCycle

void IFaceposerModels::CFacePoserModel::CreateNewBitmap( char const *pchBitmapFilename, int sequence, int nSnapShotSize, bool bZoomInOnFace, CExpression *pExpression, mxbitmapdata_t *bitmap )
{
	MatSysWindow *pWnd = g_pMatSysWindow;
	if ( !pWnd ) 
		return;

	StudioModel *model = m_pModel;
	if ( !model )
		return;

	CStudioHdr *hdr = model->GetStudioHdr();
	if ( !hdr )
		return;
	if ( sequence < 0 || sequence >= hdr->GetNumSeq() )
		return;

	mstudioseqdesc_t &seqdesc = hdr->pSeqdesc( sequence );

	Con_ColorPrintf( FILE_COLOR, "Creating bitmap %s for sequence '%s'\n", pchBitmapFilename, seqdesc.pszLabel() );

	model->ClearOverlaysSequences();
	int iLayer = model->GetNewAnimationLayer();
	model->SetOverlaySequence( iLayer, sequence, 1.0 );
	model->SetOverlayRate( iLayer, FindPoseCycle( model, sequence ), 0.0 );

	for (int i = 0; i < hdr->GetNumPoseParameters(); i++)
	{
		model->SetPoseParameter( i, 0.0 );
	}

	float flexValues[ GLOBAL_STUDIO_FLEX_CONTROL_COUNT ] = { 0 };

	if ( pExpression )
	{
		float *settings = pExpression->GetSettings();
		float *weights = pExpression->GetWeights();

		// Save existing settings from model
		for ( LocalFlexController_t i = LocalFlexController_t(0); i < hdr->numflexcontrollers(); ++i )
		{
			int j = hdr->pFlexcontroller( i )->localToGlobal;
			if ( j == -1 )
				continue;
			flexValues[ i ] = model->GetFlexController( i );
			// Set Value from passed in settings
			model->SetFlexController( i, settings[ j ] * weights[ j ] );
		}
	}

	model->ClearLookTargets( );

	QAngle oldrot, oldLight;
	Vector oldtrans;
	
	VectorCopy( model->m_angles, oldrot );
	VectorCopy( model->m_origin, oldtrans );
	VectorCopy( g_viewerSettings.lightrot, oldLight );

	model->m_angles.Init();
	model->m_origin.Init();
	g_viewerSettings.lightrot.Init();

	g_viewerSettings.lightrot.y = -180;

	bool bSaveGround = g_viewerSettings.showGround;
	g_viewerSettings.showGround = false;

	if ( bZoomInOnFace )
	{
		Vector size;
		VectorSubtract( hdr->hull_max(), hdr->hull_min(), size );

		float eyeheight = hdr->hull_min().z + 0.9 * size.z;
		//	float width = ( size.x + size.y ) / 2.0f;

		model->m_origin.x = size.z * .6f;

		if ( hdr->GetNumAttachments() > 0 )
		{
			for (int i = 0; i < hdr->GetNumAttachments(); i++)
			{
				const mstudioattachment_t &attachment = hdr->pAttachment( i );
				int iBone = hdr->GetAttachmentBone( i );

				if ( Q_stricmp( attachment.pszName(), "eyes" ) )
					continue;

				mstudiobone_t *bone = hdr->pBone( iBone );
				if ( !bone )
					continue;

				matrix3x4_t boneToPose;
				MatrixInvert( bone->poseToBone, boneToPose );

				matrix3x4_t attachmentPoseToLocal;
				ConcatTransforms( boneToPose, attachment.local, attachmentPoseToLocal );

				Vector localSpaceEyePosition;
				VectorITransform( vec3_origin, attachmentPoseToLocal, localSpaceEyePosition );

//.........这里部分代码省略.........
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:101,代码来源:faceposer_models.cpp


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