From 96071d32fa0342c76acdd1efb9385f91d5a0ef75 Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Mon, 19 Feb 2018 22:28:52 -0500 Subject: [PATCH] log view location and rotation --- RoomEscape/Source/RoomEscape/Grabber.cpp | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/RoomEscape/Source/RoomEscape/Grabber.cpp b/RoomEscape/Source/RoomEscape/Grabber.cpp index e2baba8..4f9a412 100644 --- a/RoomEscape/Source/RoomEscape/Grabber.cpp +++ b/RoomEscape/Source/RoomEscape/Grabber.cpp @@ -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 + + }