Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
MasterTestProjekt
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kai Westerkamp
MasterTestProjekt
Commits
bd810866
Commit
bd810866
authored
Mar 01, 2017
by
Kai Westerkamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
recursiv struct workaround
parent
448885aa
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
23 deletions
+43
-23
MasterTestProject.uproject
MasterTestProject.uproject
+1
-8
UnrealGLTFLoader
Plugins/UnrealGLTFLoader
+0
-1
MasterTestProjectGameModeBase.cpp
Source/MasterTestProject/MasterTestProjectGameModeBase.cpp
+36
-11
MasterTestProjectGameModeBase.h
Source/MasterTestProject/MasterTestProjectGameModeBase.h
+5
-2
ProceduralEntity.cpp
Source/MasterTestProject/ue4-assimp/ProceduralEntity.cpp
+1
-1
No files found.
MasterTestProject.uproject
View file @
bd810866
{
{
"FileVersion": 3,
"FileVersion": 3,
"EngineAssociation": "4.1
4
",
"EngineAssociation": "4.1
5
",
"Category": "",
"Category": "",
"Description": "",
"Description": "",
"Modules": [
"Modules": [
...
@@ -12,11 +12,5 @@
...
@@ -12,11 +12,5 @@
"Engine"
"Engine"
]
]
}
}
],
"Plugins": [
{
"Name": "GLTFLoader",
"Enabled": true
}
]
]
}
}
\ No newline at end of file
UnrealGLTFLoader
@
110727d8
Subproject commit 110727d81d3f44dc58f8b2c09c8c27e4c1b6a3dd
Source/MasterTestProject/MasterTestProjectGameModeBase.cpp
View file @
bd810866
...
@@ -9,7 +9,8 @@
...
@@ -9,7 +9,8 @@
void
AMasterTestProjectGameModeBase
::
InitGame
(
const
FString
&
MapName
,
const
FString
&
Options
,
FString
&
ErrorMessage
)
{
void
AMasterTestProjectGameModeBase
::
InitGame
(
const
FString
&
MapName
,
const
FString
&
Options
,
FString
&
ErrorMessage
)
{
Super
::
InitGame
(
MapName
,
Options
,
ErrorMessage
);
Super
::
InitGame
(
MapName
,
Options
,
ErrorMessage
);
FString
file
=
"D:
\\
Dropbox
\\
Studium
\\
MasterArbeit
\\
3d-tiles
\\
examples
\\
tileset.json"
;
//FString file = "D:\\Dropbox\\Studium\\MasterArbeit\\3d-tiles\\examples\\tileset.json";
FString
file
=
"D:
\\
Dropbox
\\
Studium
\\
MasterArbeit
\\
3d-tiles-samples
\\
tilesets
\\
TilesetWithDiscreteLOD
\\
tileset.json"
;
FString
JsonRaw
=
""
;
FString
JsonRaw
=
""
;
FFileHelper
::
LoadFileToString
(
JsonRaw
,
*
file
);
FFileHelper
::
LoadFileToString
(
JsonRaw
,
*
file
);
...
@@ -17,19 +18,43 @@ void AMasterTestProjectGameModeBase::InitGame(const FString & MapName, const FSt
...
@@ -17,19 +18,43 @@ void AMasterTestProjectGameModeBase::InitGame(const FString & MapName, const FSt
UE_LOG
(
TILES
,
Log
,
TEXT
(
"Loading file %s"
),
*
file
);
UE_LOG
(
TILES
,
Log
,
TEXT
(
"Loading file %s"
),
*
file
);
//UE_LOG(GLTF, Warning, TEXT("LangFile: \n %s"), *JsonRaw);
//UE_LOG(GLTF, Warning, TEXT("LangFile: \n %s"), *JsonRaw);
//TSharedPtr<FJsonObject> JsonParsed;
TSharedPtr
<
FJsonObject
>
JsonParsed
;
//TSharedRef<TJsonReader<TCHAR>> JsonReader = TJsonReaderFactory<TCHAR>::Create(JsonRaw);
TSharedRef
<
TJsonReader
<
TCHAR
>>
JsonReader
=
TJsonReaderFactory
<
TCHAR
>::
Create
(
JsonRaw
);
//if (FJsonSerializer::Deserialize(JsonReader, JsonParsed))
if
(
FJsonSerializer
::
Deserialize
(
JsonReader
,
JsonParsed
))
//{
{
// FString ExampleString = JsonParsed->GetStringField("geometricError");
FString
ExampleString
=
JsonParsed
->
GetStringField
(
"geometricError"
);
// UE_LOG(TILES, Warning, TEXT("Example: \n %s"), *ExampleString);
UE_LOG
(
TILES
,
Warning
,
TEXT
(
"Example:
\n
%s"
),
*
ExampleString
);
//}
FTileset
tileset
;
FTileset
tileset
;
bool
success
=
FJsonObjectConverter
::
JsonObjectStringToUStruct
<
FTileset
>
(
JsonRaw
,
&
tileset
,
0
,
0
);
bool
success
=
FJsonObjectConverter
::
JsonObjectToUStruct
<
FTileset
>
(
JsonParsed
.
ToSharedRef
()
,
&
tileset
,
0
,
0
);
//bool success = FJsonObjectConverter::JsonObjectStringToUStruct<FTileset>(JsonRaw, &tileset, 0, 0);
UE_LOG
(
TILES
,
Warning
,
TEXT
(
"Parsed: Success:%s Version:
\"
%s
\"
geometricError:%f"
),
success
?
TEXT
(
"True"
)
:
TEXT
(
"False"
),
*
tileset
.
asset
.
version
,
tileset
.
geometricError
);
TSharedPtr
<
FJsonObject
>
root
=
JsonParsed
->
GetObjectField
(
"root"
);
parseTile
(
root
,
&
tileset
.
root
);
UE_LOG
(
TILES
,
Warning
,
TEXT
(
"Parsed: Success:%s Version:
\"
%s
\"
geometricError:%f"
),
success
?
TEXT
(
"True"
)
:
TEXT
(
"False"
),
*
tileset
.
asset
.
version
,
tileset
.
geometricError
);
}
}
void
AMasterTestProjectGameModeBase
::
parseTile
(
TSharedPtr
<
FJsonObject
>
json
,
FTile
*
targetTile
)
{
bool
success
=
FJsonObjectConverter
::
JsonObjectToUStruct
<
FTile
>
(
json
.
ToSharedRef
(),
targetTile
,
0
,
0
);
if
(
json
->
HasField
(
"children"
))
{
const
TArray
<
TSharedPtr
<
FJsonValue
>>
children
=
json
->
GetArrayField
(
"children"
);
UE_LOG
(
TILES
,
Warning
,
TEXT
(
"
\n
Tile: Success:%s Version:
\"
%s
\"
Children: "
),
success
?
TEXT
(
"True"
)
:
TEXT
(
"False"
),
*
targetTile
->
content
.
url
);
for
(
TSharedPtr
<
FJsonValue
>
child
:
children
)
{
FTile
newTile
;
parseTile
(
child
->
AsObject
(),
&
newTile
);
targetTile
->
children
.
Add
(
newTile
);
}
}
else
{
UE_LOG
(
TILES
,
Warning
,
TEXT
(
"Tile: Success:%s Version:
\"
%s
\"
no Childs "
),
success
?
TEXT
(
"True"
)
:
TEXT
(
"False"
),
*
targetTile
->
content
.
url
);
}
}
}
Source/MasterTestProject/MasterTestProjectGameModeBase.h
View file @
bd810866
...
@@ -114,8 +114,9 @@ struct FTile
...
@@ -114,8 +114,9 @@ struct FTile
UPROPERTY
()
UPROPERTY
()
FTileContent
content
;
FTileContent
content
;
UPROPERTY
()
//UPROPERTY()
TArray
<
FTile
>
children
;
//struct FTile children;
TArray
<
struct
FTile
>
children
;
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
};
...
@@ -157,6 +158,8 @@ class MASTERTESTPROJECT_API AMasterTestProjectGameModeBase : public AGameModeBas
...
@@ -157,6 +158,8 @@ class MASTERTESTPROJECT_API AMasterTestProjectGameModeBase : public AGameModeBas
public
:
public
:
virtual
void
InitGame
(
const
FString
&
MapName
,
const
FString
&
Options
,
FString
&
ErrorMessage
);
virtual
void
InitGame
(
const
FString
&
MapName
,
const
FString
&
Options
,
FString
&
ErrorMessage
);
void
parseTile
(
TSharedPtr
<
FJsonObject
>
json
,
FTile
*
targetTile
);
};
};
Source/MasterTestProject/ue4-assimp/ProceduralEntity.cpp
View file @
bd810866
...
@@ -252,7 +252,7 @@ void AProceduralEntity::loadModel(std::string path) {
...
@@ -252,7 +252,7 @@ void AProceduralEntity::loadModel(std::string path) {
UE_LOG
(
GLTF
,
Error
,
TEXT
(
"Extension list: %s"
),
*
FString
(
extensions
.
c_str
()));
UE_LOG
(
GLTF
,
Error
,
TEXT
(
"Extension list: %s"
),
*
FString
(
extensions
.
c_str
()));
wchar_t
buffer
[
260
];
wchar_t
buffer
[
260
];
GetModuleFileName
(
NULL
,
buffer
,
MAX_PATH
);
// GetModuleFileName(NULL, buffer, 260
);
UE_LOG
(
GLTF
,
Error
,
TEXT
(
"Curretn Path: %s"
),
*
FString
(
buffer
));
UE_LOG
(
GLTF
,
Error
,
TEXT
(
"Curretn Path: %s"
),
*
FString
(
buffer
));
return
;
return
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment