本文整理汇总了C++中IAIObject::GetMoveDir方法的典型用法代码示例。如果您正苦于以下问题:C++ IAIObject::GetMoveDir方法的具体用法?C++ IAIObject::GetMoveDir怎么用?C++ IAIObject::GetMoveDir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAIObject
的用法示例。
在下文中一共展示了IAIObject::GetMoveDir方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoAnimActionEP
bool CDialogActorContext::DoAnimActionEP(IEntity* pEntity, const char* sAction)
{
IAIObject* pAI = pEntity->GetAI();
if (pAI == 0)
return false;
IPipeUser* pPipeUser = pAI->CastToIPipeUser();
if (!pPipeUser)
{
return false;
}
Vec3 pos = pEntity->GetWorldPos();
Vec3 dir = pAI->GetMoveDir();
// EP Direction is either lookat direction or forward direction
CDialogScript::TActorID lookAt = m_pCurLine->m_lookatActor;
if (lookAt != CDialogScript::NO_ACTOR_ID)
{
IEntity* pLookAtEntity = m_pSession->GetActorEntity(lookAt);
if (pLookAtEntity != 0)
{
dir = pLookAtEntity->GetWorldPos();
dir -= pos;
dir.z = 0;
dir.NormalizeSafe(pAI->GetMoveDir());
}
}
pPipeUser->SetRefPointPos(pos, dir);
static const Vec3 startRadius (0.1f,0.1f,0.1f);
static const float dirTolerance = 5.f;
static const float targetRadius = 0.05f;
IAISignalExtraData* pData = gEnv->pAISystem->CreateSignalExtraData();
pData->iValue2 = m_bAnimUseAGSignal ? 1 : 0;
pData->SetObjectName(sAction);
pData->point = startRadius;
pData->fValue = dirTolerance;
pData->point2.x = targetRadius;
const bool ok = ExecuteAI(m_exPosAnimPipeID, "ACT_ANIMEX", pData);
return ok;
}