parent
96e9af4438
commit
d1103c580b
|
@ -1,4 +1,4 @@
|
||||||
#include "VoxelBlock.h"
|
#include "Block/VoxelBlock.h"
|
||||||
|
|
||||||
#include "VoxelWorld.h"
|
#include "VoxelWorld.h"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "VoxelMesh.h"
|
#include "Block/VoxelMesh.h"
|
||||||
|
|
||||||
const FVoxelMeshData FVoxelMeshData::CubeTopFace =
|
const FVoxelMeshData FVoxelMeshData::CubeTopFace =
|
||||||
{
|
{
|
|
@ -6,6 +6,12 @@
|
||||||
void UVoxelBlueprintLibrary::AddBlockType(const UObject* WorldContextObject, const FName& Name, const FVoxelBlockType& BlockType)
|
void UVoxelBlueprintLibrary::AddBlockType(const UObject* WorldContextObject, const FName& Name, const FVoxelBlockType& BlockType)
|
||||||
{
|
{
|
||||||
UGameInstance* GameInstance = UGameplayStatics::GetGameInstance(WorldContextObject);
|
UGameInstance* GameInstance = UGameplayStatics::GetGameInstance(WorldContextObject);
|
||||||
UVoxelSubsystem* LockstepSubsystem = GameInstance->GetSubsystem<UVoxelSubsystem>();
|
|
||||||
LockstepSubsystem->BlockTypes.Add(Name, BlockType);
|
check(GameInstance);
|
||||||
|
|
||||||
|
UVoxelSubsystem* VoxelSubsystem = GameInstance->GetSubsystem<UVoxelSubsystem>();
|
||||||
|
|
||||||
|
check(VoxelSubsystem);
|
||||||
|
|
||||||
|
VoxelSubsystem->BlockTypes.Add(Name, BlockType);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "VoxelChunk.h"
|
#include "Chunk/VoxelChunk.h"
|
||||||
|
|
||||||
#include "VoxelLog.h"
|
#include "VoxelLog.h"
|
||||||
#include "VoxelWorld.h"
|
#include "VoxelWorld.h"
|
|
@ -1,6 +1,6 @@
|
||||||
#include "VoxelSubsystem.h"
|
#include "VoxelSubsystem.h"
|
||||||
|
|
||||||
#include "VoxelBlock.h"
|
#include "Block/VoxelBlock.h"
|
||||||
|
|
||||||
UVoxelSubsystem::UVoxelSubsystem(const class FObjectInitializer& ObjectInitializer)
|
UVoxelSubsystem::UVoxelSubsystem(const class FObjectInitializer& ObjectInitializer)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
#include "VoxelWorld.h"
|
#include "VoxelWorld.h"
|
||||||
|
|
||||||
#include "VoxelLog.h"
|
#include "VoxelLog.h"
|
||||||
#include "VoxelBlock.h"
|
|
||||||
#include "VoxelChunk.h"
|
|
||||||
#include "VoxelHelper.h"
|
#include "VoxelHelper.h"
|
||||||
#include "VoxelSubsystem.h"
|
#include "VoxelSubsystem.h"
|
||||||
|
#include "Block/VoxelBlock.h"
|
||||||
|
#include "Chunk/VoxelChunk.h"
|
||||||
#include "VoxelAgentInterface.h"
|
#include "VoxelAgentInterface.h"
|
||||||
|
|
||||||
const TArray<FIntPoint> ChunkLoadOrder =
|
const TArray<FIntPoint> ChunkLoadOrder =
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include "VoxelMesh.generated.h"
|
#include "VoxelMesh.generated.h"
|
||||||
|
|
||||||
USTRUCT(BlueprintType)
|
USTRUCT(BlueprintType)
|
||||||
struct FVoxelMeshData
|
struct VOXEL_API FVoxelMeshData
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "VoxelBlock.h"
|
#include "Block/VoxelBlock.h"
|
||||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||||
#include "VoxelBlueprintLibrary.generated.h"
|
#include "VoxelBlueprintLibrary.generated.h"
|
||||||
|
|
||||||
struct FVoxelBlockType;
|
struct FVoxelBlockType;
|
||||||
|
|
||||||
UCLASS()
|
UCLASS()
|
||||||
class UVoxelBlueprintLibrary : public UBlueprintFunctionLibrary
|
class VOXEL_API UVoxelBlueprintLibrary : public UBlueprintFunctionLibrary
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "VoxelBlock.h"
|
#include "Block/VoxelBlock.h"
|
||||||
#include "GameFramework/Actor.h"
|
#include "GameFramework/Actor.h"
|
||||||
#include "VoxelChunk.generated.h"
|
#include "VoxelChunk.generated.h"
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
class AVoxelWorld;
|
class AVoxelWorld;
|
||||||
|
|
||||||
UCLASS()
|
UCLASS()
|
||||||
class UVoxelHelper : public UBlueprintFunctionLibrary
|
class VOXEL_API UVoxelHelper : public UBlueprintFunctionLibrary
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ public:
|
||||||
UFUNCTION(BlueprintCallable, Category = "Voxel|Helper", meta = (WorldContext = "WorldContextObject"))
|
UFUNCTION(BlueprintCallable, Category = "Voxel|Helper", meta = (WorldContext = "WorldContextObject"))
|
||||||
static AVoxelWorld* CreateVoxelWorld(UObject* WorldContextObject, const FVoxelWorldSetting& WorldSetting);
|
static AVoxelWorld* CreateVoxelWorld(UObject* WorldContextObject, const FVoxelWorldSetting& WorldSetting);
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "Voxel|Helper")
|
UFUNCTION(BlueprintPure, Category = "Voxel|Helper")
|
||||||
static void WorldToRelativeLocation(const FIntVector& InWorldLocation, FIntPoint& OutChunkLocation, FIntVector& OutRelativeLocation);
|
static void WorldToRelativeLocation(const FIntVector& InWorldLocation, FIntPoint& OutChunkLocation, FIntVector& OutRelativeLocation);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
struct FVoxelBlockType;
|
struct FVoxelBlockType;
|
||||||
|
|
||||||
UCLASS()
|
UCLASS()
|
||||||
class UVoxelSubsystem : public UGameInstanceSubsystem
|
class VOXEL_API UVoxelSubsystem : public UGameInstanceSubsystem
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ class UVoxelSubsystem;
|
||||||
class IVoxelAgentInterface;
|
class IVoxelAgentInterface;
|
||||||
|
|
||||||
USTRUCT(BlueprintType)
|
USTRUCT(BlueprintType)
|
||||||
struct FVoxelWorldSetting
|
struct VOXEL_API FVoxelWorldSetting
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue