Commit 912a593d by Kai Westerkamp

added Tile Array to contetn

parent 013f4714
...@@ -19,6 +19,12 @@ void ATilesetActor::BeginPlay() ...@@ -19,6 +19,12 @@ void ATilesetActor::BeginPlay()
downloader->GetTileContent(this, rootTileset, host); downloader->GetTileContent(this, rootTileset, host);
} }
void ATilesetActor::Tick(float DeltaSeconds)
{
}
FTileset* ATilesetActor::parseTileset(FString JsonString, FString BaseURL) FTileset* ATilesetActor::parseTileset(FString JsonString, FString BaseURL)
{ {
//TODO error Handling //TODO error Handling
...@@ -88,6 +94,7 @@ void ATilesetActor::parseBatched3DTile(const TArray<uint8> data, FTile * tile) ...@@ -88,6 +94,7 @@ void ATilesetActor::parseBatched3DTile(const TArray<uint8> data, FTile * tile)
int GLTFstart = b3dmheader->getGLTFStart(); int GLTFstart = b3dmheader->getGLTFStart();
gltf->loadModel(&data.GetData()[GLTFstart], (data.Num() - GLTFstart)); gltf->loadModel(&data.GetData()[GLTFstart], (data.Num() - GLTFstart));
tile->content.tiles.Add(gltf);
} }
} }
...@@ -144,7 +151,9 @@ void ATilesetActor::parseInstanced3DTile(const TArray<uint8> data, FTile * tile) ...@@ -144,7 +151,9 @@ void ATilesetActor::parseInstanced3DTile(const TArray<uint8> data, FTile * tile)
clone->SetActorTransform(FTransform(NEU)); clone->SetActorTransform(FTransform(NEU));
} }
tile->content.tiles.Add(clone);
} }
tile->content.tiles.Add(gltf);
gltf->SetActorTransform(FTransform(positons[0])); gltf->SetActorTransform(FTransform(positons[0]));
outputString += "]"; outputString += "]";
UE_LOG(TILES, Warning, TEXT("InStanced 3D Model Positions %s"), *outputString); UE_LOG(TILES, Warning, TEXT("InStanced 3D Model Positions %s"), *outputString);
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#pragma once #pragma once
#include "UObject/NoExportTypes.h" #include "UObject/NoExportTypes.h"
#include "Tileset.generated.h" #include "Tileset.generated.h"
...@@ -90,6 +89,7 @@ struct FTileContent ...@@ -90,6 +89,7 @@ struct FTileContent
TArray<uint8> content; TArray<uint8> content;
struct FTileset *tileset; struct FTileset *tileset;
TArray<class AProceduralEntity*> tiles;
FTileContent() { FTileContent() {
tileset = nullptr; tileset = nullptr;
...@@ -288,6 +288,9 @@ public: ...@@ -288,6 +288,9 @@ public:
// Called when the game starts or when spawned // Called when the game starts or when spawned
virtual void BeginPlay() override; virtual void BeginPlay() override;
// Called every frame
virtual void Tick(float DeltaSeconds) override;
FTileset* parseTileset(FString JsonString, FString BaseURL); FTileset* parseTileset(FString JsonString, FString BaseURL);
void parse3DTile(const TArray<uint8> data, FTile *tile); void parse3DTile(const TArray<uint8> data, FTile *tile);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment