Select Git revision
PointOfInterest.cpp

Kris Tabea Helwig authored
Implemented PointOfInterest as position markers, PointOfInterestManager as Manager, splines that connect POIs, and camera rides;
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));
}