本文整理汇总了C++中C_TFPlayer::IsWeaponLowered方法的典型用法代码示例。如果您正苦于以下问题:C++ C_TFPlayer::IsWeaponLowered方法的具体用法?C++ C_TFPlayer::IsWeaponLowered怎么用?C++ C_TFPlayer::IsWeaponLowered使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C_TFPlayer
的用法示例。
在下文中一共展示了C_TFPlayer::IsWeaponLowered方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawModel
//-----------------------------------------------------------------------------
// Purpose: Don't render the weapon if its supposed to be lowered and we have
// finished the lowering animation
//-----------------------------------------------------------------------------
int CTFViewModel::DrawModel( int flags )
{
// Check for lowering the weapon
C_TFPlayer *pPlayer = C_TFPlayer::GetLocalTFPlayer();
Assert( pPlayer );
bool bLowered = pPlayer->IsWeaponLowered();
if ( bLowered && fabs( m_vLoweredWeaponOffset.x - cl_gunlowerangle.GetFloat() ) < 0.1 )
{
// fully lowered, stop drawing
return 1;
}
C_TFPlayer *pLocalPlayer = C_TFPlayer::GetLocalTFPlayer();
if ( pLocalPlayer && pLocalPlayer->GetObserverMode() == OBS_MODE_IN_EYE &&
pLocalPlayer->GetObserverTarget() && pLocalPlayer->GetObserverTarget()->IsPlayer() )
{
pPlayer = ToTFPlayer( pLocalPlayer->GetObserverTarget() );
if ( pPlayer != GetOwner() )
return 0;
}
if ( pPlayer->IsAlive() == false )
{
return 0;
}
return BaseClass::DrawModel( flags );
}
示例2: CalcViewModelView
void CTFViewModel::CalcViewModelView( CBasePlayer *owner, const Vector& eyePosition, const QAngle& eyeAngles )
{
#if defined( CLIENT_DLL )
Vector vecNewOrigin = eyePosition;
QAngle vecNewAngles = eyeAngles;
// Check for lowering the weapon
C_TFPlayer *pPlayer = ToTFPlayer( owner );
Assert( pPlayer );
bool bLowered = pPlayer->IsWeaponLowered();
QAngle vecLoweredAngles(0,0,0);
m_vLoweredWeaponOffset.x = Approach( bLowered ? cl_gunlowerangle.GetFloat() : 0, m_vLoweredWeaponOffset.x, cl_gunlowerspeed.GetFloat() );
vecLoweredAngles.x += m_vLoweredWeaponOffset.x;
vecNewAngles += vecLoweredAngles;
// Viewmodel offset
Vector forward, right, up;
AngleVectors(eyeAngles, &forward, &right, &up);
vecNewOrigin += forward*v_viewmodel_offset_x.GetFloat() + right*v_viewmodel_offset_y.GetFloat() + up*v_viewmodel_offset_z.GetFloat();
if (owner->GetActiveWeapon())
ToTFPlayer(owner)->GetActiveTFWeapon()->UpdateViewModel();
BaseClass::CalcViewModelView( owner, vecNewOrigin, vecNewAngles );
#endif
}