UTIL MuzzleFlash: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Muzzle Ned, Muzzle.)
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{wrongtitle|UTIL_MuzzleFlash}}
{{DISPLAYTITLE:UTIL_MuzzleFlash}}
UTIL_MuzzleFlash is a UTIL provided in the Source code for muzzle flashes. However '''it is only called once in the code by CNPC_Assassin'''. Since the NPC_Assassin was never included in Half Life 2, this function may be outdated.
UTIL_MuzzleFlash is a [[UTIL]] provided in the Source code for muzzle flashes. However '''it is only called once in the code by CNPC_Assassin'''. Since the npc_assasin was never included in [[Half-Life 2]], this function may be outdated.


{{Note|Due to the questionable usage of this function, see [[UTIL_Tracer]], or [[UTIL_ParticleTracer]] instead.}}
{{Note|Due to the questionable usage of this function, see [[UTIL_Tracer]], or [[UTIL_ParticleTracer]] instead.}}

Latest revision as of 00:28, 5 December 2011

UTIL_MuzzleFlash is a UTIL provided in the Source code for muzzle flashes. However it is only called once in the code by CNPC_Assassin. Since the npc_assasin was never included in Half-Life 2, this function may be outdated.

Note.pngNote:Due to the questionable usage of this function, see UTIL_Tracer, or UTIL_ParticleTracer instead.


Usage

//-----------------------------------------------------------------------------
// Purpose: Make a muzzle flash appear
// Input  : &origin - position of the muzzle flash
//			&angles - angles of the fire direction
//			scale - scale of the muzzle flash
//			type - type of muzzle flash
//-----------------------------------------------------------------------------
void UTIL_MuzzleFlash( const Vector &origin, const QAngle &angles, int scale, int type )
{
	CPASFilter filter( origin );

	te->MuzzleFlash( filter, 0.0f, origin, angles, scale, type );
}


Examples

Vector	muzzlePos;
QAngle	muzzleAngle;
GetAttachment( handName, muzzlePos, muzzleAngle );

UTIL_MuzzleFlash( muzzlePos, muzzleAngle, 0.5f, 1 );