本文整理汇总了C++中CGib::RemoveSolidFlags方法的典型用法代码示例。如果您正苦于以下问题:C++ CGib::RemoveSolidFlags方法的具体用法?C++ CGib::RemoveSolidFlags怎么用?C++ CGib::RemoveSolidFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGib
的用法示例。
在下文中一共展示了CGib::RemoveSolidFlags方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SpawnStickyGibs
void CGib::SpawnStickyGibs( CBaseEntity *pVictim, Vector vecOrigin, int cGibs )
{
int i;
//City17: Germany Violence Fix.
/*if ( g_Language.GetInt() == LANGUAGE_GERMAN )
{
// no sticky gibs in germany right now!
return;
}*/
for ( i = 0 ; i < cGibs ; i++ )
{
CGib *pGib = (CGib *)CreateEntityByName( "gib" );
pGib->Spawn( "models/stickygib.mdl" );
pGib->m_nBody = random->RandomInt(0,2);
if ( pVictim )
{
pGib->SetLocalOrigin(
Vector( vecOrigin.x + random->RandomFloat( -3, 3 ),
vecOrigin.y + random->RandomFloat( -3, 3 ),
vecOrigin.z + random->RandomFloat( -3, 3 ) ) );
// make the gib fly away from the attack vector
Vector vecNewVelocity = g_vecAttackDir * -1;
// mix in some noise
vecNewVelocity.x += random->RandomFloat ( -0.15, 0.15 );
vecNewVelocity.y += random->RandomFloat ( -0.15, 0.15 );
vecNewVelocity.z += random->RandomFloat ( -0.15, 0.15 );
vecNewVelocity *= 900;
QAngle vecAngVelocity( random->RandomFloat ( 250, 400 ), random->RandomFloat ( 250, 400 ), 0 );
pGib->SetLocalAngularVelocity( vecAngVelocity );
// copy owner's blood color
pGib->SetBloodColor( pVictim->BloodColor() );
pGib->AdjustVelocityBasedOnHealth( pVictim->m_iHealth, vecNewVelocity );
pGib->SetAbsVelocity( vecNewVelocity );
pGib->SetMoveType( MOVETYPE_FLYGRAVITY );
pGib->RemoveSolidFlags( FSOLID_NOT_SOLID );
pGib->SetCollisionBounds( vec3_origin, vec3_origin );
pGib->SetTouch ( &CGib::StickyGibTouch );
pGib->SetThink (NULL);
}
pGib->LimitVelocity();
}
}