Skip to content
Snippets Groups Projects
Select Git revision
  • 4ce31f71ae79722cd2a20b66b669a3bbf773715c
  • feature/refactor default protected
  • main
3 results

TeleportControllerBP.uasset

Blame
  • PointCloud.h 1.81 KiB
    #pragma once
    #include "CoreMinimal.h"
    #include "GPUPointCloudRendererComponent.h"
    #include "GameFramework/Actor.h"
    #include "MetaCastBachelor/DensityField.h"
    #include "PointCloud.generated.h"
    
    class UGPUPointCloudRendererComponent;
    UCLASS()
    class APointCloud : public AActor
    {
    	GENERATED_BODY()
    	
    public:
    	FDensityField* MyDensityField;
    	TArray<FVector> PositionVectors;
    	TArray<bool> DefaultFlags;
    	TArray<bool> SelectionFlags;
    	TArray<FColor> PointColors;
    	mutable FCriticalSection DataGuard;
    
    	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Bounds")
    	FVector MinBounds;
    
    	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Bounds")
    	FVector MaxBounds;
    	
    	UPROPERTY()
    	UGPUPointCloudRendererComponent* PointCloudVisualizer;
    	
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Visualization")
    	float SplatSize = 1.0f;
    	
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Files")
    	FFilePath PointInputData;
    
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Files")
    	FFilePath FlagInputData;
    	
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Materials")
    	UMaterialInterface* SelectedMaterial;
    	
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Materials")
    	UMaterialInterface* UnselectedMaterial;
    
    	// Sets default values for this actor's properties
    	APointCloud();
    	void InitPointCloudVisualizer();
    	void UpdateBounds();
    	void SetupDensityFieldFromPointCloud() const;
    
    protected:
    	// Called when the game starts or when spawned
    	virtual void BeginPlay() override;
    	
    
    public:
    	// Called every frame
    	virtual void Tick(float DeltaTime) override;
    
    	void UpdateSelection();
    	void DrawVoxel(const int Index, float Time) const;
    	void ColorPointsInVoxels(const TArray<int32> VoxelIndices);
    
    	UFUNCTION(BlueprintCallable)
    	void ReadPointCloudFromFile(FFilePath FileNamePoints, FFilePath FileNameFlags);
    
    };