Commit 8e28c734 by Kai Westerkamp

Merge branch 'Assimp' of ssh://git.breab.org:2223/kai/MasterTestProjekt into Assimp

parents 912a593d a01207f1
...@@ -90,7 +90,8 @@ void ATilesetActor::parseBatched3DTile(const TArray<uint8> data, FTile * tile) ...@@ -90,7 +90,8 @@ void ATilesetActor::parseBatched3DTile(const TArray<uint8> data, FTile * tile)
gltf->SetFolderPath(FName(*("SpawnedGLTF/" + this->GetName()))); gltf->SetFolderPath(FName(*("SpawnedGLTF/" + this->GetName())));
#endif #endif
gltf->AttachToActor(this, FAttachmentTransformRules::KeepWorldTransform); gltf->AttachToActor(this, FAttachmentTransformRules::KeepWorldTransform);
gltf->SetActorRelativeTransform(FTransform(*tile->getAbsoluteTransform())); FMatrix leftToRight(FVector(-1, 0, 0), FVector(0, 0, 1), FVector(0, 1, 0), FVector(0, 0, 0));
gltf->SetActorRelativeTransform(FTransform(leftToRight * *tile->getAbsoluteTransform()));
int GLTFstart = b3dmheader->getGLTFStart(); int GLTFstart = b3dmheader->getGLTFStart();
gltf->loadModel(&data.GetData()[GLTFstart], (data.Num() - GLTFstart)); gltf->loadModel(&data.GetData()[GLTFstart], (data.Num() - GLTFstart));
...@@ -145,11 +146,13 @@ void ATilesetActor::parseInstanced3DTile(const TArray<uint8> data, FTile * tile) ...@@ -145,11 +146,13 @@ void ATilesetActor::parseInstanced3DTile(const TArray<uint8> data, FTile * tile)
FVector up(pos); FVector up(pos);
up.Normalize(); up.Normalize();
FVector Z(0, 0, 1); FVector Z(0, 0, 1);
FVector east = FVector::CrossProduct( up,Z ); FVector east = FVector::CrossProduct( Z, up );
FVector north = FVector::CrossProduct(east, up); FVector north = FVector::CrossProduct(east, up);
FMatrix NEU(north, up, east, pos); FMatrix NEU(north, up, east, pos);
clone->SetActorTransform(FTransform(NEU)); clone->SetActorTransform(FTransform(NEU));
} }
tile->content.tiles.Add(clone); tile->content.tiles.Add(clone);
} }
......
...@@ -18,6 +18,9 @@ struct FAsset ...@@ -18,6 +18,9 @@ struct FAsset
UPROPERTY() UPROPERTY()
FString tilesetVersion; FString tilesetVersion;
UPROPERTY()
FString gltfUpAxis;
FAsset() { FAsset() {
version = ""; version = "";
tilesetVersion = ""; tilesetVersion = "";
......
...@@ -251,7 +251,6 @@ void AProceduralEntity::loadModel(const uint8* RawFileData, int32 lenght) { ...@@ -251,7 +251,6 @@ void AProceduralEntity::loadModel(const uint8* RawFileData, int32 lenght) {
if (MasterMaterialRef == nullptr) { if (MasterMaterialRef == nullptr) {
MasterMaterialRef = LoadObject<UMaterialInterface>(NULL, TEXT("/Game/Materials/TexturedMaterial"), NULL, LOAD_None, NULL); MasterMaterialRef = LoadObject<UMaterialInterface>(NULL, TEXT("/Game/Materials/TexturedMaterial"), NULL, LOAD_None, NULL);
//= FindObject<UMaterialInterface>(GetWorld(), TEXT("TexturedMaterial")); //= FindObject<UMaterialInterface>(GetWorld(), TEXT("TexturedMaterial"));
UE_LOG(GLTF, Error, TEXT("Material: %s"), *MasterMaterialRef->GetName());
} }
if (UniformMaterialRef == nullptr) { if (UniformMaterialRef == nullptr) {
UniformMaterialRef = LoadObject<UMaterialInterface>(NULL, TEXT("/Game/Materials/TexturedMaterial"), NULL, LOAD_None, NULL); UniformMaterialRef = LoadObject<UMaterialInterface>(NULL, TEXT("/Game/Materials/TexturedMaterial"), NULL, LOAD_None, NULL);
......
http://folk.uio.no/inftt/Div/visualization2.pdf
https://wiki.delphigl.com/index.php/Screenspace_Error
\ No newline at end of file
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