From 73dc2c820d51ed00286e15b745eabc29760e2d78 Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Mon, 19 Feb 2018 22:47:22 -0500 Subject: [PATCH] debug line for grab range --- RoomEscape/Content/NewMap.umap | Bin 1338299 -> 1338299 bytes RoomEscape/Content/NewMap_BuiltData.uasset | Bin 1472688 -> 1472688 bytes RoomEscape/Source/RoomEscape/Grabber.cpp | 29 +++++++++++++++++---- RoomEscape/Source/RoomEscape/Grabber.h | 4 ++- RoomEscape/Source/RoomEscape/OpenDoor.h | 1 + 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/RoomEscape/Content/NewMap.umap b/RoomEscape/Content/NewMap.umap index d643376bf9f0758ffaaec6119df648acea73413e..85391d523021cf2b4b77d3552c829879fa5e791a 100644 GIT binary patch delta 152 zcmdmeJ#hE+zzHt}c0IeIJZDy;I}mdKG3WO6@mzJUd2gN%b<#?j=6E2Q(>ZGTL{)A>_6P9?!aOXUr+IP9 jw)cB;12GQ}^8zs+5c31E01yiTu@DdoZ}0aO(NO>Z@MS%x delta 153 zcmdmeJ#hE+zzHt}K412JcTil_XLpiE`QeQwhd2J*6vtwyXJF90KE8c@JR=Y@0WmWW zvj8zG5VHX>I}mdKG3WO6@mzJUd8;Dioqz1`abC+9;}kW0qAIrm$KkK*of#iqcADnJ kE!*Dj%?-pnK+Frod_c?(!~#Gp2*g4_EWEwnTSP|z0Ld0V&j0`b diff --git a/RoomEscape/Content/NewMap_BuiltData.uasset b/RoomEscape/Content/NewMap_BuiltData.uasset index 6273f8ce2383fc6f92fedf6389beadd1edb5c8e4..72c22102bcd0d0d5e37ae81d2f8e6fae39048eaa 100644 GIT binary patch delta 95 zcmV~$Ee?VJ0D#e{2r56~?rgiW#mk#|>_AhkHDHJVv)aRMsi= delta 95 zcmV~$Ee?VJ0D#en0*avcNAemJHw*IwHcnu7bE6WzLL#vlJiyl|-pR@hd~clUajN@w ye(9do?UPo+{rq}de`PDqFu*x3FvJLBT;d87Tw{tEZg7h^?r@I>JmTqV5jTIezbDxM diff --git a/RoomEscape/Source/RoomEscape/Grabber.cpp b/RoomEscape/Source/RoomEscape/Grabber.cpp index 4f9a412..404faed 100644 --- a/RoomEscape/Source/RoomEscape/Grabber.cpp +++ b/RoomEscape/Source/RoomEscape/Grabber.cpp @@ -3,6 +3,7 @@ #include "Grabber.h" #include "Engine/World.h" #include "GameFramework/Actor.h" +#include "Public/DrawDebugHelpers.h" #define OUT @@ -39,14 +40,32 @@ void UGrabber::TickComponent(float DeltaTime, ELevelTick TickType, FActorCompone OUT PlayerViewpointRotation ); + FVector LineTraceEnd = PlayerViewpointLocation + PlayerViewpointRotation.Vector() * Reach; - UE_LOG(LogTemp, - Warning, - TEXT("View Point at %s rotating %s"), - *PlayerViewpointLocation.ToString(), - *PlayerViewpointRotation.ToString() + DrawDebugLine( + GetWorld(), + PlayerViewpointLocation, + LineTraceEnd, + FColor(255, 0, 0), + false, + 0.f, + 0, + 5.0f ); + //UE_LOG(LogTemp, + // Warning, + // TEXT("Location: %s Rotation: %s"), + // *PlayerViewpointLocation.ToString(), + // *PlayerViewpointRotation.ToString() + //); + + //UE_LOG(LogTemp, + // Warning, + // TEXT("LineTraceEnd: %s"), + // *LineTraceEnd.ToString() + //); + // Ray-Cast out to reach distance diff --git a/RoomEscape/Source/RoomEscape/Grabber.h b/RoomEscape/Source/RoomEscape/Grabber.h index 29b199e..f068888 100644 --- a/RoomEscape/Source/RoomEscape/Grabber.h +++ b/RoomEscape/Source/RoomEscape/Grabber.h @@ -24,6 +24,8 @@ public: // Called every frame virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; - +private: + float Reach = 100.f; + }; diff --git a/RoomEscape/Source/RoomEscape/OpenDoor.h b/RoomEscape/Source/RoomEscape/OpenDoor.h index 02e98c9..b9e07da 100644 --- a/RoomEscape/Source/RoomEscape/OpenDoor.h +++ b/RoomEscape/Source/RoomEscape/OpenDoor.h @@ -40,4 +40,5 @@ private: AActor* ActorThatOpens; AActor* OwningDoor; + };