9#include "Components/PrimitiveComponent.h"
10#include "UObject/SoftObjectPath.h"
11#include "UObject/ConstructorHelpers.h"
12#include "Engine/StaticMesh.h"
13#include "Materials/Material.h"
15UBoundsVisualizerComponent::UBoundsVisualizerComponent()
17 PrimaryComponentTick.bCanEverTick =
false;
19 SetCollisionEnabled(ECollisionEnabled::NoCollision);
21 bCastDynamicShadow =
false;
22 bCastStaticShadow =
false;
23 bVisibleInRayTracing =
false;
24 bVisibleInReflectionCaptures =
false;
25 bVisibleInRealTimeSkyCaptures =
false;
26 bAffectDynamicIndirectLighting =
false;
30 static ConstructorHelpers::FObjectFinder<UStaticMesh> MeshAsset(TEXT(
"/Engine/BasicShapes/Sphere"));
31 if (MeshAsset.Succeeded())
33 SetStaticMesh(MeshAsset.Object);
36 static ConstructorHelpers::FObjectFinder<UMaterial> MaterialAsset(TEXT(
"/Game/Agrarsense/Materials/Misc/M_GridWireFrame"));
37 if (MaterialAsset.Succeeded())
39 SetMaterial(0, MaterialAsset.Object);
43void UBoundsVisualizerComponent::BeginPlay()
51void UBoundsVisualizerComponent::SetSphereMesh()
53 FSoftObjectPath Path(TEXT(
"/Engine/BasicShapes/Sphere"));
54 UStaticMesh* Mesh = Cast<UStaticMesh>(Path.TryLoad());
62void UBoundsVisualizerComponent::SetCubeMesh()
64 FSoftObjectPath Path(TEXT(
"/Engine/BasicShapes/Cube"));
65 UStaticMesh* Mesh = Cast<UStaticMesh>(Path.TryLoad());
static void HideComponentForAllCameras(UPrimitiveComponent *PrimitiveComponent)