本文整理汇总了C++中IAnimatedCharacter类的典型用法代码示例。如果您正苦于以下问题:C++ IAnimatedCharacter类的具体用法?C++ IAnimatedCharacter怎么用?C++ IAnimatedCharacter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IAnimatedCharacter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Exit
virtual void Exit()
{
TPlayerAction::Exit();
IAnimatedCharacter* pAnimChar = m_player.GetAnimatedCharacter();
if( pAnimChar )
{
pAnimChar->SetMovementControlMethods(eMCM_Entity, eMCM_Entity);
pAnimChar->ForceRefreshPhysicalColliderMode();
pAnimChar->RequestPhysicalColliderMode(eColliderMode_Undefined, eColliderModeLayer_Game, "CActionLedgeGrab::Enter()");
}
if (!m_haveUnHolsteredWeapon)
{
m_haveUnHolsteredWeapon=true;
m_player.HolsterItem_NoNetwork(false, true, 0.5f);
}
m_player.PartialAnimationControlled( false, PlayerCameraAnimationSettings() );
SPlayerStats *pPlayerStats = m_player.GetActorStats();
pPlayerStats->forceSTAP = SPlayerStats::eFS_None;
pPlayerStats->bDisableTranslationPinning=false;
m_player.StateMachineHandleEventMovement( PLAYER_EVENT_LEDGE_ANIM_FINISHED );
}
示例2: Enter
virtual void Enter()
{
TPlayerAction::Enter();
IAnimatedCharacter* pAnimChar = m_player.GetAnimatedCharacter();
if( pAnimChar )
{
pAnimChar->SetMovementControlMethods(eMCM_Animation, eMCM_Animation);
pAnimChar->RequestPhysicalColliderMode(eColliderMode_Disabled, eColliderModeLayer_Game, "CActionLedgeGrab::Enter()");
}
switch (m_transitionType)
{
case SLedgeTransitionData::eOLT_VaultOverIntoFall:
case SLedgeTransitionData::eOLT_VaultOnto:
case SLedgeTransitionData::eOLT_VaultOver:
case SLedgeTransitionData::eOLT_HighVaultOverIntoFall:
case SLedgeTransitionData::eOLT_HighVaultOnto:
case SLedgeTransitionData::eOLT_HighVaultOver:
break;
default:
{
PlayerCameraAnimationSettings cameraAnimationSettings;
cameraAnimationSettings.positionFactor = 1.0f;
cameraAnimationSettings.rotationFactor = g_pGameCVars->pl_ledgeClamber.cameraBlendWeight;
m_player.PartialAnimationControlled( true, cameraAnimationSettings );
}
break;
}
}
示例3: SetMovementParameters
void CAnimActionAIStance::SetMovementParameters()
{
IAnimatedCharacter* pAnimatedCharacter = m_pPlayer->GetAnimatedCharacter();
if ( pAnimatedCharacter )
{
CAIAnimationComponent* pAnimationComponent = m_pPlayer->GetAIAnimationComponent();
CRY_ASSERT( pAnimationComponent );
if (pAnimationComponent->GetUseLegacyCoverLocator())
{
const bool toCoverStance = ( m_targetStance == STANCE_HIGH_COVER || m_targetStance == STANCE_LOW_COVER );
if ( toCoverStance )
{
pAnimatedCharacter->SetMovementControlMethods( eMCM_Entity, eMCM_Entity );
pAnimatedCharacter->UseAnimationMovementForEntity( true, true, false );
}
else
{
pAnimatedCharacter->SetMovementControlMethods( eMCM_AnimationHCollision, eMCM_Entity );
}
}
else
{
pAnimatedCharacter->SetMovementControlMethods( eMCM_AnimationHCollision, eMCM_Entity );
}
}
}
示例4: SendStateEventCoopAnim
void CActionCoopAnimation::Exit()
{
SendStateEventCoopAnim();
TPlayerAction::Exit();
IAnimatedCharacter* pAnimChar = m_player.GetAnimatedCharacter();
IAnimatedCharacter* pAnimCharTarget = m_targetEntityID ? m_target.GetAnimatedCharacter() : NULL;
if( pAnimChar )
{
pAnimChar->SetMovementControlMethods(eMCM_Entity, eMCM_Entity);
pAnimChar->ForceRefreshPhysicalColliderMode();
pAnimChar->RequestPhysicalColliderMode(eColliderMode_Undefined, eColliderModeLayer_Game, "CActionStealthKill::Exit()");
}
if (pAnimCharTarget)
{
pAnimCharTarget->SetMovementControlMethods(eMCM_Entity, eMCM_Entity);
pAnimCharTarget->ForceRefreshPhysicalColliderMode();
pAnimCharTarget->RequestPhysicalColliderMode(eColliderMode_Undefined, eColliderModeLayer_Game, "CActionStealthKill::Exit()");
}
RemoveTargetFromSlaveContext();
m_player.PartialAnimationControlled( false, PlayerCameraAnimationSettings());
m_player.GetActorStats()->animationControlledID = 0;
m_player.HolsterItem(false);
// Update visibility to change render mode of 1st person character
m_player.RefreshVisibilityState();
}
示例5: CRY_ASSERT
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();
}
示例6: 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;
}
}
示例7: RestoreMovementParameters
void CAnimActionAIStance::RestoreMovementParameters()
{
// We are currently not storing the parameters from SetMovementParameters, but going back to hopefully reasonable defaults instead.
IAnimatedCharacter* pAnimatedCharacter = m_pPlayer->GetAnimatedCharacter();
if ( pAnimatedCharacter )
{
pAnimatedCharacter->SetMovementControlMethods( eMCM_Entity, eMCM_Entity );
CAIAnimationComponent* pAnimationComponent = m_pPlayer->GetAIAnimationComponent();
CRY_ASSERT( pAnimationComponent );
if (pAnimationComponent->GetUseLegacyCoverLocator())
{
pAnimatedCharacter->UseAnimationMovementForEntity( false, false, false );
}
}
}
示例8: RestorePlayerPhysics
void CPlayerStateUtil::RestorePlayerPhysics( CPlayer& player )
{
IAnimatedCharacter* pAC = player.GetAnimatedCharacter();
if( pAC )
{
SAnimatedCharacterParams params;
params = pAC->GetParams();
params.inertia = player.GetInertia();
params.inertiaAccel = player.GetInertiaAccel();
params.timeImpulseRecover = player.GetTimeImpulseRecover();
player.SetAnimatedCharacterParams( params );
}
}
示例9: DisableGrabbedAnimatedCharacter
/**
* Turn the grabbed AnimatedCharacter on/off if necessary. If the grabbed thing
* has an AC, it's necessary to turn it off during the grab to prevent it from
* interfering and messing with its Entity's transformation.
*/
void CBaseGrabHandler::DisableGrabbedAnimatedCharacter (bool enable) const
{
CActor *pGrabbedActor = (CActor *)g_pGame->GetIGameFramework()->GetIActorSystem()->GetActor(m_grabStats.grabId);
if ( ! pGrabbedActor) return;
IAnimatedCharacter * pGrabbedAC = pGrabbedActor->GetAnimatedCharacter();
if (pGrabbedAC)
pGrabbedAC->SetNoMovementOverride (enable);
// SActorStats *stats = static_cast<SActorStats*>(pGrabbedActor->GetActorStats());
// stats->isGrabbed = enable;
if(pGrabbedActor->IsClient())
{
if(SActorStats *stats = static_cast<SActorStats*>(pGrabbedActor->GetActorStats()))
stats->isGrabbed = enable;
}
}
示例10: Enter
virtual void Enter()
{
LadderLog ("Entering %s instance for %s", GetName(), m_player.GetEntity()->GetEntityTextDescription());
LadderLogIndent();
TPlayerAction::Enter();
IAnimatedCharacter* pAnimChar = m_player.GetAnimatedCharacter();
if (pAnimChar)
{
EMovementControlMethod method = m_interruptable ? eMCM_Entity : eMCM_Animation;
pAnimChar->SetMovementControlMethods(method, method);
}
m_player.BlendPartialCameraAnim(m_cameraAnimFactorAtStart, 0.1f);
m_player.SetCanTurnBody(false);
m_ladderState->InformLadderAnimEnter(m_player, this);
}
示例11: CRY_ASSERT_MESSAGE
void CMountedGunController::OnLeave( )
{
CRY_ASSERT_MESSAGE(m_pControlledPlayer, "Controlled player not initialized");
ICharacterInstance* pCharacter = m_pControlledPlayer->IsThirdPerson() ? m_pControlledPlayer->GetEntity()->GetCharacter(0) : m_pControlledPlayer->GetShadowCharacter();
if (pCharacter)
{
if(m_pMovementAction)
{
m_pMovementAction->ForceFinish();
SAFE_RELEASE(m_pMovementAction);
}
CRecordingSystem* pRecordingSystem = g_pGame->GetRecordingSystem();
if (pRecordingSystem)
{
pRecordingSystem->OnMountedGunLeave(m_pControlledPlayer);
}
IAnimatedCharacter* pAnimatedCharacter = m_pControlledPlayer->GetAnimatedCharacter();
CRY_ASSERT(pAnimatedCharacter);
pAnimatedCharacter->ForceRefreshPhysicalColliderMode();
pAnimatedCharacter->RequestPhysicalColliderMode(eColliderMode_Undefined, eColliderModeLayer_Game, "CMountedGunController::OnLeave");
pAnimatedCharacter->SetNoMovementOverride(false);
if (gEnv->bMultiplayer || m_pControlledPlayer->IsPlayer())
pAnimatedCharacter->DisableRigidCollider();
pAnimatedCharacter->GetGroundAlignmentParams().SetFlag(eGA_AllowWithNoCollision, true);
m_pControlledPlayer->GetActorParams().mountedWeaponCameraTarget.zero();
}
}
示例12: 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);
}
}
示例13: GetActor
int CScriptBind_Actor::SetMovementControlledByAnimation(IFunctionHandler *pH, bool enable)
{
CActor *pActor = GetActor(pH);
if (!pActor)
return pH->EndFunction();
IAnimatedCharacter* pAnimChar = pActor->GetAnimatedCharacter();
if (!pAnimChar)
return pH->EndFunction();
if(enable)
{
pAnimChar->SetMovementControlMethods(eMCM_AnimationHCollision, eMCM_Animation);
pAnimChar->UseAnimationMovementForEntity( true, true, true );
}
else
{
pAnimChar->SetMovementControlMethods( eMCM_Entity, eMCM_Entity );
pAnimChar->UseAnimationMovementForEntity( false, false, false );
}
return pH->EndFunction();
}
示例14: targetPos
void CActionCoopAnimation::Enter()
{
TPlayerAction::Enter();
QuatT targetPos(m_rootScope->GetEntity().GetPos(), m_rootScope->GetEntity().GetRotation());
SetParam("TargetPos", targetPos);
CRecordingSystem* pRecordingSystem = g_pGame->GetRecordingSystem();
if (pRecordingSystem)
{
pRecordingSystem->OnMannequinSetParam(m_rootScope->GetEntityId(), "TargetPos", targetPos);
}
IAnimatedCharacter* pAnimChar = m_player.GetAnimatedCharacter();
IAnimatedCharacter* pAnimCharTarget = m_target.GetAnimatedCharacter();
if( pAnimChar )
{
pAnimChar->SetMovementControlMethods(eMCM_Animation, eMCM_Animation);
pAnimChar->RequestPhysicalColliderMode(eColliderMode_Disabled, eColliderModeLayer_Game, "CActionStealthKill::Enter()");
}
if (pAnimCharTarget)
{
pAnimCharTarget->SetMovementControlMethods(eMCM_Animation, eMCM_Animation);
pAnimCharTarget->RequestPhysicalColliderMode(eColliderMode_Disabled, eColliderModeLayer_Game, "CActionStealthKill::Enter()");
}
PlayerCameraAnimationSettings cameraAnimationSettings;
cameraAnimationSettings.positionFactor = 1.0f;
cameraAnimationSettings.rotationFactor = 1.0f;
cameraAnimationSettings.stableBlendOff = true;
m_player.PartialAnimationControlled( true, cameraAnimationSettings );
m_player.GetActorStats()->animationControlledID = m_target.GetEntityId();
m_player.HolsterItem(true);
// Update visibility to change render mode of 1st person character
m_player.RefreshVisibilityState();
// Mannequin can't set the tag's correctly on the exit, so we have to do it immediately after we started instead :)
// the tags are set, but Exit() is called too late for our purposes, it is needed during the resolve of the next action
m_rootScope->GetActionController().GetContext().state.Set(m_targetTagID, false);
}
示例15: MeleeDebugLog
//------------------------------------------------------------------------
int CMelee::Hit(const Vec3 &pt, const Vec3 &dir, const Vec3 &normal, IPhysicalEntity *pCollider, EntityId collidedEntityId, int partId, int ipart, int surfaceIdx, bool remote)
{
MeleeDebugLog ("CMelee<%p> HitPointDirNormal(remote=%s)", this, remote ? "true" : "false");
int hitTypeID = 0;
CActor *pOwnerActor = m_pWeapon->GetOwnerActor();
if (pOwnerActor)
{
IActor* pTargetActor = g_pGame->GetIGameFramework()->GetIActorSystem()->GetActor(collidedEntityId);
IEntity* pTarget = pTargetActor ? pTargetActor->GetEntity() : gEnv->pEntitySystem->GetEntity(collidedEntityId);
IEntity* pOwnerEntity = pOwnerActor->GetEntity();
IAIObject* pOwnerAI = pOwnerEntity->GetAI();
float damageScale = 1.0f;
bool silentHit = false;
if(pTargetActor)
{
IAnimatedCharacter* pTargetAC = pTargetActor->GetAnimatedCharacter();
IAnimatedCharacter* pOwnerAC = pOwnerActor->GetAnimatedCharacter();
if(pTargetAC && pOwnerAC)
{
Vec3 targetFacing(pTargetAC->GetAnimLocation().GetColumn1());
Vec3 ownerFacing(pOwnerAC->GetAnimLocation().GetColumn1());
float ownerFacingDot = ownerFacing.Dot(targetFacing);
float fromBehindDot = cos_tpl(DEG2RAD(g_pGameCVars->pl_melee.angle_limit_from_behind));
if(ownerFacingDot > fromBehindDot)
{
#ifndef _RELEASE
if (g_pGameCVars->g_LogDamage)
{
CryLog ("[DAMAGE] %s '%s' is%s meleeing %s '%s' from behind (because %f > %f)",
pOwnerActor->GetEntity()->GetClass()->GetName(), pOwnerActor->GetEntity()->GetName(), silentHit ? " silently" : "",
pTargetActor->GetEntity()->GetClass()->GetName(), pTargetActor->GetEntity()->GetName(),
ownerFacingDot, fromBehindDot);
}
#endif
damageScale *= g_pGameCVars->pl_melee.damage_multiplier_from_behind;
}
}
}
// Send target stimuli
if (!gEnv->bMultiplayer)
{
IAISystem *pAISystem = gEnv->pAISystem;
ITargetTrackManager *pTargetTrackManager = pAISystem ? pAISystem->GetTargetTrackManager() : NULL;
if (pTargetTrackManager && pOwnerAI)
{
IAIObject *pTargetAI = pTarget ? pTarget->GetAI() : NULL;
if (pTargetAI)
{
const tAIObjectID aiOwnerId = pOwnerAI->GetAIObjectID();
const tAIObjectID aiTargetId = pTargetAI->GetAIObjectID();
TargetTrackHelpers::SStimulusEvent eventInfo;
eventInfo.vPos = pt;
eventInfo.eStimulusType = TargetTrackHelpers::eEST_Generic;
eventInfo.eTargetThreat = AITHREAT_AGGRESSIVE;
pTargetTrackManager->HandleStimulusEventForAgent(aiTargetId, aiOwnerId, "MeleeHit",eventInfo);
pTargetTrackManager->HandleStimulusEventInRange(aiOwnerId, "MeleeHitNear", eventInfo, 5.0f);
}
}
}
//Check if is a friendly hit, in that case FX and Hit will be skipped
bool isFriendlyHit = (pOwnerEntity && pTarget) ? IsFriendlyHit(pOwnerEntity, pTarget) : false;
if(!isFriendlyHit)
{
CPlayer * pAttackerPlayer = pOwnerActor->IsPlayer() ? static_cast<CPlayer*>(pOwnerActor) : NULL;
float damage = m_pMeleeParams->meleeparams.damage_ai;
if(pOwnerActor->IsPlayer())
{
damage = m_slideKick ? m_pMeleeParams->meleeparams.slide_damage : GetMeleeDamage();
}
#ifndef _RELEASE
if (pTargetActor && g_pGameCVars->g_LogDamage)
{
CryLog ("[DAMAGE] %s '%s' is%s meleeing %s '%s' applying damage = %.3f x %.3f = %.3f",
pOwnerActor->GetEntity()->GetClass()->GetName(), pOwnerActor->GetEntity()->GetName(), silentHit ? " silently" : "",
pTargetActor->GetEntity()->GetClass()->GetName(), pTargetActor->GetEntity()->GetName(),
damage, damageScale, damage * damageScale);
}
#endif
//Generate Hit
if(pTarget)
{
CGameRules *pGameRules = g_pGame->GetGameRules();
CRY_ASSERT_MESSAGE(pGameRules, "No game rules! Melee can not apply hit damage");
//.........这里部分代码省略.........