本文整理汇总了C++中CBaseViewModel::GetRefEHandle方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseViewModel::GetRefEHandle方法的具体用法?C++ CBaseViewModel::GetRefEHandle怎么用?C++ CBaseViewModel::GetRefEHandle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseViewModel
的用法示例。
在下文中一共展示了CBaseViewModel::GetRefEHandle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoLoadEffect
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CWeaponCrossbow::DoLoadEffect()
{
SetSkin(BOLT_SKIN_GLOW);
CBasePlayer *pOwner = ToBasePlayer( GetOwner() );
if ( !pOwner )
return;
CEffectData data;
data.m_nAttachmentIndex = 1;
#ifdef GAME_DLL
data.m_nEntIndex = entindex();
CPASFilter filter(data.m_vOrigin);
filter.RemoveRecipient(pOwner);
te->DispatchEffect(filter, 0.0, data.m_vOrigin, "CrossbowLoad", data);
#else
CBaseViewModel *pViewModel = pOwner->GetViewModel();
if ( pViewModel != NULL )
{
if ( ::input->CAM_IsThirdPerson() )
data.m_hEntity = pViewModel->GetRefEHandle();
else
data.m_hEntity = GetRefEHandle();
DispatchEffect("CrossbowLoad", data);
}
#endif
//Tony; switched this up, always attach it to the weapon, not the view model!!
#ifndef CLIENT_DLL
CSprite *pBlast = CSprite::SpriteCreate( CROSSBOW_GLOW_SPRITE2, GetAbsOrigin(), false );
if ( pBlast )
{
pBlast->SetAttachment(this, 1);
pBlast->SetTransparency(kRenderTransAdd, 255, 255, 255, 255, kRenderFxNone );
pBlast->SetBrightness(128);
pBlast->SetScale(0.2f);
pBlast->FadeOutFromSpawn();
}
#endif
}
示例2: DoLoadEffect
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CWeaponCrossbow::DoLoadEffect( void )
{
SetSkin( BOLT_SKIN_GLOW );
CBasePlayer *pOwner = ToBasePlayer( GetOwner() );
if ( pOwner == NULL )
return;
//Tony; change this up a bit; on the server, dispatch an effect but don't send it to the client who fires
//on the client, create an effect either in the view model, or on the world model if first person.
CEffectData data;
data.m_nAttachmentIndex = 1;
data.m_vOrigin = pOwner->GetAbsOrigin();
CPASFilter filter( data.m_vOrigin );
#ifdef GAME_DLL
filter.RemoveRecipient( pOwner );
data.m_nEntIndex = entindex();
#else
CBaseViewModel *pViewModel = pOwner->GetViewModel();
if ( ShouldDrawUsingViewModel() && pViewModel != NULL )
data.m_hEntity = pViewModel->GetRefEHandle();
else
data.m_hEntity = GetRefEHandle();
#endif
DispatchEffect( "CrossbowLoad", data, filter );
#ifndef CLIENT_DLL
CSprite *pBlast = CSprite::SpriteCreate( CROSSBOW_GLOW_SPRITE2, GetAbsOrigin(), false );
if ( pBlast )
{
pBlast->SetAttachment( this, 1 );
pBlast->SetTransparency( kRenderTransAdd, 255, 255, 255, 255, kRenderFxNone );
pBlast->SetBrightness( 128 );
pBlast->SetScale( 0.2f );
pBlast->FadeOutFromSpawn();
}
#endif
}
示例3: DoLoadEffect
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CWeaponGrapple::DoLoadEffect(void)
{
SetSkin(BOLT_SKIN_GLOW);
CBasePlayer *pOwner = ToBasePlayer(GetOwner());
if (pOwner == NULL)
return;
CBaseViewModel *pViewModel = pOwner->GetViewModel();
if (pViewModel == NULL)
return;
CEffectData data;
#ifdef CLIENT_DLL
data.m_hEntity = pViewModel->GetRefEHandle();
#else
data.m_nEntIndex = pViewModel->entindex();
#endif
data.m_nAttachmentIndex = 1;
DispatchEffect("CrossbowLoad", data);
#ifndef CLIENT_DLL
CSprite *pBlast = CSprite::SpriteCreate(CROSSBOW_GLOW_SPRITE2, GetAbsOrigin(), false);
if (pBlast)
{
pBlast->SetAttachment(pOwner->GetViewModel(), 1);
pBlast->SetTransparency(kRenderTransAdd, 255, 255, 255, 255, kRenderFxNone);
pBlast->SetBrightness(128);
pBlast->SetScale(0.2f);
pBlast->FadeOutFromSpawn();
}
#endif
}