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


C++ EHANDLE::GetBaseAnimating方法代码示例

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


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

示例1: ClientThink

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void C_NPC_Puppet::ClientThink( void )
{
	if ( m_hAnimationTarget == NULL )
		return;

	C_BaseAnimating *pTarget = m_hAnimationTarget->GetBaseAnimating();
	if ( pTarget == NULL )
		return;

	int nTargetSequence = pTarget->GetSequence();
	const char *pSequenceName = pTarget->GetSequenceName( nTargetSequence );

	int nSequence = LookupSequence( pSequenceName );
	if ( nSequence >= 0 )
	{
		if ( nSequence != GetSequence() )
		{
			SetSequence( nSequence );
			UpdateVisibility();
		}

		SetCycle( pTarget->GetCycle() );
		SetPlaybackRate( pTarget->GetPlaybackRate() );	
	}
}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:28,代码来源:c_npc_puppet.cpp

示例2: AccumulateLayers

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void C_NPC_Puppet::AccumulateLayers( CStudioHdr *hdr, Vector pos[], Quaternion q[], float poseparam[], float currentTime, int boneMask )
{
	if ( m_hAnimationTarget == NULL )
		return;

	C_BaseAnimatingOverlay *pTarget = dynamic_cast<C_BaseAnimatingOverlay *>( m_hAnimationTarget->GetBaseAnimating() );
	if ( pTarget == NULL )
		return;

	// resort the layers
	int layer[MAX_OVERLAYS];
	int i;
	for (i = 0; i < MAX_OVERLAYS; i++)
	{
		layer[i] = MAX_OVERLAYS;
	}
	for (i = 0; i < pTarget->m_AnimOverlay.Count(); i++)
	{
		if (pTarget->m_AnimOverlay[i].m_nOrder < MAX_OVERLAYS)
		{
			layer[pTarget->m_AnimOverlay[i].m_nOrder] = i;
		}
	}

	int j;
	for (j = 0; j < MAX_OVERLAYS; j++)
	{
		i = layer[ j ];
		if (i < pTarget->m_AnimOverlay.Count())
		{
			float fWeight = pTarget->m_AnimOverlay[i].m_flWeight;

			if (fWeight > 0)
			{
				const char *pSequenceName = pTarget->GetSequenceName( pTarget->m_AnimOverlay[i].m_nSequence );

				int nSequence = LookupSequence( pSequenceName );
				if ( nSequence >= 0 )
				{
					float fCycle = pTarget->m_AnimOverlay[ i ].m_flCycle;

					fCycle = ClampCycle( fCycle, IsSequenceLooping( nSequence ) );

					if (fWeight > 1)
						fWeight = 1;

					AccumulatePose( hdr, NULL, pos, q, nSequence, fCycle, poseparam, boneMask, fWeight, currentTime );

#if _DEBUG
					if (Q_stristr( hdr->pszName(), r_sequence_debug.GetString()) != NULL)
					{
						DevMsgRT( "%6.2f : %30s : %5.3f : %4.2f : %1d\n", currentTime, hdr->pSeqdesc( nSequence ).pszLabel(), fCycle, fWeight, i );
					}
#endif

				}
			}
		}
	}
}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:63,代码来源:c_npc_puppet.cpp

示例3: BuildTransformations

//-----------------------------------------------------------------------------
// Purpose: We need to slam our position!
//-----------------------------------------------------------------------------
void C_NPC_Puppet::BuildTransformations( CStudioHdr *pStudioHdr, Vector *pos, Quaternion q[], const matrix3x4_t& cameraTransform, int boneMask, CBoneBitList &boneComputed )
{
	if ( m_hAnimationTarget && m_nTargetAttachment != -1 )
	{
		C_BaseAnimating *pTarget = m_hAnimationTarget->GetBaseAnimating();
		if ( pTarget )
		{
			matrix3x4_t matTarget;
			pTarget->GetAttachment( m_nTargetAttachment, matTarget );

			MatrixCopy( matTarget, GetBoneForWrite( 0 ) );
			boneComputed.ClearAll(); // FIXME: Why is this calculated already?
			boneComputed.MarkBone( 0 );
		}
	}

	// Call the baseclass
	BaseClass::BuildTransformations( pStudioHdr, pos, q, cameraTransform, boneMask, boneComputed );
}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:22,代码来源:c_npc_puppet.cpp


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