log view location and rotation

This commit is contained in:
Tyrel Souza 2018-02-19 22:28:52 -05:00
parent 2f67151c4a
commit 96071d32fa

View File

@ -1,7 +1,10 @@
// Tyrel Souza 2018
#include "Grabber.h"
#include "Engine/World.h"
#include "GameFramework/Actor.h"
#define OUT
// Sets default values for this component's properties
UGrabber::UGrabber()
@ -27,6 +30,29 @@ void UGrabber::TickComponent(float DeltaTime, ELevelTick TickType, FActorCompone
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
// Get player View point in this tick
FVector PlayerViewpointLocation;
FRotator PlayerViewpointRotation;
GetWorld()->GetFirstPlayerController(
)->GetPlayerViewPoint(
OUT PlayerViewpointLocation,
OUT PlayerViewpointRotation
);
UE_LOG(LogTemp,
Warning,
TEXT("View Point at %s rotating %s"),
*PlayerViewpointLocation.ToString(),
*PlayerViewpointRotation.ToString()
);
// Ray-Cast out to reach distance
// See what we hit
}