本文整理汇总了C++中ACharacter::GetActorRotation方法的典型用法代码示例。如果您正苦于以下问题:C++ ACharacter::GetActorRotation方法的具体用法?C++ ACharacter::GetActorRotation怎么用?C++ ACharacter::GetActorRotation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ACharacter
的用法示例。
在下文中一共展示了ACharacter::GetActorRotation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnDestroy
void UAbilityTask_ApplyRootMotionMoveToActorForce::OnDestroy(bool AbilityIsEnding)
{
if (MovementComponent)
{
MovementComponent->RemoveRootMotionSourceByID(RootMotionSourceID);
if (bSetNewMovementMode)
{
MovementComponent->SetMovementMode(NewMovementMode);
}
if (VelocityOnFinishMode == ERootMotionFinishVelocityMode::SetVelocity)
{
FVector EndVelocity;
ACharacter* Character = MovementComponent->GetCharacterOwner();
if (Character)
{
EndVelocity = Character->GetActorRotation().RotateVector(SetVelocityOnFinish);
}
else
{
EndVelocity = SetVelocityOnFinish;
}
// When we mean to SetVelocity when finishing a MoveTo, we apply a short-duration low-priority
// root motion velocity override. This ensures that the velocity we set is replicated properly
// and takes effect.
{
const FName OnFinishForceName = FName("AbilityTaskApplyRootMotionMoveToActorForce_EndForce");
FRootMotionSource_ConstantForce* ConstantForce = new FRootMotionSource_ConstantForce();
ConstantForce->InstanceName = OnFinishForceName;
ConstantForce->AccumulateMode = ERootMotionAccumulateMode::Override;
ConstantForce->Priority = 1; // Low priority so any other override root motion sources stomp it
ConstantForce->Force = EndVelocity;
ConstantForce->Duration = 0.001f;
MovementComponent->ApplyRootMotionSource(ConstantForce);
if (Ability)
{
Ability->SetMovementSyncPoint(OnFinishForceName);
}
}
}
}
Super::OnDestroy(AbilityIsEnding);
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:47,代码来源:AbilityTask_ApplyRootMotionMoveToActorForce.cpp
示例2: ChangeSize
void UCheatManager::ChangeSize( float F )
{
APawn* Pawn = GetOuterAPlayerController()->GetPawn();
// Note: only works on characters
ACharacter *Character = Cast<ACharacter>(Pawn);
if (Character)
{
ACharacter* DefaultCharacter = Character->GetClass()->GetDefaultObject<ACharacter>();
Character->GetCapsuleComponent()->SetCapsuleSize(DefaultCharacter->GetCapsuleComponent()->GetUnscaledCapsuleRadius() * F, DefaultCharacter->GetCapsuleComponent()->GetUnscaledCapsuleHalfHeight() * F);
if (Character->GetMesh())
{
Character->GetMesh()->SetRelativeScale3D(FVector(F));
}
Character->TeleportTo(Character->GetActorLocation(), Character->GetActorRotation());
}
}