Commit d60d7614 by wester

tests

parent e766759e
...@@ -23,6 +23,7 @@ void UTileDownloader::OnResponseReceived(FHttpRequestPtr Request, FHttpResponseP ...@@ -23,6 +23,7 @@ void UTileDownloader::OnResponseReceived(FHttpRequestPtr Request, FHttpResponseP
UE_LOG(TILES, Warning, TEXT("Parsed Tilset: %s Scucess: %s "), *Request->GetURL(), bWasSuccessful ? TEXT("True") : TEXT("False")); UE_LOG(TILES, Warning, TEXT("Parsed Tilset: %s Scucess: %s "), *Request->GetURL(), bWasSuccessful ? TEXT("True") : TEXT("False"));
} }
else { else {
FString url = Request->GetURL();
actor->parseTile(Response->GetContent(), parentTile); actor->parseTile(Response->GetContent(), parentTile);
UE_LOG(TILES, Warning, TEXT("Parsed Tile: %s Scucess: %s "), *Request->GetURL(), bWasSuccessful ? TEXT("True") : TEXT("False")); UE_LOG(TILES, Warning, TEXT("Parsed Tile: %s Scucess: %s "), *Request->GetURL(), bWasSuccessful ? TEXT("True") : TEXT("False"));
......
...@@ -33,7 +33,7 @@ FTileset* ATilesetActor::parseTileset(FString JsonString, FString BaseURL) ...@@ -33,7 +33,7 @@ FTileset* ATilesetActor::parseTileset(FString JsonString, FString BaseURL)
TSharedPtr<FJsonObject> root = JsonParsed->GetObjectField("root"); TSharedPtr<FJsonObject> root = JsonParsed->GetObjectField("root");
ATilesetActor::parseTile(root, &tileset->root, tileset); ATilesetActor::parseTile(root, &tileset->root, tileset);
//UE_LOG(TILES, Warning, TEXT("Parsed: Success:%s Version:\"%s\" geometricError:%f"), success ? TEXT("True") : TEXT("False"), *tileset.asset.version, tileset.geometricError); UE_LOG(TILES, Warning, TEXT("Parsed: Success:%s Version:\"%s\" geometricError:%f"), success ? TEXT("True") : TEXT("False"), *tileset->asset.version, tileset->geometricError);
return tileset; return tileset;
} }
...@@ -54,12 +54,22 @@ void ATilesetActor::parseTile(const TArray<uint8> data, FTile *tile) ...@@ -54,12 +54,22 @@ void ATilesetActor::parseTile(const TArray<uint8> data, FTile *tile)
UWorld* const World = GetWorld(); UWorld* const World = GetWorld();
if (World) if (World)
{ {
UE_LOG(TILES, Log, TEXT("TileUrL %s"), *tile->content.url);
//FString path = tile->content.url
/* FString path = tile->content.url.Replace(TEXT("\\"), TEXT("/"));
FString basePath, name;
if (!path.Split(TEXT("/"), &basePath, &name, ESearchCase::IgnoreCase, ESearchDir::FromEnd)) {
name = FString(TEXT("Error"));
}*/
//FName(*name);
AProceduralEntity *gltf = World->SpawnActor<AProceduralEntity>(AProceduralEntity::StaticClass()); AProceduralEntity *gltf = World->SpawnActor<AProceduralEntity>(AProceduralEntity::StaticClass());
if (tile) { if (tile) {
for (int32 b = 0; b < tile->transform.Num() && b < 20; b++) // for (int32 b = 0; b < tile->transform.Num() && b < 20; b++)
{ // {
UE_LOG(TILES, Log, TEXT("Transform %.2f"), tile->transform[b]); UE_LOG(TILES, Log, TEXT("Transform %d %s"), tile->transform.Num(), *gltf->GetName());
} //}
} }
gltf->AttachToActor(this, FAttachmentTransformRules::KeepWorldTransform); gltf->AttachToActor(this, FAttachmentTransformRules::KeepWorldTransform);
......
...@@ -131,7 +131,7 @@ struct FTile ...@@ -131,7 +131,7 @@ struct FTile
FTile() { FTile() {
float transformDefault[] = { 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 }; float transformDefault[] = { 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 };
transform.Empty(); transform.Empty();
transform.Append(transformDefault, 16); //transform.Append(transformDefault, 16);
} }
}; };
......
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