Advertisement
Guest User

Untitled

a guest
Jun 27th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. FTransform AEBFBaseSpell::GetTransformInCircle(FVector Center, float Radius)
  2. {
  3.     float Degrees = ((360.f / (float)BaseSpellInfo.NumOfObjectsToSpawn) * (float)NumOfSpawnedObjects);
  4.     float x = Radius * FMath::Sin(FMath::DegreesToRadians(Degrees));
  5.     float y = Radius * FMath::Cos(FMath::DegreesToRadians(Degrees));
  6.  
  7.     Center.X += x;
  8.     Center.Y += y;
  9.  
  10.     FRotator Rot = UKismetMathLibrary::FindLookAtRotation(GetActorForwardVector(), GetActorLocation() - Center);
  11.     Rot.Yaw -= 90.f;
  12.     FQuat FinalRotation = FQuat(Rot);
  13.  
  14.     FTransform FinalTransform = FTransform();
  15.     FinalTransform.SetLocation(Center);
  16.     FinalTransform.SetRotation(FinalRotation);
  17.  
  18.     return FinalTransform;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement