UTIL SetModel

From Valve Developer Community
Revision as of 06:09, 10 April 2011 by LordNed (talk | contribs) (Created Page)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Template:Wrongname UTIL_SetModel is a UTIL function provided in the Source engine to set the model of an entity.

Appears to be largely obsolete and replaced by SetModel, which sets the model for the entity it is called on, and not another entity.


// Purpose: Change another entity's model
// Input  : *pEntity - Entity to set the model on
// Input  : *pModelName - model name as string
// Output : 
void UTIL_SetModel( CBaseEntity *pEntity, const char *pModelName )


UTIL_SetModel( this, STRING( GetModelName() ) );
CEnvQuadraticBeam *CreateQuadraticBeam( const char *pSpriteName, const Vector &start, const Vector &control, const Vector &end, float width, CBaseEntity *pOwner )
	CEnvQuadraticBeam *pBeam = (CEnvQuadraticBeam *)CBaseEntity::Create( "env_quadraticbeam", start, vec3_angle, pOwner );
	UTIL_SetModel( pBeam, pSpriteName );
	pBeam->SetSpline( control, end );
	pBeam->SetScrollRate( 0.0 );
	return pBeam;