Skip to content
Snippets Groups Projects
Select Git revision
  • b0060790008e0b64eb3239143e842953a9a74675
  • dev/5.3 default
  • feature/scaleTeleport
  • feature/scaleAndHeightTeleport
  • 5.3
  • 5.0
  • TempNav
  • fix/DisplayClusterTemplateCode
  • fix_5.3/DisplayClusterTemplateFix
  • ReworkedToolkit
  • dev/5.2
  • feature/make_interaction_ray_accesible
  • dev/5.1
  • 4.27
  • 4.26 protected
  • 4.22
  • 4.21
17 results

GrabbingBehaviorOnLineVisualizer.cpp

Blame
  • user avatar
    Kamil Karwacki authored and Simon Oehrl committed
    initial commit, this feature will extend the pawn to be able to grab Actors which implement the Grabable interface, the default grabbing behavior can be extended by adding a GrabbingBehaviorComponent
    aaf32e49
    History
    GrabbingBehaviorOnLineVisualizer.cpp 1.00 KiB
    // Fill out your copyright notice in the Description page of Project Settings.
    
    
    #include "GrabbingBehaviorOnLineVisualizer.h"
    #include "GrabbingBehaviorOnLineComponent.h"
    
    #include "SceneManagement.h"
    
    FGrabbingBehaviorOnLineVisualizer::FGrabbingBehaviorOnLineVisualizer()
    {
    }
    
    FGrabbingBehaviorOnLineVisualizer::~FGrabbingBehaviorOnLineVisualizer()
    {
    }
    
    
    // Fill out your copyright notice in the Description page of Project Settings.
    
    void FGrabbingBehaviorOnLineVisualizer::DrawVisualization(const UActorComponent* Component, const FSceneView* View, FPrimitiveDrawInterface* PDI) {
    
    
    	const UGrabbingBehaviorOnLineComponent* LineBehavior = Cast<const UGrabbingBehaviorOnLineComponent>(Component);
    
    	if (LineBehavior != nullptr)
    	{
    		FVector Attachment = LineBehavior->GetComponentLocation();
    		FVector Forward = LineBehavior->GetComponentQuat().GetUpVector();
    		float Distance = LineBehavior->GetDistance();
    
    		PDI->DrawLine(Attachment + Forward * Distance, Attachment - Forward * Distance, FColor::Blue, SDPG_World);
    	}
    }