Skip to content
Snippets Groups Projects
Select Git revision
  • 5a26fefa1ade9917ed7efb21111273982c4d621a
  • 5.4 default protected
  • 5.5
  • feature/radialPOInav
4 results

PointOfInterest.cpp

Blame
  • PointOfInterest.cpp 896 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->SetupAttachment(RootComponent);
    	
    	Billboard->SetHiddenInGame(true);
    	Billboard->SetWorldScale3D(FVector(0.1f, 0.1f, 0.1f));
    }