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


C++ CEntityFlame::SetThink方法代码示例

本文整理汇总了C++中CEntityFlame::SetThink方法的典型用法代码示例。如果您正苦于以下问题:C++ CEntityFlame::SetThink方法的具体用法?C++ CEntityFlame::SetThink怎么用?C++ CEntityFlame::SetThink使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CEntityFlame的用法示例。


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

示例1: CreateEntityByName

//-----------------------------------------------------------------------------
// Purpose: Creates a flame and attaches it to a target entity.
// Input  : pTarget - 
//-----------------------------------------------------------------------------
CEntityFlame *CEntityFlame::Create( CBaseEntity *pTarget, bool useHitboxes )
{
	CEntityFlame *pFlame = (CEntityFlame *) CreateEntityByName( "entityflame" );

	if ( pFlame == NULL )
		return NULL;

	float xSize = pTarget->CollisionProp()->OBBMaxs().x - pTarget->CollisionProp()->OBBMins().x;
	float ySize = pTarget->CollisionProp()->OBBMaxs().y - pTarget->CollisionProp()->OBBMins().y;

	float size = ( xSize + ySize ) * 0.5f;
	
	if ( size < 16.0f )
	{
		size = 16.0f;
	}

	UTIL_SetOrigin( pFlame, pTarget->GetAbsOrigin() );

	pFlame->m_flSize = size;
	pFlame->SetThink( &CEntityFlame::FlameThink );
	pFlame->SetNextThink( gpGlobals->curtime + 0.1f );

	pFlame->AttachToEntity( pTarget );
	pFlame->SetLifetime( 2.0f );

	//Send to the client even though we don't have a model
	pFlame->AddEFlags( EFL_FORCE_CHECK_TRANSMIT );

	pFlame->SetUseHitboxes( useHitboxes );

	return pFlame;
}
开发者ID:SizzlingStats,项目名称:hl2sdk-ob-valve,代码行数:37,代码来源:EntityFlame.cpp

示例2: CreateEntityByName

//-----------------------------------------------------------------------------
// Purpose: Creates a flame and attaches it to a target entity.
// Input  : pTarget - 
//-----------------------------------------------------------------------------
CEntityFlame *CEntityFlame::Create( CBaseEntity *pTarget )
{
	CEntityFlame *pFlame = (CEntityFlame *) CreateEntityByName( "entityflame" );

	if ( pFlame == NULL )
		return NULL;

	/*IPhysicsObject *pPhysicsObject = pTarget->VPhysicsGetObject();

	if ( pPhysicsObject )
	{
		pPhysicsObject->
	}*/

	float size = ( pTarget->WorldAlignMaxs().y - pTarget->WorldAlignMins().y );

	if ( size < 8 )
		size = 8;

	UTIL_SetOrigin( pFlame, pTarget->GetAbsOrigin() );

	pFlame->m_flSize = size;
	pFlame->SetThink( &CEntityFlame::FlameThink );
	pFlame->SetNextThink( gpGlobals->curtime + 0.1f );

	pFlame->AttachToEntity( pTarget );
	pFlame->SetLifetime( 2.0f );

	//Send to the client even though we don't have a model
	pFlame->AddEFlags( EFL_FORCE_CHECK_TRANSMIT );

	return pFlame;
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:37,代码来源:EntityFlame.cpp


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