コード例 #1
0
ファイル: ActionCoopAnim.cpp プロジェクト: aronarts/FireNET
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);
}