本文整理汇总了C++中EHANDLE::SetTransmit方法的典型用法代码示例。如果您正苦于以下问题:C++ EHANDLE::SetTransmit方法的具体用法?C++ EHANDLE::SetTransmit怎么用?C++ EHANDLE::SetTransmit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EHANDLE
的用法示例。
在下文中一共展示了EHANDLE::SetTransmit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetTransmit
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CPointCommentaryNode::SetTransmit( CCheckTransmitInfo *pInfo, bool bAlways )
{
// Are we already marked for transmission?
if ( pInfo->m_pTransmitEdict->Get( entindex() ) )
return;
BaseClass::SetTransmit( pInfo, bAlways );
// Force our camera view position entity to be sent
if ( m_hViewTarget )
{
m_hViewTarget->SetTransmit( pInfo, bAlways );
}
if ( m_hViewPosition.Get() )
{
m_hViewPosition.Get()->SetTransmit( pInfo, bAlways );
}
if ( m_hViewPositionMover )
{
m_hViewPositionMover->SetTransmit( pInfo, bAlways );
}
}
示例2: SetTransmit
//-----------------------------------------------------------------------------
// Rules about which entities need to transmit along with me
//-----------------------------------------------------------------------------
void CAmbientGeneric::SetTransmit( CCheckTransmitInfo *pInfo, bool bAlways )
{
// Ambient generics never transmit; this is just a way for us to ensure
// the sound source gets transmitted; that's why we don't call pInfo->m_pTransmitEdict->Set
if ( !m_hSoundSource || m_hSoundSource == this || !m_fActive )
return;
// Don't bother sending the position of the source if we have to play everywhere
if ( FBitSet( m_spawnflags, SF_AMBIENT_SOUND_EVERYWHERE ) )
return;
Assert( pInfo->m_pClientEnt );
CBaseEntity *pClient = (CBaseEntity*)(pInfo->m_pClientEnt->GetUnknown());
if ( !pClient )
return;
// Send the sound source if he's close enough
if ( ( m_flMaxRadius < 0 ) || ( pClient->GetAbsOrigin().DistToSqr( m_hSoundSource->GetAbsOrigin() ) <= m_flMaxRadius * m_flMaxRadius ) )
{
m_hSoundSource->SetTransmit( pInfo, false );
}
}