本文整理汇总了C++中EHANDLE::SetSolid方法的典型用法代码示例。如果您正苦于以下问题:C++ EHANDLE::SetSolid方法的具体用法?C++ EHANDLE::SetSolid怎么用?C++ EHANDLE::SetSolid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EHANDLE
的用法示例。
在下文中一共展示了EHANDLE::SetSolid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DropGrenade
void CNPC_Zombine::DropGrenade( Vector vDir )
{
if ( m_hGrenade == NULL )
return;
m_hGrenade->SetParent( NULL );
m_hGrenade->SetOwnerEntity( NULL );
Vector vGunPos;
QAngle angles;
GetAttachment( "grenade_attachment", vGunPos, angles );
IPhysicsObject *pPhysObj = m_hGrenade->VPhysicsGetObject();
if ( pPhysObj == NULL )
{
m_hGrenade->SetMoveType( MOVETYPE_VPHYSICS );
m_hGrenade->SetSolid( SOLID_VPHYSICS );
m_hGrenade->SetCollisionGroup( COLLISION_GROUP_WEAPON );
m_hGrenade->CreateVPhysics();
}
if ( pPhysObj )
{
pPhysObj->Wake();
pPhysObj->SetPosition( vGunPos, angles, true );
pPhysObj->ApplyForceCenter( vDir * 0.2f );
pPhysObj->RecheckCollisionFilter();
}
m_hGrenade = NULL;
}
示例2: Spawn
//------------------------------------------------------------------------------
// Purpose :
// Input :
// Output :
//------------------------------------------------------------------------------
void CNPC_CombineDropship::Spawn( void )
{
Precache( );
SetModel( "models/combine_dropship.mdl" );
BaseClass::Spawn();
ExtractBbox( SelectHeaviestSequence( ACT_DROPSHIP_DEPLOY_IDLE ), m_cullBoxMins, m_cullBoxMaxs );
BaseClass::Spawn();
InitPathingData( DROPSHIP_LEAD_DISTANCE, DROPSHIP_MIN_CHASE_DIST_DIFF, DROPSHIP_AVOID_DIST );
// create the correct bin for the ship to carry
switch ( m_iCrateType )
{
case CRATE_ROLLER_HOPPER:
break;
case CRATE_SOLDIER:
m_hContainer = CreateEntityByName( "prop_dynamic" );
if ( m_hContainer )
{
m_hContainer->SetModel( "models/props_junk/trashdumpster02.mdl" );
m_hContainer->SetLocalOrigin( GetAbsOrigin() );
m_hContainer->SetLocalAngles( GetLocalAngles() );
m_hContainer->SetAbsAngles( GetAbsAngles() );
m_hContainer->SetParent(this, 0);
m_hContainer->SetOwnerEntity(this);
m_hContainer->SetSolid( SOLID_VPHYSICS );
m_hContainer->Spawn();
}
break;
case CRATE_NONE:
default:
break;
}
m_iHealth = 100;
m_flFieldOfView = 0.5; // 60 degrees
m_iContainerMoveType = MOVETYPE_NONE;
//InitBoneControllers();
InitCustomSchedules();
if ( m_hContainer )
{
SetIdealActivity( (Activity)ACT_DROPSHIP_FLY_IDLE_CARGO );
}
else
{
SetIdealActivity( (Activity)ACT_DROPSHIP_FLY_IDLE_EXAGG );
}
m_flMaxSpeed = DROPSHIP_MAX_SPEED;
m_flMaxSpeedFiring = BASECHOPPER_MAX_FIRING_SPEED;
m_hPickupTarget = NULL;
//!!!HACKHACK
// This tricks the AI code that constantly complains that the vehicle has no schedule.
SetSchedule( SCHED_IDLE_STAND );
m_iLandState = LANDING_NO;
}