Skip to content

Instantly share code, notes, and snippets.

@Sammyjroberts
Created November 7, 2018 22:29
Show Gist options
  • Save Sammyjroberts/b6dc8becd5a1653ff0a49ee163902f3c to your computer and use it in GitHub Desktop.
Save Sammyjroberts/b6dc8becd5a1653ff0a49ee163902f3c to your computer and use it in GitHub Desktop.
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "ProceduralMeshComponent.h"
#include "VoxelActor.generated.h"
UCLASS()
class VOXEL_API AVoxelActor : public AActor
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray<MaterialInterface *> Materials;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Meta = (ExposeOnSpawn = true))
int32 randomseed = 0;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Meta = (ExposeOnSpawn = true))
int32 voxelSize = 200;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Meta = (ExposeOnSpawn = true))
int32 chunkInlineElements = 10;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Meta = (ExposeOnSpawn = true))
int32 chunkXIndex = 0;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float xMulti = 1;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float yMulti = 1;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float zMulti = 1;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float weight = 1;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float freq = 1;
UPROPERTY()
int32 chunkTotalElements;
UPROPERTY()
int32 chunkZElements;
UPROPERTY()
int32 chunkLineElementsP2;
UPROPERTY()
int32 voxelSizeHalf;
UPROPERTY()
TArray <int32> chunkFields;
UPROPERTY()
UProceduralMeshComponent* proceduralComponent;
public:
// Sets default values for this actor's properties
AVoxelActor();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment