| 3561 | } |
| 3562 | |
| 3563 | void AAlsxtCharacter::SetPhysicalAnimationMode(const FGameplayTag& NewPhysicalAnimationModeTag, const TArray<FName>& BoneNames) |
| 3564 | { |
| 3565 | if (GetPhysicalAnimationState().Mode != NewPhysicalAnimationModeTag && GetPhysicalAnimationState().AffectedBonesBelow != BoneNames) |
| 3566 | { |
| 3567 | GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Yellow, TEXT("SetPhysicalAnimationMode")); |
| 3568 | const auto PreviousPhysicalAnimationMode{ PhysicalAnimationMode }; |
| 3569 | |
| 3570 | if (NewPhysicalAnimationModeTag == AlsxtPhysicalAnimationModeTags::None || NewPhysicalAnimationModeTag == FGameplayTag::EmptyTag) |
| 3571 | { |
| 3572 | GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Yellow, TEXT("ALSXTPhysicalAnimationModeTags::None")); |
| 3573 | PhysicalAnimationMode = AlsxtPhysicalAnimationModeTags::None; |
| 3574 | GetMesh()->SetCollisionProfileName("CharacterMesh"); |
| 3575 | PhysicalAnimation->ApplyPhysicalAnimationProfileBelow("pelvis", "Default", true, false); |
| 3576 | GetCapsuleComponent()->SetCapsuleRadius(25); |
| 3577 | FAlsxtPhysicalAnimationState NewPhysicalAnimationState; |
| 3578 | NewPhysicalAnimationState.Mode = FGameplayTag::EmptyTag; |
| 3579 | NewPhysicalAnimationState.ProfileName = "CharacterMesh"; |
| 3580 | SetPhysicalAnimationState(NewPhysicalAnimationState); |
| 3581 | FAlsxtDefensiveModeState NewDefensiveModeState = GetDefensiveModeState(); |
| 3582 | NewDefensiveModeState.Mode = AlsxtPhysicalAnimationModeTags::None; |
| 3583 | NewDefensiveModeState.AnticipationMode = FGameplayTag::EmptyTag; |
| 3584 | NewDefensiveModeState.ObstacleMode = FGameplayTag::EmptyTag; |
| 3585 | NewDefensiveModeState.AnticipationSide = FGameplayTag::EmptyTag; |
| 3586 | NewDefensiveModeState.AnticipationHeight = FGameplayTag::EmptyTag; |
| 3587 | NewDefensiveModeState.ObstacleSide = FGameplayTag::EmptyTag; |
| 3588 | NewDefensiveModeState.ObstacleHeight = FGameplayTag::EmptyTag; |
| 3589 | NewDefensiveModeState.AnticipationTransform = {{0, 0, 0}, {0, 0, 0}, { 0, 0, 0 }}; |
| 3590 | NewDefensiveModeState.ObstacleTransform = {{0, 0, 0}, {0, 0, 0}, { 0, 0, 0 }}; |
| 3591 | NewDefensiveModeState.AnticipationForm = FGameplayTag::EmptyTag; |
| 3592 | SetDefensiveModeState(NewDefensiveModeState); |
| 3593 | OnPhysicalAnimationModeChanged(PreviousPhysicalAnimationMode); |
| 3594 | StartBlendOutPhysicalAnimation(); |
| 3595 | return; |
| 3596 | // GetMesh()->SetAllBodiesSimulatePhysics(false); |
| 3597 | } |
| 3598 | if (NewPhysicalAnimationModeTag == AlsxtPhysicalAnimationModeTags::Navigation) |
| 3599 | { |
| 3600 | GetMesh()->SetCollisionProfileName("PhysicalAnimation"); |
| 3601 | GetCapsuleComponent()->SetCapsuleRadius(14); |
| 3602 | |
| 3603 | // GetMesh()->SetAllBodiesBelowSimulatePhysics("pelvis", true, false); |
| 3604 | // PhysicalAnimation->ApplyPhysicalAnimationProfileBelow("pelvis", "Hit", false, false); |
| 3605 | FAlsxtPhysicalAnimationState NewPhysicalAnimationState; |
| 3606 | NewPhysicalAnimationState.AffectedBonesBelow = BoneNames; |
| 3607 | NewPhysicalAnimationState.Alpha = 0.5; |
| 3608 | NewPhysicalAnimationState.Mode = AlsxtPhysicalAnimationModeTags::Navigation; |
| 3609 | NewPhysicalAnimationState.ProfileName = "Bump"; |
| 3610 | |
| 3611 | for (FName BoneName : BoneNames) |
| 3612 | { |
| 3613 | PhysicalAnimation->ApplyPhysicalAnimationProfileBelow(BoneName, "Bump", false, false); |
| 3614 | GetMesh()->SetAllBodiesBelowSimulatePhysics(BoneName, true, true); |
| 3615 | GetMesh()->SetAllBodiesBelowPhysicsBlendWeight(BoneName, 0.5f, false, true); |
| 3616 | } |
| 3617 | |
| 3618 | SetPhysicalAnimationState(NewPhysicalAnimationState); |
| 3619 | //StartBlendOutPhysicalAnimation(); |
| 3620 | PhysicalAnimationMode = NewPhysicalAnimationModeTag; |
nothing calls this directly
no outgoing calls
no test coverage detected