本文整理汇总了C++中CGib::SetBodygroup方法的典型用法代码示例。如果您正苦于以下问题:C++ CGib::SetBodygroup方法的具体用法?C++ CGib::SetBodygroup怎么用?C++ CGib::SetBodygroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGib
的用法示例。
在下文中一共展示了CGib::SetBodygroup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RunTask
//=========================================================
// RunTask
//=========================================================
void CNPC_Gargantua::RunTask( const Task_t *pTask )
{
switch ( pTask->iTask )
{
case TASK_DIE:
if ( gpGlobals->curtime > m_flWaitFinished )
{
//TEMP TEMP
m_nRenderFX = kRenderFxExplode;
SetRenderColor( 255, 0, 0 , 255 );
StopAnimation();
SetNextThink( gpGlobals->curtime + 0.15 );
SetThink( &CBaseEntity::SUB_Remove );
int i;
int parts = modelinfo->GetModelFrameCount( modelinfo->GetModel( gGargGibModel ) );
for ( i = 0; i < 10; i++ )
{
CGib *pGib = CREATE_ENTITY( CGib, "gib" );
pGib->Spawn( GARG_GIB_MODEL);
int bodyPart = 0;
if ( parts > 1 )
bodyPart = random->RandomInt( 0, parts-1 );
pGib->SetBodygroup( 0, bodyPart );
pGib->SetBloodColor( BLOOD_COLOR_YELLOW );
pGib->m_material = matNone;
pGib->SetAbsOrigin( GetAbsOrigin() );
pGib->SetAbsVelocity( UTIL_RandomBloodVector() * random->RandomFloat( 300, 500 ) );
pGib->SetNextThink( gpGlobals->curtime + 1.25 );
pGib->SetThink( &CBaseEntity::SUB_FadeOut );
}
Vector vecSize = Vector( 200, 200, 128 );
CPVSFilter filter( GetAbsOrigin() );
te->BreakModel( filter, 0.0, GetAbsOrigin(), vec3_angle, vecSize, vec3_origin,
gGargGibModel, 200, 50, 3.0, BREAK_FLESH );
return;
}
else
BaseClass::RunTask( pTask );
break;
case TASK_FLAME_SWEEP:
if ( gpGlobals->curtime > m_flWaitFinished )
{
//TEMP TEMP
FlameDestroy();
TaskComplete();
FlameControls( 0, 0 );
SetBoneController( 0, 0 );
SetBoneController( 1, 0 );
}
else
{
bool cancel = false;
QAngle angles = QAngle( 0, 0, 0 );
//TEMP TEMP
FlameUpdate();
CBaseEntity *pEnemy = GetEnemy();
if ( pEnemy )
{
Vector org = GetAbsOrigin();
org.z += 64;
Vector dir = pEnemy->BodyTarget(org) - org;
VectorAngles( dir, angles );
angles.x = -angles.x;
angles.y -= GetAbsAngles().y;
if ( dir.Length() > 400 )
cancel = true;
}
if ( fabs(angles.y) > 60 )
cancel = true;
if ( cancel )
{
m_flWaitFinished -= 0.5;
m_flameTime -= 0.5;
}
//TEMP TEMP
//FlameControls( angles.x + 2 * sin(gpGlobals->curtime*8), angles.y + 28 * sin(gpGlobals->curtime*8.5) );
FlameControls( angles.x, angles.y );
}
//.........这里部分代码省略.........