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

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

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

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

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

示例1: VPhysicsInitShadow

//-----------------------------------------------------------------------------bool CBaseDoor::CreateVPhysics( ){	if ( !FClassnameIs( this, "func_water" ) )	{		//normal door		// NOTE: Create this even when the door is not solid to support constraints.		VPhysicsInitShadow( false, false );	}	else	{		// special contents		AddSolidFlags( FSOLID_VOLUME_CONTENTS );		SETBITS( m_spawnflags, SF_DOOR_SILENT );	// water is silent for now		IPhysicsObject *pPhysics = VPhysicsInitShadow( false, false );		fluidparams_t fluid;				Assert( CollisionProp()->GetCollisionAngles() == vec3_angle );		fluid.damping = 0.01f;		fluid.surfacePlane[0] = 0;		fluid.surfacePlane[1] = 0;		fluid.surfacePlane[2] = 1;		fluid.surfacePlane[3] = CollisionProp()->GetCollisionOrigin().z + CollisionProp()->OBBMaxs().z - 1;		fluid.currentVelocity.Init(0,0,0);		fluid.torqueFactor = 0.1f;		fluid.viscosityFactor = 0.01f;		fluid.pGameData = static_cast<void *>(this);				//FIXME: Currently there's no way to specify that you want slime		fluid.contents = CONTENTS_WATER;				physenv->CreateFluidController( pPhysics, &fluid );	}	return true;}
开发者ID:KyleGospo,项目名称:City-17-Episode-One-Source,代码行数:36,


示例2: CalcDamageForceVector

void QUA_helicopter::Event_Killed( const CTakeDamageInfo &info ){	//m_lifeState=LIFE_DYING;	// Calculate death force	m_vecTotalBulletForce = CalcDamageForceVector( info );	CBasePlayer *pPlayer = m_hPlayer;	if ( pPlayer )		 {		pPlayer->LeaveVehicle(); // Force exit vehicle		CBaseEntity *pAPC=this->GetBaseEntity();		CTakeDamageInfo playerinfo;			if (info.GetAttacker()==pAPC && info.GetInflictor()==pAPC) {				playerinfo.SetAttacker(pPlayer);				playerinfo.SetInflictor(pPlayer);				playerinfo.SetDamage(10000);				playerinfo.SetDamageType(DMG_BLAST);			} else {				playerinfo.SetAttacker(info.GetAttacker());				playerinfo.SetInflictor(info.GetInflictor());				playerinfo.SetDamage(10000);				playerinfo.SetDamageType(DMG_BLAST);			}		playerinfo.SetDamagePosition( pPlayer->WorldSpaceCenter() );		playerinfo.SetDamageForce( Vector(0,0,-1) );		pPlayer->TakeDamage( playerinfo );		m_hPlayer = NULL;		 }	m_OnDeath.FireOutput( info.GetAttacker(), this );	//StopSmoking();	Vector vecAbsMins, vecAbsMaxs;	CollisionProp()->WorldSpaceAABB( &vecAbsMins, &vecAbsMaxs );	Vector vecNormalizedMins, vecNormalizedMaxs;	CollisionProp()->WorldToNormalizedSpace( vecAbsMins, &vecNormalizedMins );	CollisionProp()->WorldToNormalizedSpace( vecAbsMaxs, &vecNormalizedMaxs );	Vector vecAbsPoint;	CPASFilter filter( GetAbsOrigin() );	for (int i = 0; i < 5; i++)	{		CollisionProp()->RandomPointInBounds( vecNormalizedMins, vecNormalizedMaxs, &vecAbsPoint );		te->Explosion( filter, random->RandomFloat( 0.0, 1.0 ),	&vecAbsPoint, 			g_sModelIndexFireball, random->RandomInt( 4, 10 ), 			random->RandomInt( 8, 15 ), 			( i < 2 ) ? TE_EXPLFLAG_NODLIGHTS : TE_EXPLFLAG_NOPARTICLES | TE_EXPLFLAG_NOFIREBALLSMOKE | TE_EXPLFLAG_NODLIGHTS,			100, 0 );	}	// Aqui destruiremos todo	StopLoopingSounds();	BecomeRagdoll( info, m_vecTotalBulletForce );	UTIL_ScreenShake( vecAbsPoint, 25.0, 150.0, 1.0, 750.0f, SHAKE_START );	CreateCorpse();		//BecomeRagdoll( info, m_vecTotalBulletForce );    //BecomeRagdollOnClient(m_vecTotalBulletForce);	//Dissolve(NULL, gpGlobals->curtime, false, ENTITY_DISSOLVE_NORMAL);}
开发者ID:WorldGamers,项目名称:Mobile-Forces-Source,代码行数:60,


示例3: GetAbsOrigin

bool CASW_Radiation_Volume::RadTouching(CBaseEntity *pEnt){	if (!pEnt || !pEnt->CollisionProp() || !CollisionProp())		return false;	Vector vecNearest;	pEnt->CollisionProp()->CalcNearestPoint( GetAbsOrigin(), &vecNearest );	return CollisionProp()->IsPointInBounds(vecNearest);}
开发者ID:Cre3per,项目名称:hl2sdk-csgo,代码行数:9,


示例4: StudioFrameAdvance

//=========================================================// TurretDeath - I die as I have lived, beyond my means//=========================================================void CNPC_BaseTurret::TurretDeath(void){	StudioFrameAdvance( );	SetNextThink( gpGlobals->curtime + 0.1 );	if (m_lifeState != LIFE_DEAD)	{		m_lifeState = LIFE_DEAD;		CPASAttenuationFilter filter( this );		EmitSound( filter, entindex(), "Turret.Die" );			StopSound( entindex(), "Turret.Spinup" );		if (m_iOrientation == TURRET_ORIENTATION_FLOOR)			m_vecGoalAngles.x = -14;		else			m_vecGoalAngles.x = 90;//-90;		SetTurretAnim(TURRET_ANIM_DIE); 		EyeOn( );		}	EyeOff( );	if (m_flDamageTime + random->RandomFloat( 0, 2 ) > gpGlobals->curtime)	{		// lots of smoke		Vector pos;		CollisionProp()->RandomPointInBounds( vec3_origin, Vector( 1, 1, 1 ), &pos );		pos.z = CollisionProp()->GetCollisionOrigin().z;				CBroadcastRecipientFilter filter;		te->Smoke( filter, 0.0, &pos,			g_sModelIndexSmoke,			2.5,			10 );	}		if (m_flDamageTime + random->RandomFloat( 0, 5 ) > gpGlobals->curtime)	{		Vector vecSrc;		CollisionProp()->RandomPointInBounds( vec3_origin, Vector( 1, 1, 1 ), &vecSrc );		g_pEffects->Sparks( vecSrc );	}	if (IsSequenceFinished() && !MoveTurret() && m_flDamageTime + 5 < gpGlobals->curtime)	{		m_flPlaybackRate = 0;		SetThink( NULL );	}}
开发者ID:hitmen047,项目名称:TF2HLCoop,代码行数:56,


示例5: IRotateAABB

void C_ServerRagdoll::GetRenderBounds( Vector& theMins, Vector& theMaxs ){    if( !CollisionProp()->IsBoundsDefinedInEntitySpace() )    {        IRotateAABB( EntityToWorldTransform(), CollisionProp()->OBBMins(), CollisionProp()->OBBMaxs(), theMins, theMaxs );    }    else    {        theMins = CollisionProp()->OBBMins();        theMaxs = CollisionProp()->OBBMaxs();    }}
开发者ID:BoXorz,项目名称:MSS,代码行数:12,


示例6: UTIL_Remove

//-----------------------------------------------------------------------------// Purpose: //-----------------------------------------------------------------------------void CItem::Spawn( void ){	if ( g_pGameRules->IsAllowedToSpawn( this ) == false )	{		UTIL_Remove( this );		return;	}	SetMoveType( MOVETYPE_FLYGRAVITY );	SetSolid( SOLID_BBOX );	SetBlocksLOS( false );	AddEFlags( EFL_NO_ROTORWASH_PUSH );		if( IsXbox() )	{		AddEffects( EF_ITEM_BLINK );	}	// This will make them not collide with the player, but will collide	// against other items + weapons	SetCollisionGroup( COLLISION_GROUP_WEAPON );	CollisionProp()->UseTriggerBounds( true, ITEM_PICKUP_BOX_BLOAT );	SetTouch(&CItem::ItemTouch);	if ( CreateItemVPhysicsObject() == false )		return;	m_takedamage = DAMAGE_EVENTS_ONLY;#if defined( HL2MP )	SetThink( &CItem::FallThink );	SetNextThink( gpGlobals->curtime + 0.1f );#endif}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:38,


示例7: SetSolid

//-----------------------------------------------------------------------------// Purpose: //-----------------------------------------------------------------------------bool C_FuncPhysicsRespawnZone::Initialize( void ){	if ( InitializeAsClientEntity( STRING(GetModelName()), RENDER_GROUP_OPAQUE_ENTITY ) == false )		return false;	SetSolid( SOLID_BSP );		AddSolidFlags( FSOLID_NOT_SOLID );	AddSolidFlags( FSOLID_TRIGGER );		SetMoveType( MOVETYPE_NONE );	const model_t *mod = GetModel();	if ( mod )	{		Vector mins, maxs;		modelinfo->GetModelBounds( mod, mins, maxs );		SetCollisionBounds( mins, maxs );	}	Spawn();	AddEffects( EF_NODRAW );	UpdatePartitionListEntry();	CollisionProp()->UpdatePartition();	UpdateVisibility();	SetNextClientThink( gpGlobals->curtime + (cl_phys_props_respawnrate.GetFloat() * RandomFloat(1.0,1.1)) );	return true;}
开发者ID:Au-heppa,项目名称:source-sdk-2013,代码行数:35,


示例8: CollisionProp

void CSDKPlayer::SDKThrowWeapon( CWeaponSDKBase *pWeapon, const Vector &vecForward, const QAngle &vecAngles, float flDiameter  ){	Vector vecOrigin;	CollisionProp()->RandomPointInBounds( Vector( 0.5f, 0.5f, 0.5f ), Vector( 0.5f, 0.5f, 1.0f ), &vecOrigin );	// Nowhere in particular; just drop it.	Vector vecThrow;	SDKThrowWeaponDir( pWeapon, vecForward, &vecThrow );	Vector vecOffsetOrigin;	VectorMA( vecOrigin, flDiameter, vecThrow, vecOffsetOrigin );	trace_t	tr;	UTIL_TraceLine( vecOrigin, vecOffsetOrigin, MASK_SOLID_BRUSHONLY, this, COLLISION_GROUP_NONE, &tr );			if ( tr.startsolid || tr.allsolid || ( tr.fraction < 1.0f && tr.m_pEnt != pWeapon ) )	{		//FIXME: Throw towards a known safe spot?		vecThrow.Negate();		VectorMA( vecOrigin, flDiameter, vecThrow, vecOffsetOrigin );	}	vecThrow *= random->RandomFloat( 150.0f, 240.0f );	pWeapon->SetAbsOrigin( vecOrigin );	pWeapon->SetAbsAngles( vecAngles );	pWeapon->Drop( vecThrow );	pWeapon->SetRemoveable( false );	Weapon_Detach( pWeapon );	pWeapon->SetDieThink( true );}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:32,


示例9: Msg

// set the mine up for explodingvoid CASW_Mine::Prime(){	if (asw_debug_mine.GetBool())		Msg("Mine primed!/n");	EmitSound("ASW_Mine.Lay");	SetSolid( SOLID_BBOX );	float boxWidth = 150;	UTIL_SetSize(this, Vector(-boxWidth,-boxWidth,-boxWidth),Vector(boxWidth,boxWidth,boxWidth * 2));	SetCollisionGroup( ASW_COLLISION_GROUP_PASSABLE );	CollisionProp()->UseTriggerBounds( true, 24 );	AddSolidFlags(FSOLID_TRIGGER);	AddSolidFlags(FSOLID_NOT_SOLID);	SetTouch( &CASW_Mine::MineTouch );	m_bPrimed = true;	// attach to whatever we're standing on	CBaseEntity *pGround = GetGroundEntity();	if ( pGround && !pGround->IsWorld() )	{		if (asw_debug_mine.GetBool())			Msg( "Parenting mine to %s/n", GetGroundEntity()->GetClassname() );		SetParent( GetGroundEntity() );		SetMoveType( MOVETYPE_NONE );	}}
开发者ID:docfinorlias,项目名称:asb2,代码行数:26,


示例10: SetModelName

//-----------------------------------------------------------------------------// Purpose: //-----------------------------------------------------------------------------void CResourceChunk::Spawn( ){	// Init model	if ( IsProcessed() )	{		SetModelName( AllocPooledString( sProcessedResourceChunkModel ) );	}	else	{		SetModelName( AllocPooledString( sResourceChunkModel ) );	}	BaseClass::Spawn();	UTIL_SetSize( this, Vector(-4,-4,-4), Vector(4,4,4) );	SetMoveType( MOVETYPE_FLYGRAVITY, MOVECOLLIDE_FLY_BOUNCE );	SetSolid( SOLID_BBOX );	AddSolidFlags( FSOLID_TRIGGER );	CollisionProp()->UseTriggerBounds( true, 24 );	SetCollisionGroup( TFCOLLISION_GROUP_RESOURCE_CHUNK );	SetGravity( 1.0 );	SetFriction( 1 );	SetTouch( ChunkTouch );	SetThink( ChunkRemove );	SetNextThink( gpGlobals->curtime + random->RandomFloat( 50.0, 80.0 ) ); // Remove myself the}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:29,


示例11: GetHullType

//-----------------------------------------------------------------------------// Purpose: //// NOTE: This function is still heavy with common code (found at the bottom).//		 we should consider moving some into the base class! (sjb)//-----------------------------------------------------------------------------void CNPC_Monster::SetZombieModel( void ){	Hull_t lastHull = GetHullType();	SetModel( cModel.ToCStr() );	if (m_fIsTorso)		SetHullType(HULL_TINY);	else		SetHullType(HULL_HUMAN);	SetHullSizeNormal( true );	SetDefaultEyeOffset();	SetActivity( ACT_IDLE );	m_nSkin = m_iSkin;	if ( lastHull != GetHullType() )	{		if ( VPhysicsGetObject() )		{			SetupVPhysicsHull();		}	}	CollisionProp()->SetSurroundingBoundsType( USE_OBB_COLLISION_BOUNDS );}
开发者ID:BerntA,项目名称:tfo-code,代码行数:33,


示例12: StudioFrameAdvance

void CWreckage::Think( void ){	StudioFrameAdvance( );	SetNextThink( gpGlobals->curtime + 0.2 );	if (m_flDieTime)	{		if (m_flDieTime < gpGlobals->curtime)		{			UTIL_Remove( this );			return;		}		else if (random->RandomFloat( 0, m_flDieTime - m_flStartTime ) > m_flDieTime - gpGlobals->curtime)		{			return;		}	}		Vector vecSrc;	CollisionProp()->RandomPointInBounds( vec3_origin, Vector(1, 1, 1), &vecSrc );		CPVSFilter filter( vecSrc );	te->Smoke( filter, 0.0, 		&vecSrc, g_sModelIndexSmoke,		random->RandomFloat(0,4.9) + 5.0,		random->RandomInt(0, 3) + 8 );}
开发者ID:Au-heppa,项目名称:swarm-sdk,代码行数:26,


示例13: UTIL_Remove

//-----------------------------------------------------------------------------// Purpose: //-----------------------------------------------------------------------------void CItem::Spawn( void ){	if ( g_pGameRules->IsAllowedToSpawn( this ) == false )	{		UTIL_Remove( this );		return;	}	SetMoveType( MOVETYPE_FLYGRAVITY );	SetSolid( SOLID_BBOX );	SetBlocksLOS( false );	AddEFlags( EFL_NO_ROTORWASH_PUSH );		if( IsX360() )	{		AddEffects( EF_ITEM_BLINK );	}	// This will make them not collide with the player, but will collide	// against other items + weapons	SetCollisionGroup( COLLISION_GROUP_WEAPON );	CollisionProp()->UseTriggerBounds( true, ITEM_PICKUP_BOX_BLOAT );	SetTouch(&CItem::ItemTouch);	if ( CreateItemVPhysicsObject() == false )		return;	m_takedamage = DAMAGE_EVENTS_ONLY;#if !defined( CLIENT_DLL )	// Constrained start?	if ( HasSpawnFlags( SF_ITEM_START_CONSTRAINED ) )	{		//Constrain the weapon in place		IPhysicsObject *pReferenceObject, *pAttachedObject;		pReferenceObject = g_PhysWorldObject;		pAttachedObject = VPhysicsGetObject();		if ( pReferenceObject && pAttachedObject )		{			constraint_fixedparams_t fixed;			fixed.Defaults();			fixed.InitWithCurrentObjectState( pReferenceObject, pAttachedObject );			fixed.constraint.forceLimit	= lbs2kg( 10000 );			fixed.constraint.torqueLimit = lbs2kg( 10000 );			m_pConstraint = physenv->CreateFixedConstraint( pReferenceObject, pAttachedObject, NULL, fixed );			m_pConstraint->SetGameData( (void *) this );		}	}#endif //CLIENT_DLL#if defined( HL2MP )	SetThink( &CItem::FallThink );	SetNextThink( gpGlobals->curtime + 0.1f );#endif}
开发者ID:Denzeriko,项目名称:hl2-mod,代码行数:63,


示例14: SetMoveType

// as CItem, but we don't install the touch functionvoid CASW_Pickup::Spawn( void ){	SetMoveType( MOVETYPE_FLYGRAVITY );	SetSolid( SOLID_BBOX );	SetBlocksLOS( false );	AddEFlags( EFL_NO_ROTORWASH_PUSH );		// This will make them not collide with the player, but will collide	// against other items + weapons	SetCollisionGroup( COLLISION_GROUP_WEAPON );	CollisionProp()->UseTriggerBounds( true, ITEM_PICKUP_BOX_BLOAT );	//SetTouch(&CItem::ItemTouch);	if ( CreateItemVPhysicsObject() == false )		 return;		m_takedamage = DAMAGE_EVENTS_ONLY;#ifdef HL2MP	SetThink( &CItem::FallThink );	SetNextThink( gpGlobals->curtime + 0.1f );#endif		if ( m_bFreezePickup )	{		IPhysicsObject *pPhysicsObject = VPhysicsGetObject();		if ( pPhysicsObject != NULL )		{			pPhysicsObject->EnableMotion( false );		}	}}
开发者ID:Au-heppa,项目名称:swarm-sdk,代码行数:33,


示例15: CollisionProp

//-----------------------------------------------------------------------------// Purpose: // Input  : *pPhysGunUser - //			PICKED_UP_BY_CANNON - //-----------------------------------------------------------------------------void CItem::OnPhysGunPickup( CBasePlayer *pPhysGunUser, PhysGunPickup_t reason ){	if ( reason == PICKED_UP_BY_CANNON )	{		// Expand the pickup box		CollisionProp()->UseTriggerBounds( true, ITEM_PICKUP_BOX_BLOAT * 2 );	}}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:13,


示例16: Spawn

	void Spawn( void )	{ 		Precache( );		SetModel( "models/items/hevsuit.mdl" );		BaseClass::Spawn( );				CollisionProp()->UseTriggerBounds( false, 0 );	}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:8,


示例17: Precache

//-----------------------------------------------------------------------------// Purpose: //-----------------------------------------------------------------------------void CAntlionGrub::Spawn( void ){	Precache();	BaseClass::Spawn();	SetModel( ANTLIONGRUB_MODEL );		// FIXME: This is a big perf hit with the number of grubs we're using! - jdw	CreateGlow();	SetSolid( SOLID_BBOX );	SetSolidFlags( FSOLID_TRIGGER );	SetMoveType( MOVETYPE_NONE );	SetCollisionGroup( COLLISION_GROUP_NONE );	AddEffects( EF_NOSHADOW );	CollisionProp()->UseTriggerBounds(true,1);	SetTouch( &CAntlionGrub::GrubTouch );	SetHealth( 1 );	m_takedamage = DAMAGE_YES;	// Stick to the nearest surface	if ( HasSpawnFlags( SF_ANTLIONGRUB_NO_AUTO_PLACEMENT ) == false )	{		AttachToSurface();	}	// At this point, alter our bounds to make sure we're within them	Vector vecMins, vecMaxs;	RotateAABB( EntityToWorldTransform(), CollisionProp()->OBBMins(), CollisionProp()->OBBMaxs(), vecMins, vecMaxs );	UTIL_SetSize( this, vecMins, vecMaxs );	// Start our idle activity	SetSequence( SelectWeightedSequence( ACT_IDLE ) );	SetCycle( random->RandomFloat( 0.0f, 1.0f ) );	ResetSequenceInfo();	m_State = GRUB_STATE_IDLE;	// Reset	m_flFlinchTime = 0.0f;	m_flNextIdleSoundTime = gpGlobals->curtime + random->RandomFloat( 4.0f, 8.0f );}
开发者ID:xxauroraxx,项目名称:Source.Python,代码行数:49,


示例18: TurretDeath

void CBaseTurret ::	TurretDeath( void ){	StudioFrameAdvance( );	SetNextThink( gpGlobals->curtime + 0.1f );	if (m_lifeState != LIFE_DEAD)	{		m_lifeState = LIFE_DEAD;		EmitSound( "NPC_Turret.Die" );		SetActivity( (Activity)ACT_TURRET_CLOSE );		EyeOn( );		}	EyeOff( );	if (m_flDamageTime + random->RandomFloat( 0, 2 ) > gpGlobals->curtime)	{		// lots of smoke		Vector pos;		CollisionProp()->RandomPointInBounds( vec3_origin, Vector( 1, 1, 1 ), &pos );		pos.z = CollisionProp()->GetCollisionOrigin().z;				CBroadcastRecipientFilter filter;		te->Smoke( filter, 0.0, &pos,			g_sModelIndexSmoke,			2.5,			10 );	}		if (m_flDamageTime + random->RandomFloat( 0, 5 ) > gpGlobals->curtime)	{		Vector vecSrc;		CollisionProp()->RandomPointInBounds( vec3_origin, Vector( 1, 1, 1 ), &vecSrc );		g_pEffects->Sparks( vecSrc );	}	if (m_fSequenceFinished && !MoveTurret( ) && m_flDamageTime + 5 < gpGlobals->curtime)	{		m_flPlaybackRate = 0;		SetThink( NULL );	}}
开发者ID:Filip98,项目名称:source-sdk-2013,代码行数:45,


示例19: CollisionProp

//------------------------------------------------------------------------------// Purpose : Reset the OnGround flags for any entities that may have been//			 resting on me// Input   :// Output  ://------------------------------------------------------------------------------void CBreakable::ResetOnGroundFlags(void){	// !!! HACK  This should work!	// Build a box above the entity that looks like an 9 inch high sheet	Vector mins, maxs;	CollisionProp()->WorldSpaceAABB( &mins, &maxs );	mins.z -= 1;	maxs.z += 8;	// BUGBUG -- can only find 256 entities on a breakable -- should be enough	CBaseEntity *pList[256];	int count = UTIL_EntitiesInBox( pList, 256, mins, maxs, FL_ONGROUND );	if ( count )	{		for ( int i = 0; i < count; i++ )		{			pList[i]->SetGroundEntity( (CBaseEntity *)NULL );		}	}#ifdef PORTAL	// !!! HACK  This should work!	// Tell touching portals to fizzle	int iPortalCount = CProp_Portal_Shared::AllPortals.Count();	if( iPortalCount != 0 )	{		Vector vMin, vMax;		CollisionProp()->WorldSpaceAABB( &vMin, &vMax );		Vector vBoxCenter = ( vMin + vMax ) * 0.5f;		Vector vBoxExtents = ( vMax - vMin ) * 0.5f;		CProp_Portal **pPortals = CProp_Portal_Shared::AllPortals.Base();		for( int i = 0; i != iPortalCount; ++i )		{			CProp_Portal *pTempPortal = pPortals[i];			if( UTIL_IsBoxIntersectingPortal( vBoxCenter, vBoxExtents, pTempPortal ) )			{				pTempPortal->DoFizzleEffect( PORTAL_FIZZLE_KILLED, false );				pTempPortal->Fizzle();			}		}	}#endif}
开发者ID:Biohazard90,项目名称:g-string_2013,代码行数:51,


示例20: SetSize

//-----------------------------------------------------------------------------// Purpose: //-----------------------------------------------------------------------------void CWeaponBugBait::Spawn( void ){	BaseClass::Spawn();	// Increase the bugbait's pickup volume. It spawns inside the antlion guard's body,	// and playtesters seem to be wary about moving into the body.	SetSize( Vector( -4, -4, -4), Vector(4, 4, 4) );	CollisionProp()->UseTriggerBounds( true, 100 );}
开发者ID:xxauroraxx,项目名称:Source.Python,代码行数:12,


示例21: CollisionProp

//-----------------------------------------------------------------------------// Purpose: Return true if the specified point is within this zone//-----------------------------------------------------------------------------bool CFuncNoBuild::PointIsWithin( const Vector &vecPoint ){	Ray_t ray;	trace_t tr;	ICollideable *pCollide = CollisionProp();	ray.Init( vecPoint, vecPoint );	enginetrace->ClipRayToCollideable( ray, MASK_ALL, pCollide, &tr );	return ( tr.startsolid );}
开发者ID:TenmaPL,项目名称:TF2Classic,代码行数:12,


示例22: Start

//-----------------------------------------------------------------------------// Purpose: FIXME: what's the right way to do this?//-----------------------------------------------------------------------------void C_FireSmoke::StartClientOnly( void ){	Start();	ClientEntityList().AddNonNetworkableEntity(	this );	CollisionProp()->CreatePartitionHandle();	AddEffects( EF_NORECEIVESHADOW | EF_NOSHADOW );	AddToLeafSystem();}
开发者ID:TalonBraveInfo,项目名称:InvasionSource,代码行数:12,


示例23: CollisionProp

void C_ColorCorrectionVolume::Update( C_BasePlayer *pPlayer, float ccScale ){	if ( pPlayer )	{		bool isTouching = CollisionProp()->IsPointInBounds( pPlayer->EyePosition() );		bool wasTouching = m_LastEnterTime > m_LastExitTime;		if ( isTouching && !wasTouching )		{			StartTouch( pPlayer );		}		else if ( !isTouching && wasTouching )		{			EndTouch( pPlayer );		}	}	if( !m_bEnabled )	{		m_Weight = 0.0f;	}	else	{		if( m_LastEnterTime > m_LastExitTime )		{			// we most recently entered the volume			if( m_Weight < 1.0f )			{				float dt = gpGlobals->curtime - m_LastEnterTime;				float weight = m_LastEnterWeight + dt / ((1.0f-m_LastEnterWeight)*m_FadeDuration);				if( weight>1.0f )					weight = 1.0f;				m_Weight = weight;			}		}		else		{			// we most recently exitted the volume			if( m_Weight > 0.0f )			{				float dt = gpGlobals->curtime - m_LastExitTime;				float weight = (1.0f-m_LastExitWeight) + dt / (m_LastExitWeight*m_FadeDuration);				if( weight>1.0f )					weight = 1.0f;				m_Weight = 1.0f - weight;			}		}	}	//	Vector entityPosition = GetAbsOrigin();	g_pColorCorrectionMgr->SetColorCorrectionWeight( m_CCHandle, m_Weight * ccScale );}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:56,


示例24: CollisionProp

bool CPhysicsCannister::TestCollision( const Ray_t &ray, unsigned int mask, trace_t& trace ){	Vector vecAbsMins, vecAbsMaxs;	CollisionProp()->WorldSpaceAABB( &vecAbsMins, &vecAbsMaxs );	if ( !IsBoxIntersectingRay( vecAbsMins, vecAbsMaxs, ray.m_Start, ray.m_Delta ) )		return false;		return BaseClass::TestCollision( ray, mask, trace );}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:10,


示例25: VectorAngles

void CSDKPlayer::ThrowActiveWeapon( void ){	CWeaponSDKBase *pWeapon = (CWeaponSDKBase *)GetActiveWeapon();	if( pWeapon && pWeapon->CanWeaponBeDropped() )	{		QAngle gunAngles;		VectorAngles( BodyDirection2D(), gunAngles );		Vector vecForward;		AngleVectors( gunAngles, &vecForward, NULL, NULL );		float flDiameter = sqrt( CollisionProp()->OBBSize().x * CollisionProp()->OBBSize().x + CollisionProp()->OBBSize().y * CollisionProp()->OBBSize().y );		pWeapon->Holster(NULL);		SwitchToNextBestWeapon( pWeapon );		SDKThrowWeapon( pWeapon, vecForward, gunAngles, flDiameter );	}}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:19,


示例26: SetModel

//-----------------------------------------------------------------------------// Set up the world model//-----------------------------------------------------------------------------void CEnvHeadcrabCanister::SetupWorldModel(){	SetModel( ENV_HEADCRABCANISTER_MODEL );	SetSolid( SOLID_BBOX );	float flRadius = CollisionProp()->BoundingRadius();	Vector vecMins( -flRadius, -flRadius, -flRadius );	Vector vecMaxs( flRadius, flRadius, flRadius );	SetSize( vecMins, vecMaxs );}
开发者ID:NEITMod,项目名称:HL2BM2,代码行数:14,


示例27: Assert

void CAI_DynamicLinkController::GenerateLinksFromVolume(){	Assert( m_ControlledLinks.Count() == 0 );	int nNodes = g_pBigAINet->NumNodes();	CAI_Node **ppNodes = g_pBigAINet->AccessNodes();	const float MinDistCareSq = Square(MAX_NODE_LINK_DIST + 0.1);	const Vector &origin = WorldSpaceCenter();	Vector vAbsMins, vAbsMaxs;	CollisionProp()->WorldSpaceAABB( &vAbsMins, &vAbsMaxs );	vAbsMins -= Vector( 1, 1, 1 );	vAbsMaxs += Vector( 1, 1, 1 );	for ( int i = 0; i < nNodes; i++ )	{		CAI_Node *pNode = ppNodes[i];		const Vector &nodeOrigin = pNode->GetOrigin();		if ( origin.DistToSqr(nodeOrigin) < MinDistCareSq )		{			int nLinks = pNode->NumLinks();			for ( int j = 0; j < nLinks; j++ )			{				CAI_Link *pLink = pNode->GetLinkByIndex( j );				int iLinkDest = pLink->DestNodeID( i );				if ( iLinkDest > i )				{					const Vector &originOther = ppNodes[iLinkDest]->GetOrigin();					if ( origin.DistToSqr(originOther) < MinDistCareSq )					{						if ( IsBoxIntersectingRay( vAbsMins, vAbsMaxs, nodeOrigin, originOther - nodeOrigin ) )						{							Assert( IsBoxIntersectingRay( vAbsMins, vAbsMaxs, originOther, nodeOrigin - originOther ) );							CAI_DynamicLink *pLink = (CAI_DynamicLink *)CreateEntityByName( "info_node_link" );							pLink->m_nSrcID = i;							pLink->m_nDestID = iLinkDest;							pLink->m_nSrcEditID = g_pAINetworkManager->GetEditOps()->GetWCIdFromNodeId( pLink->m_nSrcID );							pLink->m_nDestEditID = g_pAINetworkManager->GetEditOps()->GetWCIdFromNodeId( pLink->m_nDestID );							pLink->m_nLinkState = m_nLinkState;							pLink->m_strAllowUse = m_strAllowUse;							pLink->m_bFixedUpIds = true;							pLink->m_bNotSaved = true;							pLink->Spawn();							m_ControlledLinks.AddToTail( pLink );						}					}				}			}		}	}}
开发者ID:paralin,项目名称:hl2sdk,代码行数:54,


示例28: SetCollisionGroup

	void CWeaponDODBase::Spawn()	{		BaseClass::Spawn();		// Set this here to allow players to shoot dropped weapons		SetCollisionGroup( COLLISION_GROUP_WEAPON );				SetExtraAmmoCount(0);	//Start with no additional ammo		CollisionProp()->UseTriggerBounds( true, 10.0f );	}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:11,


示例29: CollisionProp

void CStatueProp::ComputeWorldSpaceSurroundingBox( Vector *pMins, Vector *pMaxs ){	CBaseAnimating *pBaseAnimating = m_hInitBaseAnimating;	if ( pBaseAnimating )	{		pBaseAnimating->CollisionProp()->WorldSpaceSurroundingBounds( pMins, pMaxs );		return;	}	CollisionProp()->WorldSpaceSurroundingBounds( pMins, pMaxs );}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:12,



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


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