您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ EntityFromEntityHandle函数代码示例

51自学网 2021-06-01 20:38:26
  C++
这篇教程C++ EntityFromEntityHandle函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中EntityFromEntityHandle函数的典型用法代码示例。如果您正苦于以下问题:C++ EntityFromEntityHandle函数的具体用法?C++ EntityFromEntityHandle怎么用?C++ EntityFromEntityHandle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了EntityFromEntityHandle函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: EntityFromEntityHandle

//-----------------------------------------------------------------------------// Purpose:// Input  : *pHandleEntity -//			contentsMask -// Output : Returns true on success, false on failure.//-----------------------------------------------------------------------------bool CASW_Trace_Filter_Doors::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ){    if ( !StandardFilterRules( pHandleEntity, contentsMask ) )        return false;    // Don't test if the game code tells us we should ignore this collision...    CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity );    const CBaseEntity *pEntPass = EntityFromEntityHandle( m_pPassEnt );    // don't hurt ourself    if ( pEntPass == pEntity )        return false;    if ( !pEntity || pEntity->Classify() != CLASS_ASW_DOOR )        return false;    CASW_Door *pDoor = assert_cast<CASW_Door*>( pEntity );    if ( !pDoor )        return false;    if ( m_bRequireLockedOrSealed )    {        if ( pDoor->GetSealAmount() > 0 || !pDoor->IsAutoOpen() )        {            return true;        }        else        {            return false;        }    }    return true;}
开发者ID:Cre3per,项目名称:hl2sdk-csgo,代码行数:40,


示例2: EntityFromEntityHandle

//-----------------------------------------------------------------------------// The trace filter!//-----------------------------------------------------------------------------bool CTraceFilterSimple::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ){    if(m_pPassEnt)    {        // Don't test if the game code tells us we should ignore this collision...        CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity );        CBaseEntity *pPass = EntityFromEntityHandle( (CBaseEntity *)m_pPassEnt );        if(VFuncs::entindex(pEntity) != VFuncs::entindex(pPass))            return true;    }    return false;}
开发者ID:kila58,项目名称:sourceop,代码行数:16,


示例3: StandardFilterRules

//-----------------------------------------------------------------------------// A standard filter to be applied to just about everything.//-----------------------------------------------------------------------------bool StandardFilterRules( IHandleEntity *pHandleEntity, int fContentsMask ){	CBaseEntity *pCollide = EntityFromEntityHandle( pHandleEntity );	// Static prop case...	if ( !pCollide )		return true;	SolidType_t solid = pCollide->GetSolid();	const model_t *pModel = pCollide->GetModel();	if ( ( modelinfo->GetModelType( pModel ) != mod_brush ) || (solid != SOLID_BSP && solid != SOLID_VPHYSICS) )	{		if ( (fContentsMask & CONTENTS_MONSTER) == 0 )			return false;	}	// This code is used to cull out tests against see-thru entities	if ( !(fContentsMask & CONTENTS_WINDOW) && pCollide->IsTransparent() )		return false;	// FIXME: this is to skip BSP models that are entities that can be 	// potentially moved/deleted, similar to a monster but doors don't seem to 	// be flagged as monsters	// FIXME: the FL_WORLDBRUSH looked promising, but it needs to be set on 	// everything that's actually a worldbrush and it currently isn't	if ( !(fContentsMask & CONTENTS_MOVEABLE) && (pCollide->GetMoveType() == MOVETYPE_PUSH))// !(touch->flags & FL_WORLDBRUSH) )		return false;	return true;}
开发者ID:P1x3lF3v3r,项目名称:Estranged-Act-1,代码行数:34,


示例4: EntityFromEntityHandle

//-----------------------------------------------------------------------------// The trace filter!//-----------------------------------------------------------------------------bool CTraceFilterSimple::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ){	if ( !StandardFilterRules( pHandleEntity, contentsMask ) )		return false;	if ( m_pPassEnt )	{		if ( !PassServerEntityFilter( pHandleEntity, m_pPassEnt ) )		{			return false;		}	}	// Don't test if the game code tells us we should ignore this collision...	CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity );	if ( !pEntity )		return false;	if ( !pEntity->ShouldCollide( m_collisionGroup, contentsMask ) )		return false;	if ( pEntity && !g_pGameRules->ShouldCollide( m_collisionGroup, pEntity->GetCollisionGroup() ) )		return false;	if ( m_pExtraShouldHitCheckFunction &&		(! ( m_pExtraShouldHitCheckFunction( pHandleEntity, contentsMask ) ) ) )		return false;	return true;}
开发者ID:P1x3lF3v3r,项目名称:Estranged-Act-1,代码行数:30,


示例5: ShouldHitEntity

	bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask )	{		CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity );		if ( !pEntity )			return false;		// Check parents against each other		// NOTE: Don't let siblings/parents collide.		if ( UTIL_EntityHasMatchingRootParent( m_pRootParent, pEntity ) )			return false;		if ( m_checkHash )		{			if ( g_EntityCollisionHash->IsObjectPairInHash( m_pEntity, pEntity ) )				return false;		}#ifndef CLIENT_DLL		if ( m_pEntity->IsNPC() )		{			if ( NPC_CheckBrushExclude( m_pEntity, pEntity ) )				 return false;		}#endif		return BaseClass::ShouldHitEntity( pHandleEntity, contentsMask );	}
开发者ID:P1x3lF3v3r,项目名称:Estranged-Act-1,代码行数:28,


示例6: Assert

bool CASWTraceFilterShot::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ){	Assert( pHandleEntity );	if ( !PassServerEntityFilter( pHandleEntity, m_pPassEnt2 ) )		return false;		CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity );	// don't collide with other projectiles	if ( dynamic_cast<CASW_Flamer_Projectile*>( pEntity ) != NULL )		return false;	if ( dynamic_cast<CASW_Extinguisher_Projectile*>( pEntity ) != NULL )		return false;	if ( pEntity && pEntity->Classify() == CLASS_ASW_MARINE )	{		if ( m_bSkipMarines )			return false;		CASW_Marine *pMarine = assert_cast<CASW_Marine*>( pEntity );		if ( m_bSkipRollingMarines && pMarine->GetCurrentMeleeAttack() && pMarine->GetCurrentMeleeAttack()->m_nAttackID == CASW_Melee_System::s_nRollAttackID )			return false;		if ( m_bSkipMarinesReflectingProjectiles && pMarine->IsReflectingProjectiles() )			return false;	}	if ( m_bSkipAliens && pEntity && IsAlienClass( pEntity->Classify() ) )		return false;	return BaseClass::ShouldHitEntity( pHandleEntity, contentsMask );}
开发者ID:Cre3per,项目名称:hl2sdk-csgo,代码行数:33,


示例7: ShouldHitEntity

	virtual bool ShouldHitEntity( IHandleEntity *pServerEntity, int contentsMask )	{		static const char *ppszIgnoredClasses[] = 		{			"weapon_*",			"item_*",			"prop_ragdoll",			"prop_dynamic",			"prop_static",			"prop_physics",			"npc_bullseye",  // Tracker 15335		};		CBaseEntity *pEntity = EntityFromEntityHandle( pServerEntity );		// Tracker 15335:  Never impact decals against entities which are not rendering, either.		if ( pEntity->IsEffectActive( EF_NODRAW ) )			return false;		for ( int i = 0; i < ARRAYSIZE(ppszIgnoredClasses); i++ )		{			if ( pEntity->ClassMatches( ppszIgnoredClasses[i] ) )				return false;		}		if ( modelinfo->GetModelType( pEntity->GetModel() ) != mod_brush )			return false;		return CTraceFilterSimple::ShouldHitEntity( pServerEntity, contentsMask );	}
开发者ID:DeadFuze,项目名称:swarm-sdk,代码行数:30,


示例8: ShouldHitEntity

	virtual bool ShouldHitEntity( IHandleEntity *pServerEntity, int contentsMask )	{		CBaseEntity *pEntity = EntityFromEntityHandle( pServerEntity );		if ( pEntity && pEntity->IsBaseObject() )			return false;		return BaseClass::ShouldHitEntity( pServerEntity, contentsMask );	}
开发者ID:Deathreus,项目名称:TF2Classic,代码行数:9,


示例9: DETOUR_DECL_MEMBER

	DETOUR_DECL_MEMBER(bool, CTraceFilterDeflection_ShouldHitEntity, IHandleEntity *pHandleEntity, int contentsMask)	{		if (cvar_fix.GetBool()) {			CBaseEntity *pEntity = EntityFromEntityHandle(pHandleEntity);			if (pEntity == nullptr) return false;						if (pEntity->IsPlayer()) return false;		}				return DETOUR_MEMBER_CALL(CTraceFilterDeflection_ShouldHitEntity)(pHandleEntity, contentsMask);	}
开发者ID:sigsegv-mvm,项目名称:sigsegv-mvm,代码行数:11,


示例10: ShouldHitEntity

	virtual bool ShouldHitEntity( IHandleEntity *pServerEntity, int contentsMask )	{		CBaseEntity *pEntity = EntityFromEntityHandle( pServerEntity );		if ( pEntity->IsPlayer() && pEntity->GetTeamNumber() == m_iIgnoreTeam )		{			return false;		}		return true;	}
开发者ID:Navton,项目名称:TF2Classic,代码行数:11,


示例11: ShouldHitEntity

	bool ShouldHitEntity( IHandleEntity *pServerEntity, int contentsMask )	{		CBaseEntity *pEntity = EntityFromEntityHandle( pServerEntity );		if ( pEntity )		{			if ( pEntity->IsPlayer() || pEntity->MyNPCPointer() )				return true;		}		return false;	}
开发者ID:xxauroraxx,项目名称:Source.Python,代码行数:11,


示例12: ShouldHitEntity

	virtual bool ShouldHitEntity( IHandleEntity *pServerEntity, int contentsMask )	{		C_BaseEntity *pEntity = EntityFromEntityHandle( pServerEntity );		if( pEntity &&			( dynamic_cast<C_BaseViewModel *>( pEntity ) != NULL ) ||			( dynamic_cast<C_BasePlayer *>( pEntity ) != NULL ) )		{			return false;		}		else		{			return true;		}	}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:14,


示例13: PassServerEntityFilter

//-----------------------------------------------------------------------------//// Shared client/server trace filter code////-----------------------------------------------------------------------------bool PassServerEntityFilter( const IHandleEntity *pTouch, const IHandleEntity *pPass ) {	if ( !pPass )		return true;	if ( pTouch == pPass )		return false;	const CBaseEntity *pEntTouch = EntityFromEntityHandle( pTouch );	const CBaseEntity *pEntPass = EntityFromEntityHandle( pPass );	if ( !pEntTouch || !pEntPass )		return true;	// don't clip against own missiles	if ( pEntTouch->GetOwnerEntity() == pEntPass )		return false;		// don't clip against owner	if ( pEntPass->GetOwnerEntity() == pEntTouch )		return false;		return true;}
开发者ID:P1x3lF3v3r,项目名称:Estranged-Act-1,代码行数:29,


示例14: EntityFromEntityHandle

//-----------------------------------------------------------------------------// Purpose: // Input  : *pHandleEntity - //			contentsMask - // Output : Returns true on success, false on failure.//-----------------------------------------------------------------------------bool CASW_Trace_Filter_Door_Crush::ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask ){	if ( !StandardFilterRules( pHandleEntity, contentsMask ) )		return false;	if ( !PassServerEntityFilter( pHandleEntity, m_pPassEnt ) )		return false;	// Don't test if the game code tells us we should ignore this collision...	CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity );		if ( pEntity )	{		//Msg("%f CASW_Trace_Filter_Door_Crush::ShouldHitEntity %s/n", gpGlobals->curtime, pEntity->GetClassname());		if ( !pEntity->ShouldCollide( m_collisionGroup, contentsMask ) )			return false;				if ( !g_pGameRules->ShouldCollide( m_collisionGroup, pEntity->GetCollisionGroup() ) )			return false;		if ( pEntity->Classify() == CLASS_ASW_DOOR )			return false;		if ( pEntity->m_takedamage == DAMAGE_NO )			return false;		// Translate the vehicle into its driver for damage		if ( pEntity->GetServerVehicle() != NULL )		{			CBaseEntity *pDriver = pEntity->GetServerVehicle()->GetPassenger();			if ( pDriver != NULL )			{				pEntity = pDriver;			}		}		Vector	attackDir = pEntity->WorldSpaceCenter() - m_dmgInfo->GetAttacker()->WorldSpaceCenter();		VectorNormalize( attackDir );			pEntity->TakeDamage( *m_dmgInfo );		//CalculateMeleeDamageForce( &info, attackDir, info.GetAttacker()->WorldSpaceCenter(), m_flForceScale );		return true;	}	return false;}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:54,


示例15: ShouldHitEntity

		virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask )		{			if ( !PassServerEntityFilter( pHandleEntity, m_pPassEnt ) )				return false;			CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity );			if ( pEntity )			{				if ( g_pGameRules->ShouldCollide( m_collisionGroupAlreadyChecked, pEntity->GetCollisionGroup() ) )					return false;				if ( g_pGameRules->ShouldCollide( m_newCollisionGroup, pEntity->GetCollisionGroup() ) )					return true;			}			return false;		}
开发者ID:Randdalf,项目名称:bliink,代码行数:16,


示例16: ShouldHitEntity

	virtual bool ShouldHitEntity( IHandleEntity *pServerEntity, int contentsMask )	{		CBaseEntity *pEntity = EntityFromEntityHandle( pServerEntity );		if ( pEntity->IsPlayer() )		{			if ( pEntity != GetPassEntity() )			{				return false;			}			else				return true;		}		return true;	}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:16,


示例17: ShouldHitEntity

	virtual bool ShouldHitEntity( IHandleEntity *pHandleEntity, int contentsMask )	{		// Only skip ourselves (not things we own)		if ( pHandleEntity == m_pTraceOwner )			return false;		// Get the entity referenced by this handle		CBaseEntity *pEntity = EntityFromEntityHandle( pHandleEntity );		if ( pEntity == NULL )			return false;		// Handle grate entities differently		if ( HasContentsGrate( pEntity ) )		{			// See if it's a grabbable physics prop			CPhysicsProp *pPhysProp = dynamic_cast<CPhysicsProp *>(pEntity);			if ( pPhysProp != NULL )				return pPhysProp->CanBePickedUpByPhyscannon();			// See if it's a grabbable physics prop			if ( FClassnameIs( pEntity, "prop_physics" ) )			{				CPhysicsProp *pPhysProp = dynamic_cast<CPhysicsProp *>(pEntity);				if ( pPhysProp != NULL )					return pPhysProp->CanBePickedUpByPhyscannon();				// Somehow had a classname that didn't match the class!				Assert(0);			}			else if ( FClassnameIs( pEntity, "func_physbox" ) )			{				// Must be a moveable physbox				CPhysBox *pPhysBox = dynamic_cast<CPhysBox *>(pEntity);				if ( pPhysBox )					return pPhysBox->CanBePickedUpByPhyscannon();				// Somehow had a classname that didn't match the class!				Assert(0);			}			// Don't bother with any other sort of grated entity			return false;		}		// Use the default rules		return BaseClass::ShouldHitEntity( pHandleEntity, contentsMask );	}
开发者ID:gamenew09,项目名称:SourceSDK2010,代码行数:47,


示例18: ShouldHitEntity

	virtual bool ShouldHitEntity( IHandleEntity *pServerEntity, int contentsMask )	{		// Test against the vehicle too?		// FLASHLIGHTFIXME: how do you know that you are actually inside of the vehicle?		C_BaseEntity *pEntity = EntityFromEntityHandle( pServerEntity );		if ( !pEntity )			return true;		if ( ( dynamic_cast<C_BaseViewModel *>( pEntity ) != NULL ) ||			 ( dynamic_cast<C_BasePlayer *>( pEntity ) != NULL ) ||			 pEntity->GetCollisionGroup() == COLLISION_GROUP_DEBRIS ||			 pEntity->GetCollisionGroup() == COLLISION_GROUP_INTERACTIVE_DEBRIS )		{			return false;		}		return true;	}
开发者ID:TheHolyChicken,项目名称:halflife2-vr,代码行数:18,



注:本文中的EntityFromEntityHandle函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ EntityText函数代码示例
C++ EnterPhaseGround函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。