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
a4e16831
Commit
a4e16831
authored
Aug 23, 2017
by
wester
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a
parent
af788340
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
12 deletions
+32
-12
Minimal_Default.umap
Content/MobileStarterContent/Maps/Minimal_Default.umap
+0
-0
Minimal_Default_BuiltData.uasset
...obileStarterContent/Maps/Minimal_Default_BuiltData.uasset
+0
-0
HttpDownloader.cpp
Source/MasterTestProject/HttpDownloader.cpp
+7
-3
TileDownloader.cpp
Source/MasterTestProject/TileDownloader.cpp
+5
-2
Tileset.cpp
Source/MasterTestProject/Tileset.cpp
+20
-7
No files found.
Content/MobileStarterContent/Maps/Minimal_Default.umap
View file @
a4e16831
No preview for this file type
Content/MobileStarterContent/Maps/Minimal_Default_BuiltData.uasset
View file @
a4e16831
No preview for this file type
Source/MasterTestProject/HttpDownloader.cpp
View file @
a4e16831
...
...
@@ -9,12 +9,16 @@ void UHttpDownloader::DownloadFile(const FString &URL)
TSharedRef
<
IHttpRequest
>
HttpRequest
=
FHttpModule
::
Get
().
CreateRequest
();
HttpRequest
->
SetVerb
(
"GET"
);
HttpRequest
->
SetURL
(
URL
);
//HttpRequest->SetURL(TEXT("http://localhost/tileset.json"));
HttpRequest
->
OnProcessRequestComplete
().
BindUObject
(
this
,
&
UHttpDownloader
::
OnResponseReceived
);
// Execute the request
//UE_LOG(TILES, Log, TEXT("Downlaoding: %s "), *HttpRequest->GetURL());
// Execute the request
HttpRequest
->
ProcessRequest
();
bool
sucess
=
HttpRequest
->
ProcessRequest
();
UE_LOG
(
TILES
,
Log
,
TEXT
(
"Downlaoding : %s successfull Start %d "
),
*
HttpRequest
->
GetURL
(),
(
int
)
sucess
);
}
...
...
Source/MasterTestProject/TileDownloader.cpp
View file @
a4e16831
...
...
@@ -17,16 +17,19 @@ void UTileDownloader::GetTileContent(ATilesetActor *Actor, FTileContent *Content
void
UTileDownloader
::
OnResponseReceived
(
FHttpRequestPtr
Request
,
FHttpResponsePtr
Response
,
bool
bWasSuccessful
)
{
UE_LOG
(
TILES
,
Log
,
TEXT
(
"Tiledownloader Response: %s Success: %s"
),
*
Request
->
GetURL
());
//FIXME download with error in http
if
(
Response
.
IsValid
())
{
if
(
Request
->
GetURL
().
EndsWith
(
TEXT
(
".json"
)))
{
UE_LOG
(
TILES
,
Log
,
TEXT
(
"Downloded Tilset: %s Scucess: %s"
),
*
Request
->
GetURL
(),
bWasSuccessful
?
TEXT
(
"True"
)
:
TEXT
(
"False"
));
parent
->
tileset
=
actor
->
parseTileset
(
Response
->
GetContentAsString
(),
Request
->
GetURL
());
parent
->
tileset
->
parent
=
parentTile
;
if
(
parent
->
tileset
)
parent
->
tileset
->
parent
=
parentTile
;
}
else
{
FString
url
=
Request
->
GetURL
();
UE_LOG
(
TILES
,
Lo
g
,
TEXT
(
"Downloded Tile: %s Scucess: %s "
),
*
Request
->
GetURL
(),
bWasSuccessful
?
TEXT
(
"True"
)
:
TEXT
(
"False"
));
UE_LOG
(
TILES
,
Warnin
g
,
TEXT
(
"Downloded Tile: %s Scucess: %s "
),
*
Request
->
GetURL
(),
bWasSuccessful
?
TEXT
(
"True"
)
:
TEXT
(
"False"
));
actor
->
parse3DTile
(
Response
->
GetContent
(),
parentTile
);
}
}
...
...
Source/MasterTestProject/Tileset.cpp
View file @
a4e16831
...
...
@@ -28,7 +28,7 @@ void ATilesetActor::BeginPlay()
//rootTileset = new FTileContent();
rootTileset
.
url
=
relativeURL
;
UE_LOG
(
TILES
,
Error
,
TEXT
(
"Tileset load %s:
%s %s"
),
GetWorld
()
->
IsServer
()
?
TEXT
(
"Server"
)
:
TEXT
(
"Client"
)
,
*
relativeURL
,
*
host
);
UE_LOG
(
TILES
,
Error
,
TEXT
(
"Tileset load %s:
\"
%s
\"
\"
%s
\"
"
),
GetWorld
()
->
IsServer
()
?
TEXT
(
"Server"
)
:
TEXT
(
"Client"
)
,
*
host
,
*
relativeURL
);
//UE_LOG(TILES, Error, TEXT("Tileset load : %s %s"), *relativeURL, *host);
UTileDownloader
*
downloader
=
NewObject
<
UTileDownloader
>
(
UTileDownloader
::
StaticClass
());
downloader
->
GetTileContent
(
this
,
&
rootTileset
,
host
);
...
...
@@ -117,7 +117,7 @@ void FTile::setVisible(bool visible)
UTileDownloader
*
downloader
=
NewObject
<
UTileDownloader
>
(
UTileDownloader
::
StaticClass
());
downloader
->
GetTileContent
(
parentTilset
->
parentActor
,
&
content
,
parentTilset
->
absoluteURL
,
this
);
content
.
loadingStarted
=
true
;
UE_LOG
(
TILES
,
Lo
g
,
TEXT
(
"Set Tile visible %s %s:"
),
parentTilset
->
parentActor
->
GetWorld
()
->
IsServer
()
?
TEXT
(
"Server"
)
:
TEXT
(
"Client"
)
,
*
content
.
url
);
UE_LOG
(
TILES
,
Warnin
g
,
TEXT
(
"Set Tile visible %s %s:"
),
parentTilset
->
parentActor
->
GetWorld
()
->
IsServer
()
?
TEXT
(
"Server"
)
:
TEXT
(
"Client"
)
,
*
content
.
url
);
}
else
{
...
...
@@ -184,6 +184,8 @@ void ATilesetActor::updateScreenSpaceError(FTile* current, double currentSSE, do
FTileset
*
ATilesetActor
::
parseTileset
(
FString
JsonString
,
FString
BaseURL
)
{
//UE_LOG(TILES, Log, TEXT("JSON: %s"), *JsonString);
//TODO error Handling
TSharedPtr
<
FJsonObject
>
JsonParsed
;
TSharedRef
<
TJsonReader
<
TCHAR
>>
JsonReader
=
TJsonReaderFactory
<
TCHAR
>::
Create
(
JsonString
);
...
...
@@ -325,7 +327,7 @@ void ATilesetActor::parseInstanced3DTile(const TArray<uint8> data, FTile * tile)
tile
->
content
.
absoluteTileTranforms
.
Add
(
trans
.
ToMatrixWithScale
());
gltf
->
SetActorTransform
(
trans
);
outputString
+=
"]"
;
UE_LOG
(
TILES
,
Warnin
g
,
TEXT
(
"InStanced 3D Model Positions %s"
),
*
outputString
);
UE_LOG
(
TILES
,
Lo
g
,
TEXT
(
"InStanced 3D Model Positions %s"
),
*
outputString
);
}
else
{
UE_LOG
(
TILES
,
Warning
,
TEXT
(
"INStanced 3D Model Position Quantized not Supported in %s"
),
*
tile
->
content
.
url
);
...
...
@@ -342,7 +344,7 @@ void ATilesetActor::parsePointCloudTile(const TArray<uint8> data, FTile * tile)
{
PointCloudHeader
*
pntheader
=
(
PointCloudHeader
*
)
data
.
GetData
();
FString
featureJSONString
=
pntheader
->
getpartAsString
(
pntheader
->
getFeatureStart
(),
pntheader
->
featureTable
.
featureTableJSONByteLength
);
UE_LOG
(
TILES
,
Warnin
g
,
TEXT
(
"PointCloudHeader: FeatureTable JSON: %s"
),
*
featureJSONString
);
UE_LOG
(
TILES
,
Lo
g
,
TEXT
(
"PointCloudHeader: FeatureTable JSON: %s"
),
*
featureJSONString
);
TSharedPtr
<
FJsonObject
>
FeatureTableJSON
;
TSharedRef
<
TJsonReader
<
TCHAR
>>
JsonReader
=
TJsonReaderFactory
<
TCHAR
>::
Create
(
featureJSONString
);
UWorld
*
const
World
=
GetWorld
();
...
...
@@ -415,8 +417,8 @@ void ATilesetActor::parsePointCloudTile(const TArray<uint8> data, FTile * tile)
FVector
max
=
FVector
(
maxx
,
maxy
,
maxz
);
FVector
size
=
max
-
min
;
UE_LOG
(
TILES
,
Warnin
g
,
TEXT
(
"Created Position Texture Number Points %d, TextureSize: %d, Fill: %d"
),
instances_length
,
TextureSize
,
fill
);
UE_LOG
(
TILES
,
Error
,
TEXT
(
"
Boundig Box: Min [%s] Max [%s] Size [%s]"
),
*
min
.
ToString
(),
*
max
.
ToString
(),
*
size
.
ToString
());
UE_LOG
(
TILES
,
Lo
g
,
TEXT
(
"Created Position Texture Number Points %d, TextureSize: %d, Fill: %d"
),
instances_length
,
TextureSize
,
fill
);
UE_LOG
(
TILES
,
Log
,
TEXT
(
"Pointcloud
Boundig Box: Min [%s] Max [%s] Size [%s]"
),
*
min
.
ToString
(),
*
max
.
ToString
(),
*
size
.
ToString
());
...
...
@@ -444,7 +446,7 @@ void ATilesetActor::parsePointCloudTile(const TArray<uint8> data, FTile * tile)
}
ColorTexture
=
UDynamicTextureUtilities
::
CreateTransientDynamicTexture
(
TextureSize
,
TextureSize
,
PF_A32B32G32R32F
);
UDynamicTextureUtilities
::
UpdateDynamicVectorTexture
(
*
ColorRGB
,
ColorTexture
);
UE_LOG
(
TILES
,
Warnin
g
,
TEXT
(
"Created Color Texture Number Points %d, TextureSize: %d, Fill: %d, byteOffset: %d"
),
instances_length
,
TextureSize
,
fill
,
byteOffset
);
UE_LOG
(
TILES
,
Lo
g
,
TEXT
(
"Created Color Texture Number Points %d, TextureSize: %d, Fill: %d, byteOffset: %d"
),
instances_length
,
TextureSize
,
fill
,
byteOffset
);
}
...
...
@@ -471,6 +473,17 @@ void ATilesetActor::parsePointCloudTile(const TArray<uint8> data, FTile * tile)
void
ATilesetActor
::
parse3DTile
(
const
TArray
<
uint8
>
data
,
FTile
*
tile
)
{
if
(
!
tile
)
{
char
*
ansiiData
=
new
char
[
data
.
Num
()
+
2
];
memcpy
(
ansiiData
,
(
void
*
)(
data
.
GetData
()),
data
.
Num
());
//Assumes bytesRead is always smaller than 1024 bytes
ansiiData
[
data
.
Num
()]
=
0
;
//Add null terminator
FString
temp
=
ANSI_TO_TCHAR
(
ansiiData
);
//Convert to FString
delete
ansiiData
;
UE_LOG
(
TILES
,
Error
,
TEXT
(
"Something went horribly wrong in processing a Tile: %s"
),
*
temp
);
return
;
}
TileHeader
*
header
=
(
TileHeader
*
)
data
.
GetData
();
tile
->
content
.
content
=
data
;
...
...
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