Skip to content
Snippets Groups Projects
Select Git revision
  • c24fe9864a846139ca7a6632d2ce14044218a545
  • 5.4 default protected
  • feature/radialPOInav
3 results

PointOfInterest.cpp

Blame
  • Kris Helwig's avatar
    Kris Tabea Helwig authored
    Implemented PointOfInterest as position markers, PointOfInterestManager as Manager, splines that connect POIs, and camera rides;
    c24fe986
    History
    PointOfInterest.cpp 951 B
    #include "PointOfInterest.h"
    
    #include "Logging/StructuredLog.h"
    #include "Components/BillboardComponent.h"
    
    DEFINE_LOG_CATEGORY(POILog)
    
    APointOfInterest::APointOfInterest()
    {
    	UE_LOGFMT(POILog, Verbose, "POI instantiated");
    
    	SetRootComponent(CreateDefaultSubobject<USceneComponent>("SceneComponent"));
    
    	auto Billboard = CreateDefaultSubobject<UBillboardComponent>("BillboardComponent");
    
    	static ConstructorHelpers::FObjectFinder<UTexture2D> LocationMarker(TEXT("/Script/Engine.Texture2D'/RWTHVRQuickStart/location_marker.location_marker'"));
    	if(LocationMarker.Succeeded())
    	{
    		Billboard->SetSprite(LocationMarker.Object);
    	}
    	else
    	{
    		UE_LOGFMT(POILog, Verbose, "POILog: Could not find location marker Texture. The Asset might have moved.");
    	}
    	Billboard->AttachToComponent(RootComponent, FAttachmentTransformRules::SnapToTargetIncludingScale);
    	Billboard->SetHiddenInGame(true);
    	Billboard->SetWorldScale3D(FVector(0.1f, 0.1f, 0.1f));
    }