本文整理汇总了C++中CTFPlayer::SetFOV方法的典型用法代码示例。如果您正苦于以下问题:C++ CTFPlayer::SetFOV方法的具体用法?C++ CTFPlayer::SetFOV怎么用?C++ CTFPlayer::SetFOV使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTFPlayer
的用法示例。
在下文中一共展示了CTFPlayer::SetFOV方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ZoomIn
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFWeaponBaseGun::ZoomIn( void )
{
// The the owning player.
CTFPlayer *pPlayer = ToTFPlayer( GetPlayerOwner() );
if ( !pPlayer )
return;
// Set the weapon zoom.
// TODO: The weapon fov should be gotten from the script file.
pPlayer->SetFOV( pPlayer, TF_WEAPON_ZOOM_FOV, 0.1f );
pPlayer->m_Shared.AddCond( TF_COND_ZOOMED );
}
示例2: ZoomOut
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFWeaponBaseGun::ZoomOut( void )
{
// The the owning player.
CTFPlayer *pPlayer = ToTFPlayer( GetPlayerOwner() );
if ( !pPlayer )
return;
if ( pPlayer->m_Shared.InCond( TF_COND_ZOOMED ) )
{
// Set the FOV to 0 set the default FOV.
pPlayer->SetFOV( pPlayer, 0, 0.1f );
pPlayer->m_Shared.RemoveCond( TF_COND_ZOOMED );
}
}
示例3: ZoomIn
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFHunterRifle::ZoomIn( void )
{
// Start aiming.
CTFPlayer *pPlayer = GetTFPlayerOwner();
if ( !pPlayer )
return;
if (pPlayer->GetAmmoCount(m_iPrimaryAmmoType) <= 0 || Clip1() <= 0)
return;
pPlayer->SetFOV(pPlayer, TF_WEAPON_ZOOM_FOV, 0.1f);
//BaseClass::ZoomIn();
pPlayer->m_Shared.AddCond( TF_COND_AIMING );
pPlayer->TeamFortress_SetSpeed();
}
示例4: ZoomOut
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFHunterRifle::ZoomOut( void )
{
//BaseClass::ZoomOut();
// Stop aiming
CTFPlayer *pPlayer = GetTFPlayerOwner();
if ( !pPlayer )
return;
pPlayer->SetFOV(pPlayer, 0, 0.1f);
pPlayer->m_Shared.RemoveCond( TF_COND_AIMING );
pPlayer->TeamFortress_SetSpeed();
// if we are thinking about zooming, cancel it
m_flUnzoomTime = -1;
m_flRezoomTime = -1;
m_bRezoomAfterShot = false;
m_flChargedSpread = TF_WEAPON_HUNTERRIFLE_SPREAD_MAX;
}
示例5: TeleporterThink
//.........这里部分代码省略.........
if ( pEnts[i]->IsSolid() && pEnts[i]->ShouldCollide( pTeleportingPlayer->GetCollisionGroup(), MASK_ALL ) &&
g_pGameRules->ShouldCollide( pTeleportingPlayer->GetCollisionGroup(), pEnts[i]->GetCollisionGroup() ) )
{
// We're going to teleport into something solid. Abort & destroy this exit.
bClear = false;
}
}
}
if ( bClear )
{
// Telefrag all enemy players we've found
for ( int player = 0; player < hPlayersToKill.Count(); player++ )
{
CTakeDamageInfo info( this, pTeleportingPlayer, 1000, DMG_CRUSH, TF_DMG_TELEFRAG );
hPlayersToKill[player]->TakeDamage( info );
}
pTeleportingPlayer->Teleport( &newPosition, &(GetAbsAngles()), &vec3_origin );
// Unzoom if we are a sniper zoomed!
if ( ( pTeleportingPlayer->GetPlayerClass()->GetClassIndex() == TF_CLASS_SNIPER ) &&
pTeleportingPlayer->m_Shared.InCond( TF_COND_AIMING ) )
{
CTFWeaponBase *pWpn = pTeleportingPlayer->GetActiveTFWeapon();
if ( pWpn && pWpn->GetWeaponID() == TF_WEAPON_SNIPERRIFLE )
{
CTFSniperRifle *pRifle = static_cast<CTFSniperRifle*>( pWpn );
pRifle->ToggleZoom();
}
}
pTeleportingPlayer->SetFOV( pTeleportingPlayer, 0, tf_teleporter_fov_time.GetFloat(), tf_teleporter_fov_start.GetInt() );
color32 fadeColor = {255,255,255,100};
UTIL_ScreenFade( pTeleportingPlayer, fadeColor, 0.25, 0.4, FFADE_IN );
}
else
{
DetonateObject();
}
}
SetState( TELEPORTER_STATE_RECEIVING_RELEASE );
m_flMyNextThink = gpGlobals->curtime + ( BUILD_TELEPORTER_FADEIN_TIME );
}
break;
case TELEPORTER_STATE_RECEIVING_RELEASE:
{
CTFPlayer *pTeleportingPlayer = m_hTeleportingPlayer.Get();
if ( pTeleportingPlayer )
{
int iTeam = GetBuilder() ? GetBuilder()->GetTeamNumber() : GetTeamNumber();
pTeleportingPlayer->m_Shared.SetTeleporterEffectColor( iTeam );
pTeleportingPlayer->TeleportEffect();
pTeleportingPlayer->m_Shared.RemoveCond( TF_COND_SELECTED_TO_TELEPORT );
if ( !m_bWasMapPlaced && GetBuilder() )
CTF_GameStats.Event_PlayerUsedTeleport( GetBuilder(), pTeleportingPlayer );
IGameEvent * event = gameeventmanager->CreateEvent( "player_teleported" );
示例6: TeleporterThink
//.........这里部分代码省略.........
if ( pEnts[i] == this )
continue;
// kill players and NPCs
if ( pEnts[i]->IsPlayer() || pEnts[i]->IsNPC() )
{
if ( !pTeleportingPlayer->InSameTeam(pEnts[i]) )
{
hPlayersToKill.AddToTail( pEnts[i] );
}
continue;
}
if ( pEnts[i]->IsBaseObject() )
continue;
// Solid entities will prevent a teleport
if ( pEnts[i]->IsSolid() && pEnts[i]->ShouldCollide( pTeleportingPlayer->GetCollisionGroup(), MASK_ALL ) &&
g_pGameRules->ShouldCollide( pTeleportingPlayer->GetCollisionGroup(), pEnts[i]->GetCollisionGroup() ) )
{
// We're going to teleport into something solid. Abort & destroy this exit.
bClear = false;
}
}
}
if ( bClear )
{
// Telefrag all enemy players we've found
for ( int player = 0; player < hPlayersToKill.Count(); player++ )
{
hPlayersToKill[player]->TakeDamage( CTakeDamageInfo( pTeleportingPlayer, this, 1000, DMG_CRUSH ) );
}
pTeleportingPlayer->Teleport( &newPosition, &(GetAbsAngles()), &vec3_origin );
// Unzoom if we are a sniper zoomed!
if ( ( pTeleportingPlayer->GetPlayerClass()->GetClassIndex() == TF_CLASS_SNIPER ) &&
pTeleportingPlayer->m_Shared.InCond( TF_COND_AIMING ) )
{
CTFWeaponBase *pWpn = pTeleportingPlayer->GetActiveTFWeapon();
if ( pWpn && pWpn->GetWeaponID() == TF_WEAPON_SNIPERRIFLE )
{
CTFSniperRifle *pRifle = static_cast<CTFSniperRifle*>( pWpn );
pRifle->ToggleZoom();
}
}
pTeleportingPlayer->SetFOV( pTeleportingPlayer, 0, tf_teleporter_fov_time.GetFloat(), tf_teleporter_fov_start.GetInt() );
color32 fadeColor = {255,255,255,100};
UTIL_ScreenFade( pTeleportingPlayer, fadeColor, 0.25, 0.4, FFADE_IN );
}
else
{
DetonateObject();
}
}
SetState( TELEPORTER_STATE_RECEIVING_RELEASE );
m_flMyNextThink = gpGlobals->curtime + ( BUILD_TELEPORTER_FADEIN_TIME );
}
break;
case TELEPORTER_STATE_RECEIVING_RELEASE:
{
CTFPlayer *pTeleportingPlayer = m_hTeleportingPlayer.Get();
if ( pTeleportingPlayer )
{
pTeleportingPlayer->TeleportEffect();
pTeleportingPlayer->m_Shared.RemoveCond( TF_COND_SELECTED_TO_TELEPORT );
CTF_GameStats.Event_PlayerUsedTeleport( GetBuilder(), pTeleportingPlayer );
pTeleportingPlayer->SpeakConceptIfAllowed( MP_CONCEPT_TELEPORTED );
}
// reset the pointers to the player now that we're done teleporting
SetTeleportingPlayer( NULL );
pMatch->SetTeleportingPlayer( NULL );
SetState( TELEPORTER_STATE_RECHARGING );
m_flMyNextThink = gpGlobals->curtime + ( TELEPORTER_RECHARGE_TIME );
}
break;
case TELEPORTER_STATE_RECHARGING:
// If we are finished recharging, go active
if ( gpGlobals->curtime > m_flRechargeTime )
{
SetState( TELEPORTER_STATE_READY );
EmitSound( "Building_Teleporter.Ready" );
}
break;
}
}