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


C++ GetModelName函数代码示例

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


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

示例1: GetModelName

//-----------------------------------------------------------------------------
// Spawn
//-----------------------------------------------------------------------------
void CNPC_Eli::Spawn()
{
	// Eli is allowed to use multiple models, because he appears in the pod.
	// He defaults to his normal model.
	char *szModel = (char *)STRING( GetModelName() );
	if (!szModel || !*szModel)
	{
		szModel = "models/eli.mdl";
		SetModelName( AllocPooledString(szModel) );
	}

	Precache();
	SetModel( szModel );

	BaseClass::Spawn();

	SetHullType(HULL_HUMAN);
	SetHullSizeNormal();

	// If Eli has a parent, he's currently inside a pod. Prevent him from moving.
	if ( GetMoveParent() )
	{
		SetSolid( SOLID_BBOX );
		AddSolidFlags( FSOLID_NOT_STANDABLE );
		SetMoveType( MOVETYPE_NONE );

		CapabilitiesAdd( bits_CAP_ANIMATEDFACE | bits_CAP_TURN_HEAD );
		CapabilitiesAdd( bits_CAP_FRIENDLY_DMG_IMMUNE );
	}
	else
	{
		SetupWithoutParent();
	}

	AddEFlags( EFL_NO_DISSOLVE | EFL_NO_MEGAPHYSCANNON_RAGDOLL | EFL_NO_PHYSCANNON_INTERACTION );
	SetBloodColor( BLOOD_COLOR_RED );
	m_iHealth			= 8;
	m_flFieldOfView		= 0.5;// indicates the width of this NPC's forward view cone ( as a dotproduct result )
	m_NPCState			= NPC_STATE_NONE;

	NPCInit();
}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:45,代码来源:npc_eli.cpp

示例2: PrecacheModel

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CPointCommentaryNode::Precache()
{
	PrecacheModel( STRING( GetModelName() ) );

	if ( m_iszCommentaryFile.Get() != NULL_STRING )
	{
		PrecacheScriptSound( STRING( m_iszCommentaryFile.Get() ) );
	}
	else
	{
		Warning("%s: %s has no commentary file.\n", GetClassName(), GetDebugName() );
	}

	if ( m_iszCommentaryFileNoHDR.Get() != NULL_STRING )
	{
		PrecacheScriptSound( STRING( m_iszCommentaryFileNoHDR.Get() ) );
	}
	
	BaseClass::Precache();
}	
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:23,代码来源:commentarysystem.cpp

示例3: Spawn

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CEnvLaser::Spawn( void )
{
	if ( !GetModelName() )
	{
		SetThink( &CEnvLaser::SUB_Remove );
		return;
	}

	SetSolid( SOLID_NONE );							// Remove model & collisions
	SetThink( &CEnvLaser::StrikeThink );

	SetEndWidth( GetWidth() );				// Note: EndWidth is not scaled

	PointsInit( GetLocalOrigin(), GetLocalOrigin() );

	Precache( );

	if ( !m_pSprite && m_iszSpriteName != NULL_STRING )
	{
		m_pSprite = CSprite::SpriteCreate( STRING(m_iszSpriteName), GetAbsOrigin(), TRUE );
	}
	else
	{
		m_pSprite = NULL;
	}

	if ( m_pSprite )
	{
		m_pSprite->SetParent( GetMoveParent() );
		m_pSprite->SetTransparency( kRenderGlow, m_clrRender->r, m_clrRender->g, m_clrRender->b, m_clrRender->a, m_nRenderFX );
	}

	if ( GetEntityName() != NULL_STRING && !(m_spawnflags & SF_BEAM_STARTON) )
	{
		TurnOff();
	}
	else
	{
		TurnOn();
	}
}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:44,代码来源:EnvLaser.cpp

示例4: UTIL_Remove

void CBlendingCycler::Spawn( void )
{
	// Remove if it's not blending
	if (m_iLowerBound == 0 && m_iUpperBound == 0)
	{
		UTIL_Remove( this );
		return;
	}

	GenericCyclerSpawn( (char *)STRING( GetModelName() ), Vector(-16,-16,-16), Vector(16,16,16));
	if (!m_iBlendspeed)
		m_iBlendspeed = 5;

	// Initialise Sequence
	if (m_iszSequence != NULL_STRING)
	{
		SetSequence( LookupSequence( STRING(m_iszSequence) ) );
	}

	m_iCurrent = m_iLowerBound;
}
开发者ID:Au-heppa,项目名称:swarm-sdk,代码行数:21,代码来源:h_cycler.cpp

示例5: Precache

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CBaseProjectile::Spawn( void )
{
	Precache();

	SetModel( STRING( GetModelName() ) );

	SetSolid( SOLID_BBOX );
	SetMoveType( MOVETYPE_FLYGRAVITY, MOVECOLLIDE_FLY_CUSTOM );
	AddFlag( FL_OBJECT );

	UTIL_SetSize( this, -Vector( 1.0f, 1.0f, 1.0f ), Vector( 1.0f, 1.0f, 1.0f ) );

	// Setup attributes.
	SetGravity( 0.001f );
	m_takedamage = DAMAGE_NO;

	// Setup the touch and think functions.
	SetTouch( &CBaseProjectile::ProjectileTouch );
	SetThink( &CBaseProjectile::FlyThink );
	SetNextThink( gpGlobals->curtime );
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:24,代码来源:baseprojectile.cpp

示例6: Precache

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CItem_AmmoCrate::Spawn( void )
{
	Precache();

	BaseClass::Spawn();

	SetModel( STRING( GetModelName() ) );
	SetMoveType( MOVETYPE_NONE );
	SetSolid( SOLID_VPHYSICS );
	CreateVPhysics();

	ResetSequence( LookupSequence( "Idle" ) );
	SetBodygroup( 1, true );

	m_flCloseTime = gpGlobals->curtime;
	m_flAnimTime = gpGlobals->curtime;
	m_flPlaybackRate = 0.0;
	SetCycle( 0 );

	m_takedamage = DAMAGE_EVENTS_ONLY;

}
开发者ID:SteamLUG,项目名称:steamlug-7dfps-2013,代码行数:25,代码来源:item_ammo.cpp

示例7: Precache

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CPhysMagnet::Spawn( void )
{
	Precache();

	SetMoveType( MOVETYPE_NONE );
	SetSolid( SOLID_VPHYSICS );
	SetModel( STRING( GetModelName() ) );

	m_takedamage = DAMAGE_EVENTS_ONLY;

	solid_t tmpSolid;
	PhysModelParseSolid( tmpSolid, this, GetModelIndex() );
	if ( m_massScale > 0 )
	{
		float mass = tmpSolid.params.mass * m_massScale;
		mass = clamp( mass, 0.5, 1e6 );
		tmpSolid.params.mass = mass;
	}
	PhysSolidOverride( tmpSolid, m_iszOverrideScript );
	VPhysicsInitNormal( GetSolid(), GetSolidFlags(), true, &tmpSolid );

	// Wake it up if not asleep
	if ( !HasSpawnFlags(SF_MAGNET_ASLEEP) )
	{
		VPhysicsGetObject()->Wake();
	}

	if ( HasSpawnFlags(SF_MAGNET_MOTIONDISABLED) )
	{
		VPhysicsGetObject()->EnableMotion( false );
	}

	m_bActive = true;
	m_pConstraintGroup = NULL;
	m_flTotalMass = 0;
	m_flNextSuckTime = 0;

	BaseClass::Spawn();
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:42,代码来源:physobj.cpp

示例8: GetUtilFlag

short GetUtilFlag(short model_id)
{
	LPFUNCTIONCOMP lpComp;
	char resName[NAME_BUF_MAX_SIZE];
	char *modelName = GetModelName();
	short flag = 0;

	snprintf( resName, NAME_BUF_MAX_SIZE, "%s/%s", MAINTENANCE_RESPATH, MAINTENANCE_RESFILE );
	if ( ParseFunctionListTag( resName, modelName, &lpComp  ) != 0 ) goto Err;
	while( lpComp != NULL ){
		if ( lpComp->type == FUNCTYPE_CLEANING ) flag |= UF_CLEANING;
		else if ( lpComp->type == FUNCTYPE_DEEP_CLEANING ) flag |= UF_DEEP_CLEANING;
		else if ( lpComp->type == FUNCTYPE_ROLLER_CLEANING ) flag |= UF_ROLLER_CLEANING;
		else if ( lpComp->type == FUNCTYPE_PLATE_CLEANING ) flag |= UF_PLATE_CLEANING;
		else if ( lpComp->type == FUNCTYPE_NOZZLE_CHECK ) flag |= UF_NOZZLE_CHECK;
		else if ( lpComp->type == FUNCTYPE_POWER_OFF ) flag |= UF_POWER_OFF;
		else if ( lpComp->type == FUNCTYPE_AUTOPOWER ) flag |= UF_AUTO_POWER;
		else if ( lpComp->type == FUNCTYPE_INK_WARNING ) flag |= UF_INK_WARNING;
		else if ( lpComp->type == FUNCTYPE_INK_RESET ) flag |= UF_INK_RESET;
		else if ( lpComp->type == FUNCTYPE_INK_CARTRIDGE ) flag |= UF_INK_CARTRIDGE;
		else if ( lpComp->type == FUNCTYPE_QUIET ) flag |= UF_QUIET;
		else if ( lpComp->type == FUNCTYPE_HEAD_ALIGNMENT_AUTO ) flag |= UF_HEAD_ALIGNMENT;
		else if ( lpComp->type == FUNCTYPE_HEAD_ALIGNMENT_MANUAL ) flag |= UF_HEAD_ALIGNMENT;
		else if ( lpComp->type == FUNCTYPE_CUSTOM ) flag |= UF_CUSTOM;
		else if ( lpComp->type == FUNCTYPE_PAPER_SOURCE_SETTING ) flag |= UI_PAPER_SOURCE_SETTING;
		lpComp = lpComp->next;
	}
	FreeFunctionCompList( lpComp );
#if 0
	ModelTable* model_table;

	if( (model_table = GetModelTableEntry(model_id)) != NULL )
		return model_table->util_flag;

#endif
Err:
	return flag;
}
开发者ID:mariospr,项目名称:cnijfilter-common,代码行数:38,代码来源:modeltbl.c

示例9: SetSolid

//--------------------------------------------------------------------------------------------------------
void CFuncNavCost::Spawn( void )
{
	BaseClass::Spawn();

	gm_masterCostVector.AddToTail( this );
	gm_dirtyTimer.Start( UPDATE_DIRTY_TIME );

	SetSolid( SOLID_BSP );	
	AddSolidFlags( FSOLID_NOT_SOLID );

	SetMoveType( MOVETYPE_NONE );
	SetModel( STRING( GetModelName() ) );
	AddEffects( EF_NODRAW );
	SetCollisionGroup( COLLISION_GROUP_NONE );

	VPhysicsInitShadow( false, false );

	SetThink( &CFuncNavCost::CostThink );
	SetNextThink( gpGlobals->curtime + UPDATE_DIRTY_TIME );

	m_tags.RemoveAll();

	const char *tags = STRING( m_iszTags );

	// chop space-delimited string into individual tokens
	if ( tags )
	{
		char *buffer = new char [ strlen( tags ) + 1 ];
		Q_strcpy( buffer, tags );

		for( char *token = strtok( buffer, " " ); token; token = strtok( NULL, " " ) )
		{
			m_tags.AddToTail( CFmtStr( "%s", token ) );
		}

		delete [] buffer;
	}
}
开发者ID:Au-heppa,项目名称:source-sdk-2013,代码行数:39,代码来源:nav_entities.cpp

示例10: Precache

void CBubbling::Spawn( void )
{
	Precache();
	SetModel( GetModelName() );		// Set size

	SetSolidType( SOLID_NOT );							// Remove model & collisions
	SetRenderAmount( 0 );								// The engine won't draw this model if this is set to 0 and blending is on
	SetRenderMode( kRenderTransTexture );
	int speed = fabs( GetSpeed() );

	// HACKHACK!!! - Speed in rendercolor
	SetRenderColor( Vector( speed >> 8, speed & 255, ( GetSpeed() < 0 ) ? 1 : 0 ) );


	if( !GetSpawnFlags().Any( SF_BUBBLES_STARTOFF ) )
	{
		SetThink( &CBubbling::FizzThink );
		SetNextThink( gpGlobals->time + 2.0 );
		m_state = true;
	}
	else
		m_state = false;
}
开发者ID:oskarlh,项目名称:HLEnhanced,代码行数:23,代码来源:CBubbling.cpp

示例11: Precache

void CPushable::Spawn( void )
{
	if ( HasSpawnFlags( SF_PUSH_BREAKABLE ) )
	{
		BaseClass::Spawn();
	}
	else
	{
		Precache();

		SetSolid( SOLID_VPHYSICS );

		SetMoveType( MOVETYPE_PUSH );
		SetModel( STRING( GetModelName() ) );

		CreateVPhysics();
	}

#ifdef HL1_DLL
	// Force HL1 Pushables to stay axially aligned.
	VPhysicsGetObject()->SetInertia( Vector( 1e30, 1e30, 1e30 ) );
#endif//HL1_DLL
}
开发者ID:Biohazard90,项目名称:g-string_2013,代码行数:23,代码来源:func_break.cpp

示例12: Spawn

void CSpriteTrail::Spawn( void )
{
#ifdef CLIENT_DLL
	BaseClass::Spawn();
#else

	if ( GetModelName() != NULL_STRING )
	{
		BaseClass::Spawn();
		return;
	}

	SetModelName( m_iszSpriteName );
	BaseClass::Spawn();

	SetSolid( SOLID_NONE );
	SetMoveType( MOVETYPE_NOCLIP );

	SetCollisionBounds( vec3_origin, vec3_origin );
	TurnOn();

#endif
}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:23,代码来源:spritetrail.cpp

示例13: OLE2CA

ImodelIGC* CPigShip::FindModel(BSTR bstrModel)
{
    if (!BSTRLen(bstrModel))
        return NULL;

    USES_CONVERSION;
    LPCSTR pszModel = OLE2CA(bstrModel);

    const ClusterListIGC* pClusters = GetIGC()->GetMission()->GetClusters();
    for (ClusterLinkIGC* itCluster = pClusters->first(); itCluster; itCluster = itCluster->next())
    {
        IclusterIGC* pCluster = itCluster->data();
        const ModelListIGC* pModels = pCluster->GetModels();
        for (ModelLinkIGC* it = pModels->first(); it; it = it->next())
        {
            ImodelIGC* pModel = it->data();
            if (0 == _stricmp(GetModelName(pModel), pszModel))
                return pModel;
        }
    }

    return NULL;
}
开发者ID:BackTrak,项目名称:Allegiance-R4-Engine,代码行数:23,代码来源:PigShip.cpp

示例14: SetMoveType

//--------------------------------------------------------------------------------------------------------
void CFuncNavBlocker::Spawn( void )
{
	gm_NavBlockers.AddToTail( this );

	if ( !m_blockedTeamNumber )
		m_blockedTeamNumber = TEAM_ANY;

	SetMoveType( MOVETYPE_NONE );
	SetModel( STRING( GetModelName() ) );
	AddEffects( EF_NODRAW );
	SetCollisionGroup( COLLISION_GROUP_NONE );
	SetSolid( SOLID_NONE );
	AddSolidFlags( FSOLID_NOT_SOLID );
	CollisionProp()->WorldSpaceAABB( &m_CachedMins, &m_CachedMaxs );
	if ( m_bDisabled )
	{
        g_EventQueue.AddEvent( this, "UnblockNav", 2.0f, this, this );
	}
	else
	{
        g_EventQueue.AddEvent( this, "BlockNav", 2.0f, this, this );
	}
}
开发者ID:WootsMX,项目名称:InSource,代码行数:24,代码来源:nav_entities.cpp

示例15: SetSolid

void CFunc_LiquidPortal::Activate( void )
{
	BaseClass::Activate();

	SetSolid( SOLID_VPHYSICS );
	SetSolidFlags( FSOLID_NOT_SOLID );
	SetMoveType( MOVETYPE_NONE );
	SetModel( STRING( GetModelName() ) );

	ComputeLinkMatrix(); //collision origin may have changed during activation

	SetThink( &CFunc_LiquidPortal::Think );

	for( int i = m_hLeftToTeleportThisFill.Count(); --i >= 0; )
	{
		CBaseEntity *pEnt = m_hLeftToTeleportThisFill[i].Get();

		if( pEnt && pEnt->IsPlayer() )
		{
			((CPortal_Player *)pEnt)->m_hSurroundingLiquidPortal = this;
		}
	}
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:23,代码来源:func_liquidportal.cpp


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