本文整理汇总了C++中IAnimatedCharacter::GetActionController方法的典型用法代码示例。如果您正苦于以下问题:C++ IAnimatedCharacter::GetActionController方法的具体用法?C++ IAnimatedCharacter::GetActionController怎么用?C++ IAnimatedCharacter::GetActionController使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAnimatedCharacter
的用法示例。
在下文中一共展示了IAnimatedCharacter::GetActionController方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessEvent
virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
{
switch (event)
{
case eFE_Initialize:
break;
case eFE_Activate:
IGameFramework* const pGameFramework = gEnv->pGame->GetIGameFramework();
IGameObject* const pGameObject = pGameFramework->GetGameObject(pActInfo->pEntity->GetId());
if(IsPortActive(pActInfo, EIP_Enslave) || IsPortActive(pActInfo, EIP_UnEnslave) )
{
IAnimatedCharacter* const pAnimChar = pGameObject ? (IAnimatedCharacter*) pGameObject->QueryExtension("AnimatedCharacter") : NULL;
if(pAnimChar && pAnimChar->GetActionController())
{
const EntityId slaveChar = GetPortEntityId(pActInfo, EIP_Slave);
IGameObject* pSlaveGameObject = pGameFramework->GetGameObject(slaveChar);
IAnimatedCharacter* pSlaveAnimChar = pSlaveGameObject ? (IAnimatedCharacter*) pSlaveGameObject->QueryExtension("AnimatedCharacter") : NULL;
if(pSlaveAnimChar && pSlaveAnimChar->GetActionController())
{
IAnimationDatabaseManager &dbManager = gEnv->pGame->GetIGameFramework()->GetMannequinInterface().GetAnimationDatabaseManager();
uint32 db_crc32 = CCrc32::ComputeLowercase(GetPortString(pActInfo, EIP_DB));
const IAnimationDatabase* db = dbManager .FindDatabase(db_crc32);
const string& scopeContextName = GetPortString(pActInfo, EIP_ScopeContext);
const string& requestedScopeContext = scopeContextName.empty() ? "SlaveChar" : scopeContextName;
const TagID scopeContext = pAnimChar->GetActionController()->GetContext().controllerDef.m_scopeContexts.Find(scopeContextName.c_str());
pAnimChar->GetActionController()->SetSlaveController(*pSlaveAnimChar->GetActionController(), scopeContext, IsPortActive(pActInfo, EIP_Enslave) ? true : false, db);
ActivateOutput(pActInfo, EOP_Success, 1 );
}
else
{
CryWarning( VALIDATOR_MODULE_GAME, VALIDATOR_ERROR, "No GameObject or Animated character found for the slave");
ActivateOutput(pActInfo, EOP_Fail, 1 );
}
}
else
{
CryWarning( VALIDATOR_MODULE_GAME, VALIDATOR_ERROR, "No GameObject or AnimatedCharacter found");
ActivateOutput(pActInfo, EOP_Fail, 1 );
}
}
break;
}
}
示例2: RemoveTargetFromSlaveContext
void CActionCoopAnimation::RemoveTargetFromSlaveContext()
{
IAnimatedCharacter* pTargetAnimChar = m_targetEntityID ? m_target.GetAnimatedCharacter() : NULL;
IActionController* pTargetActionController = pTargetAnimChar ? pTargetAnimChar->GetActionController() : NULL;
if(pTargetActionController)
{
IAnimatedCharacter* pAnimChar = m_player.GetAnimatedCharacter();
IActionController* pActionController = pAnimChar->GetActionController();
pActionController->SetSlaveController(*pTargetActionController, PlayerMannequin.contextIDs.SlaveChar, false, m_piOptionalTargetDatabase);
CRecordingSystem* pRecordingSystem = g_pGame->GetRecordingSystem();
if (pRecordingSystem)
{
pRecordingSystem->OnMannequinSetSlaveController(m_rootScope->GetEntityId(), pTargetActionController->GetEntityId(), PlayerMannequin.contextIDs.SlaveChar, false, m_piOptionalTargetDatabase);
}
}
else
{
m_rootScope->GetActionController().ClearScopeContext(PlayerMannequin.contextIDs.SlaveChar);
}
}
示例3: InitMannequinParams
void CMountedGunController::InitMannequinParams()
{
CRY_ASSERT(g_pGame);
IGameFramework* pGameFramework = g_pGame->GetIGameFramework();
CRY_ASSERT(pGameFramework);
CMannequinUserParamsManager& mannequinUserParams = pGameFramework->GetMannequinInterface().GetMannequinUserParamsManager();
CRY_ASSERT(m_pControlledPlayer);
IAnimatedCharacter* pAnimatedCharacter = m_pControlledPlayer->GetAnimatedCharacter();
CRY_ASSERT(pAnimatedCharacter);
IActionController* pActionController = pAnimatedCharacter->GetActionController();
m_pMannequinParams = mannequinUserParams.FindOrCreateParams<SMannequinMountedGunParams>(pActionController);
MountedGunCRCs.Init();
}