本文整理汇总了C++中CAI_BaseNPC::GetBonePosition方法的典型用法代码示例。如果您正苦于以下问题:C++ CAI_BaseNPC::GetBonePosition方法的具体用法?C++ CAI_BaseNPC::GetBonePosition怎么用?C++ CAI_BaseNPC::GetBonePosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAI_BaseNPC
的用法示例。
在下文中一共展示了CAI_BaseNPC::GetBonePosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Operator_HandleAnimEvent
//-----------------------------------------------------------------------------
// Purpose: Gets event from anim stream and throws the object
// Input :
// Output :
//-----------------------------------------------------------------------------
void CWeaponMolotov::Operator_HandleAnimEvent( animevent_t *pEvent, CBaseCombatCharacter *pOperator )
{
switch( pEvent->event )
{
case EVENT_WEAPON_THROW:
{
CAI_BaseNPC *pNPC = GetOwner()->MyNPCPointer();
if (!pNPC)
{
return;
}
CBaseEntity *pEnemy = pNPC->GetEnemy();
if (!pEnemy)
{
return;
}
Vector vec_target = pNPC->GetEnemyLKP();
// -----------------------------------------------------
// Get position of throw
// -----------------------------------------------------
// If owner has a hand, set position to the hand bone position
Vector launchPos;
int iBIndex = pNPC->LookupBone("Bip01 R Hand");
if (iBIndex != -1)
{
Vector origin;
QAngle angles;
pNPC->GetBonePosition( iBIndex, launchPos, angles);
}
// Otherwise just set to in front of the owner
else
{
Vector vFacingDir = pNPC->BodyDirection2D( );
vFacingDir = vFacingDir * 60.0;
launchPos = pNPC->GetAbsOrigin()+vFacingDir;
}
//Vector vecVelocity = VecCheckToss( pNPC, launchPos, vec_target, 1.0 );
ThrowMolotov( launchPos, m_vecTossVelocity);
// Drop the weapon and remove as no more ammo
pNPC->Weapon_Drop( this );
UTIL_Remove( this );
}
break;
default:
BaseClass::Operator_HandleAnimEvent( pEvent, pOperator );
break;
}
}