当前位置: 首页>>代码示例>>C++>>正文


C++ UTIL_DecalTrace函数代码示例

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


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

示例1: UTIL_TraceLine

void CASW_Boomer_Blob::DoExplosion( )
{
	// scorch the ground
	trace_t		tr;
	UTIL_TraceLine ( GetAbsOrigin(), GetAbsOrigin() + Vector( 0, 0, -80 ), MASK_SHOT, this, COLLISION_GROUP_NONE, &tr);

	if ( m_bMaster )
	{
		if ( ( tr.m_pEnt != GetWorldEntity() ) || ( tr.hitbox != 0 ) )
		{
			// non-world needs smaller decals
			if( tr.m_pEnt && !tr.m_pEnt->IsNPC() )
			{
				UTIL_DecalTrace( &tr, "SmallScorch" );
			}
		}
		else
		{
			UTIL_DecalTrace( &tr, "Scorch" );
		}

		UTIL_ASW_ScreenShake( GetAbsOrigin(), 7.0f, 45.0f, 0.5f, 150, SHAKE_START );
	}

	// explosion effects
	DispatchParticleEffect( "boomer_drop_explosion", GetAbsOrigin(), Vector( m_DmgRadius, 0.0f, 0.0f ), QAngle( 0.0f, 0.0f, 0.0f ) );
	EmitSound( "ASW_Boomer_Grenade.Explode" );

	// damage to nearby things
	ASWGameRules()->RadiusDamage( CTakeDamageInfo( this, m_hFirer.Get(), m_flDamage, DMG_BLAST ), GetAbsOrigin(), m_DmgRadius, CLASS_NONE, NULL );
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:31,代码来源:asw_boomer_blob.cpp

示例2: UTIL_BloodDecalTrace

void UTIL_BloodDecalTrace( TraceResult *pTrace, int bloodColor )
{
	if ( UTIL_ShouldShowBlood( bloodColor ) )
	{
		if ( bloodColor == BLOOD_COLOR_RED )
			UTIL_DecalTrace( pTrace, DECAL_BLOOD1 + RANDOM_LONG(0,5) );
		else
			UTIL_DecalTrace( pTrace, DECAL_YBLOOD1 + RANDOM_LONG(0,5) );
	}
}
开发者ID:CryoKeen,项目名称:HLEnhanced,代码行数:10,代码来源:util.cpp

示例3: UTIL_BloodDecalTrace

void UTIL_BloodDecalTrace( trace_t *pTrace, int bloodColor )
{
	if ( UTIL_ShouldShowBlood( bloodColor ) )
	{
		if ( bloodColor == BLOOD_COLOR_RED )
			UTIL_DecalTrace( pTrace, "Blood" );
		else
			UTIL_DecalTrace( pTrace, "YellowBlood" );
	}
}
开发者ID:TalonBraveInfo,项目名称:InvasionSource,代码行数:10,代码来源:util_shared.cpp

示例4: filter

void CGrenadeMP5::Detonate(void)
{
	if (!m_bIsLive)
	{
		return;
	}
	m_bIsLive		= false;
	m_takedamage	= DAMAGE_NO;	

	CPASFilter filter( GetAbsOrigin() );

	te->Explosion( filter, 0.0,
		&GetAbsOrigin(), 
		GetWaterLevel() == 0 ? g_sModelIndexFireball : g_sModelIndexWExplosion,
		(m_flDamage - 50) * .60, 
		15,
		TE_EXPLFLAG_NONE,
		m_DmgRadius,
		m_flDamage );

	trace_t tr;	
	tr = CBaseEntity::GetTouchTrace();

	if ( (tr.m_pEnt != GetWorldEntity()) || (tr.hitbox != 0) )
	{
		// non-world needs smaller decals
		UTIL_DecalTrace( &tr, "SmallScorch");
	}
	else
	{
		UTIL_DecalTrace( &tr, "Scorch" );
	}

	CSoundEnt::InsertSound ( SOUND_COMBAT, GetAbsOrigin(), BASEGRENADE_EXPLOSION_VOLUME, 3.0 );

	RadiusDamage ( CTakeDamageInfo( this, GetThrower(), m_flDamage, DMG_BLAST ), GetAbsOrigin(), m_flDamage * 2.5, CLASS_NONE, NULL );

	CPASAttenuationFilter filter2( this );
	EmitSound( filter2, entindex(), "GrenadeMP5.Detonate" );

	if ( GetWaterLevel() == 0 )
	{
		int sparkCount = random->RandomInt( 0,3 );
		QAngle angles;
		VectorAngles( tr.plane.normal, angles );

		for ( int i = 0; i < sparkCount; i++ )
			Create( "spark_shower", GetAbsOrigin(), angles, NULL );
	}

	UTIL_Remove( this );
}
开发者ID:hitmen047,项目名称:TF2HLCoop,代码行数:52,代码来源:hl1_grenade_mp5.cpp

示例5: UTIL_Remove

void CGrenadeAR2::Detonate(void)
{
	if (!m_bIsLive)
	{
		return;
	}
	m_bIsLive		= false;
	m_takedamage	= DAMAGE_NO;	

	if(m_hSmokeTrail)
	{
		UTIL_Remove(m_hSmokeTrail);
		m_hSmokeTrail = NULL;
	}

	CPASFilter filter( GetAbsOrigin() );

	te->Explosion( filter, 0.0,
		&GetAbsOrigin(), 
		g_sModelIndexFireball,
		2.0, 
		15,
		TE_EXPLFLAG_NONE,
		m_DmgRadius,
		m_flDamage );

	Vector vecForward = GetAbsVelocity();
	VectorNormalize(vecForward);
	trace_t		tr;
	UTIL_TraceLine ( GetAbsOrigin(), GetAbsOrigin() + 60*vecForward, MASK_SHOT, 
		this, COLLISION_GROUP_NONE, &tr);


	if ((tr.m_pEnt != GetWorldEntity()) || (tr.hitbox != 0))
	{
		// non-world needs smaller decals
		if( tr.m_pEnt && !tr.m_pEnt->IsNPC() )
		{
			UTIL_DecalTrace( &tr, "SmallScorch" );
		}
	}
	else
	{
		UTIL_DecalTrace( &tr, "Scorch" );
	}

	UTIL_ScreenShake( GetAbsOrigin(), 25.0, 150.0, 1.0, 750, SHAKE_START );

	RadiusDamage ( CTakeDamageInfo( this, GetThrower(), m_flDamage, DMG_BLAST ), GetAbsOrigin(), m_DmgRadius, CLASS_NONE, NULL );

	UTIL_Remove( this );
}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:52,代码来源:grenade_ar2.cpp

示例6: FX_Trail

void CFlame::ExplodeTouch( CBaseEntity *pOther )
{
	if ( UTIL_PointContents(pev->origin) == CONTENT_SKY )
	{
		FX_Trail( pev->origin, entindex(), PROJ_REMOVE );
		UTIL_Remove( this );
		return;
	}
	if ( UTIL_PointContents(pev->origin) == CONTENT_WATER )
	{
		FX_Trail( pev->origin, entindex(), PROJ_FLAME_DETONATE_WATER );
		UTIL_Remove( this );
		return;
	}
	if (pOther->edict() == pev->owner)
	return;

	TraceResult tr;
	Vector vecSpot = pev->origin - pev->velocity.Normalize() * 32;
	UTIL_TraceLine( vecSpot, vecSpot + pev->velocity.Normalize() * 64, ignore_monsters, ENT(pev), &tr );

	FireStayTime = 8;

	entvars_t *pevOwner = VARS( pev->owner );
	::RadiusDamage( pev->origin, pev, pevOwner, pev->dmg, pev->dmg*2.5, CLASS_NONE, DMG_IGNITE | DMG_NEVERGIB);
	UTIL_DecalTrace(&tr, DECAL_SMALLSCORCH1 + RANDOM_LONG(0,2));
	FX_Trail( tr.vecEndPos + (tr.vecPlaneNormal * 10), entindex(), PROJ_FLAME_DETONATE );

	pev->velocity = g_vecZero;
	SetTouch(NULL);
	SetThink( Burn );
	pev->nextthink = gpGlobals->time + 0.2;
}
开发者ID:mittorn,项目名称:hlwe_src,代码行数:33,代码来源:proj_flame.cpp

示例7: newInfo

//-----------------------------------------------------------------------------
// Purpose:	
// Input:	
// Output:	
//-----------------------------------------------------------------------------
void CASW_Ranger::Event_Killed( const CTakeDamageInfo &info )
{
	CTakeDamageInfo newInfo(info);

	// scale up the force if we're shot by a marine, to make our ragdolling more interesting
	if (newInfo.GetAttacker() && newInfo.GetAttacker()->Classify() == CLASS_ASW_MARINE)
	{
		// scale based on the weapon used
		if (info.GetAmmoType() == GetAmmoDef()->Index("ASW_R")
			|| info.GetAmmoType() == GetAmmoDef()->Index("ASW_AG")
			|| info.GetAmmoType() == GetAmmoDef()->Index("ASW_P"))
			newInfo.ScaleDamageForce(22.0f);
		else if (info.GetAmmoType() == GetAmmoDef()->Index("ASW_PDW")
			|| info.GetAmmoType() == GetAmmoDef()->Index("ASW_SG"))
			newInfo.ScaleDamageForce(30.0f);
		else if (info.GetAmmoType() == GetAmmoDef()->Index("ASW_ASG"))
			newInfo.ScaleDamageForce(35.0f);

		// tilt the angle up a bit?
		Vector vecForceDir = newInfo.GetDamageForce();
		float force = vecForceDir.NormalizeInPlace();
		QAngle angForce;
		VectorAngles(vecForceDir, angForce);
		angForce[PITCH] += asw_drone_death_force_pitch.GetFloat();
		AngleVectors(angForce, &vecForceDir);
		vecForceDir *= force;
		newInfo.SetDamageForce(vecForceDir);
	}

	trace_t tr;
	UTIL_TraceLine( GetAbsOrigin() + Vector( 0, 0, 16 ), GetAbsOrigin() - Vector( 0, 0, 64 ), MASK_SOLID, this, COLLISION_GROUP_NONE, &tr );
	UTIL_DecalTrace( &tr, "GreenBloodBig" );

	BaseClass::Event_Killed( newInfo );
}
开发者ID:Cre3per,项目名称:hl2sdk-csgo,代码行数:40,代码来源:asw_ranger.cpp

示例8: GetAbsOrigin

void CNPC_BigMomma::LayHeadcrab( void )
{
	CBaseEntity *pChild = CBaseEntity::Create( BIG_CHILDCLASS, GetAbsOrigin(), GetAbsAngles(), this );

	pChild->AddSpawnFlags( SF_NPC_FALL_TO_GROUND );

	pChild->SetOwnerEntity( this );

	// Is this the second crab in a pair?
	if ( HasMemory( bits_MEMORY_CHILDPAIR ) )
	{
		m_crabTime = gpGlobals->curtime + RandomFloat( 5, 10 );
		Forget( bits_MEMORY_CHILDPAIR );
	}
	else
	{
		m_crabTime = gpGlobals->curtime + RandomFloat( 0.5, 2.5 );
		Remember( bits_MEMORY_CHILDPAIR );
	}

	trace_t tr;
	UTIL_TraceLine( GetAbsOrigin(), GetAbsOrigin() - Vector(0,0,100), MASK_SOLID, this, COLLISION_GROUP_NONE, &tr );
	UTIL_DecalTrace( &tr, "Splash" );

	CPASAttenuationFilter filter( this );
	EmitSound( filter, entindex(), "BigMomma.LayHeadcrab" );

	m_crabCount++;
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:29,代码来源:hl1_npc_bigmomma.cpp

示例9: AngleVectors

void CNPC_Gargantua::StompAttack( void )
{
	trace_t trace;

	Vector vecForward;
	AngleVectors(GetAbsAngles(), &vecForward );
	Vector vecStart = GetAbsOrigin() + Vector(0,0,60) + 35 * vecForward;

	CBaseEntity* pPlayer = GetEnemy();
	if ( !pPlayer )
		return;

	Vector vecAim = pPlayer->GetAbsOrigin() - GetAbsOrigin();
	VectorNormalize( vecAim );
	Vector vecEnd = (vecAim * 1024) + vecStart;

	UTIL_TraceLine( vecStart, vecEnd, MASK_SOLID, this, COLLISION_GROUP_NONE, &trace );
//	NDebugOverlay::Line( vecStart, vecEnd, 255, 0, 0, false, 10.0f );

	CStomp::StompCreate( vecStart, trace.endpos, 0, this );
	UTIL_ScreenShake( GetAbsOrigin(), 12.0, 100.0, 2.0, 1000, SHAKE_START );
	CPASAttenuationFilter filter( this );
	EmitSound( filter, entindex(), "Garg.StompSound" );

	UTIL_TraceLine( GetAbsOrigin(), GetAbsOrigin() - Vector(0,0,20), MASK_SOLID, this, COLLISION_GROUP_NONE, &trace );
	if ( trace.fraction < 1.0 )
	{
		UTIL_DecalTrace( &trace, "SmallScorch" );
	}
}
开发者ID:hitmen047,项目名称:TF2HLCoop,代码行数:30,代码来源:hl1_npc_gargantua.cpp

示例10: GetAbsOrigin

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CNPC_Monster::PrescheduleThink( void )
{
	bool bNearEnemy = false;
	if ( GetEnemy() != NULL )
	{
		float flDist = (GetEnemy()->GetAbsOrigin() - GetAbsOrigin()).Length();
		if ( flDist < ZOMBIE_ENEMY_BREATHE_DIST )
		{
			bNearEnemy = true;
		}
	}

	if ( bNearEnemy )
	{
		if ( !m_bNearEnemy )
		{
			m_bNearEnemy = true;
		}
	}
	else if ( m_bNearEnemy )
	{
		m_bNearEnemy = false;
	}

	BaseClass::PrescheduleThink();

	// We're chopped off! And we're moving! Add some blood trail...
	if (m_fIsTorso && IsMoving() && (m_flLastBloodTrail < gpGlobals->curtime))
	{
		m_flLastBloodTrail = gpGlobals->curtime + 1.0f; // We don't want to spam blood all over the place.
		trace_t tr;
		UTIL_TraceLine((GetAbsOrigin() + Vector(0, 0, 50)), (GetAbsOrigin() + Vector(0, 0, -300)), MASK_ALL, this, COLLISION_GROUP_NONE, &tr);
		UTIL_DecalTrace(&tr, "Blood");
	}
}
开发者ID:BerntA,项目名称:tfo-code,代码行数:38,代码来源:npc_monster.cpp

示例11: LayHeadcrab

void CBigMomma :: LayHeadcrab( void )
{
	CBaseEntity *pChild = CBaseEntity::Create( BIG_CHILDCLASS, pev->origin, pev->angles, edict() );

	pChild->pev->spawnflags |= SF_MONSTER_FALL_TO_GROUND;

	// Is this the second crab in a pair?
	if ( HasMemory( bits_MEMORY_CHILDPAIR ) )
	{
		m_crabTime = gpGlobals->time + RANDOM_FLOAT( 5, 10 );
		Forget( bits_MEMORY_CHILDPAIR );
	}
	else
	{
		m_crabTime = gpGlobals->time + RANDOM_FLOAT( 0.5, 2.5 );
		Remember( bits_MEMORY_CHILDPAIR );
	}

	TraceResult tr;
	UTIL_TraceLine( pev->origin, pev->origin - Vector(0,0,100), ignore_monsters, edict(), &tr);
	UTIL_DecalTrace( &tr, DECAL_MOMMABIRTH );

	EMIT_SOUND_DYN( edict(), CHAN_WEAPON, RANDOM_SOUND_ARRAY(pBirthSounds), 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG(-5,5) );
	m_crabCount++;
}
开发者ID:FaucetDC,项目名称:HLDC_SDK,代码行数:25,代码来源:bigmomma.cpp

示例12: UTIL_TraceLine

void CGrenadeSpit::GrenadeSpitTouch( CBaseEntity *pOther )
{
	if (m_fSpitDeathTime != 0)
	{
		return;
	}
	if ( pOther->GetCollisionGroup() == HL2COLLISION_GROUP_SPIT)
	{
		return;
	}
	if ( !pOther->m_takedamage )
	{

		// make a splat on the wall
		trace_t tr;
		UTIL_TraceLine( GetAbsOrigin(), GetAbsOrigin() + GetAbsVelocity() * 10, MASK_SOLID, this, COLLISION_GROUP_NONE, &tr );
		UTIL_DecalTrace(&tr, "BeerSplash" );

		// make some flecks
		// CPVSFilter filter( tr.endpos );
		//te->SpriteSpray( filter, 0.0,
		//	tr.endpos, tr.plane.normal, m_nSquidSpitSprite, 30, 0.8, 5 );
	}
	else
	{
		RadiusDamage ( CTakeDamageInfo( this, GetThrower(), m_flDamage, DMG_BLAST ), GetAbsOrigin(), m_DmgRadius, CLASS_NONE, NULL );
	}

	Detonate();
}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:30,代码来源:grenade_spit.cpp

示例13: GetAbsVelocity

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CDODBaseRocket::Explode( void )
{
	// Don't explode against the skybox. Just pretend that 
	// the missile flies off into the distance.
	Vector vecForward = GetAbsVelocity();

	trace_t tr;
	UTIL_TraceLine( GetAbsOrigin(), GetAbsOrigin() + 60*vecForward, MASK_SHOT, this, COLLISION_GROUP_NONE, &tr );

	m_takedamage = DAMAGE_NO;
	if( tr.fraction == 1.0 || !(tr.surface.flags & SURF_SKY) )
	{
		DoExplosion();

		if ( !tr.m_pEnt->IsPlayer() )
			UTIL_DecalTrace( &tr, "Scorch" );
	}

	if( m_hRocketTrail )
	{
		m_hRocketTrail->SetLifetime(0.1f);
		m_hRocketTrail = NULL;
	}

	StopSound( "Weapon_Bazooka.Shoot" );
	UTIL_Remove( this );
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:30,代码来源:dod_baserocket.cpp

示例14: while

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CWeaponGauss::DoWallBreak(Vector startPos, Vector endPos, Vector aimDir, trace_t *ptr, CBasePlayer *pOwner, bool m_bBreakAll){
	trace_t *temp = ptr;
	if(m_bBreakAll){
		Vector tempPos = endPos;
		Vector beamStart = startPos;
		int x=0;
		while(DidPunchThrough(ptr)){
			temp = ptr;
			if(x==0){
				UTIL_TraceLine( startPos, tempPos, MASK_SHOT, pOwner, COLLISION_GROUP_NONE, ptr ); 
				x = 1;
			} else{
				UTIL_TraceLine( endPos, startPos, MASK_SHOT, pOwner, COLLISION_GROUP_NONE, ptr );
				x = 0;
			}
			if(ptr->DidHitWorld() && ptr->surface.flags != SURF_SKY){
				UTIL_ImpactTrace( ptr, GetAmmoDef()->DamageType(m_iPrimaryAmmoType), "ImpactGauss" );
				UTIL_DecalTrace( ptr, "RedGlowFade" );
			}
			startPos= ptr->endpos;
			tempPos = ptr->endpos + ( aimDir * MAX_TRACE_LENGTH + aimDir * 128.0f );

		}
		//DrawBeam( beamStart, ptr->startpos, 4.0, false );
	} else{
		UTIL_TraceLine( startPos, endPos, MASK_SHOT, pOwner, COLLISION_GROUP_NONE, ptr ); //Trace from gun to wall
	}

	if(!DidPunchThrough(ptr)){
			ptr = temp;
return;
	}
}
开发者ID:Sub-Zero1324,项目名称:HL2-DM-Gauss-Gun-Code,代码行数:36,代码来源:weapon_gauss.cpp

示例15: UTIL_DecalTrace

void CGrenade::SG_Explode( TraceResult *pTrace, int bitsDamageType )
{
    pev->model		= iStringNull;	// invisible
    pev->solid		= SOLID_NOT;	// intangible
    pev->takedamage = DAMAGE_NO;

    if( pTrace->flFraction != 1.0 )
    {
        pev->origin = pTrace->vecEndPos + ( pTrace->vecPlaneNormal * ( pev->dmg - 24 ) * 0.6 );
    }

    CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, NORMAL_EXPLOSION_VOLUME, 3.0 );
    pev->owner = NULL;

    UTIL_DecalTrace( pTrace, RANDOM_FLOAT( 0 , 1 ) < 0.5 ? DECAL_SCORCH1 : DECAL_SCORCH2 );

    if( RANDOM_LONG( 0, 1 ) )
        EMIT_SOUND( ENT( pev ), CHAN_VOICE, "weapons/flashbang-1.wav", 0.55, ATTN_NORM );
    else
        EMIT_SOUND( ENT( pev ), CHAN_VOICE, "weapons/flashbang-2.wav", 0.55, ATTN_NORM );

    SetThink( &CGrenade::SG_Smoke );
    pev->nextthink = gpGlobals->time + 0.1;

    if( UTIL_PointContents( pev->origin ) != CONTENTS_WATER )
    {
        int sparkCount = RANDOM_LONG( 0, 3 );

        for( int i = 0; i < sparkCount; i++ )
        {
            Create( "spark_shower", pev->origin, pTrace->vecPlaneNormal, NULL );
        }
    }
}
开发者ID:johndrinkwater,项目名称:CSSDK,代码行数:34,代码来源:ggrenade.cpp


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