本文整理汇总了C++中CBaseViewModel::SetPoseParameter方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseViewModel::SetPoseParameter方法的具体用法?C++ CBaseViewModel::SetPoseParameter怎么用?C++ CBaseViewModel::SetPoseParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseViewModel
的用法示例。
在下文中一共展示了CBaseViewModel::SetPoseParameter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ToBasePlayer
//-----------------------------------------------------------------------------
// Purpose: Handle grenade detonate in-air (even when no ammo is left)
//-----------------------------------------------------------------------------
void CWeaponAR2::ItemPostFrame( void )
{
// See if we need to fire off our secondary round
if ( m_bShotDelayed && gpGlobals->curtime > m_flDelayedFire )
{
DelayedAttack();
}
// Update our pose parameter for the vents
CBasePlayer *pOwner = ToBasePlayer( GetOwner() );
if ( pOwner )
{
CBaseViewModel *pVM = pOwner->GetViewModel();
if ( pVM )
{
if ( m_nVentPose == -1 )
{
m_nVentPose = pVM->LookupPoseParameter( "VentPoses" );
}
float flVentPose = RemapValClamped( m_nShotsFired, 0, 5, 0.0f, 1.0f );
pVM->SetPoseParameter( m_nVentPose, flVentPose );
}
}
BaseClass::ItemPostFrame();
}
示例2: Redraw
//-----------------------------------------------------------------------------
// Purpose: only called for local player
//-----------------------------------------------------------------------------
void C_TFWeaponBuilder::Redraw()
{
if ( m_iValidBuildPoseParam >= 0 )
{
CTFPlayer *pOwner = ToTFPlayer( GetOwner() );
if ( !pOwner )
return;
// Assuming here that our model is the same as our viewmodel's model!
CBaseViewModel *pViewModel = pOwner->GetViewModel(0);
if ( pViewModel )
{
float flPoseParamValue = pViewModel->GetPoseParameter( m_iValidBuildPoseParam );
C_BaseObject *pObj = m_hObjectBeingBuilt.Get();
if ( pObj && pObj->WasLastPlacementPosValid() )
{
// pose param approach 1.0
flPoseParamValue = Approach( 1.0, flPoseParamValue, 3.0 * gpGlobals->frametime );
}
else
{
// pose param approach 0.0
flPoseParamValue = Approach( 0.0, flPoseParamValue, 1.5 * gpGlobals->frametime );
}
pViewModel->SetPoseParameter( m_iValidBuildPoseParam, flPoseParamValue );
}
}
BaseClass::Redraw();
}
示例3: UpdateChargePoseParam
void CTFBonesaw::UpdateChargePoseParam( void )
{
CTFPlayer *pOwner = GetTFPlayerOwner();
if ( !pOwner )
return;
CWeaponMedigun *pMedigun = pOwner->GetMedigun();
if ( pMedigun )
{
SetPoseParameter( "syringe_charge_level", pMedigun->GetChargeLevel() );
CBaseViewModel *vm = pOwner->GetViewModel( m_nViewModelIndex );
if ( vm )
vm->SetPoseParameter( "syringe_charge_level", pMedigun->GetChargeLevel() );
}
}