From d8a5caaa3ed61b7f67b4504580447a7c42feed3a Mon Sep 17 00:00:00 2001
From: bart <bart.knuiman@wur.nl>
Date: Thu, 11 May 2023 12:53:03 +0200
Subject: [PATCH] Changed readme.

Can sync coords with terrain manager now.
---
 README.md                                     | 23 ++++---------------
 README.md.backup                              | 21 +++--------------
 Runtime/DownloadBuildings.cs                  |  5 ++++
 .../com.wurwander.3dbuildings.asmdef.asmdef   |  3 ++-
 4 files changed, 14 insertions(+), 38 deletions(-)

diff --git a/README.md b/README.md
index 88328ea..6cedeed 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,12 @@
 ## 3dBuildings (URP & HDRP)
 
-Downloads buildings from the 3DBag data set from TUDelft using the specified RD-coordinate as origin. This origin will be the zero point in unity world. 
+Downloads buildings from the 3DBAG data set from TUDelft using the specified RD-coordinate as origin. This origin will be the zero point in unity world. 
 
 https://3dbag.nl/en/viewer
 
-### Dependencies
+### Dependencies (GIT packages)
 - geotiff (for height) 
+- utils
 
 
 ### Usage
@@ -13,22 +14,6 @@ https://3dbag.nl/en/viewer
 There is a Sample.mkv (movie clip) included. Simply drag into the Hierarchy, then select the prefab and press Generate in the Inspector. Check Console to see if action is happening. May take a minute to complete.
 
 #### Adding (correct) elevation
-- From the inspector select a folder where the tiff tiles for the current area reside and Preload height before pressing the Generate button.
-- Alternatively, if this dataset is combined with 3dbasisvoorziening, the height data from 3dbasisvoorziening can be used to avoid loading the  data twice. 
-
-```
-	var heightData = basisVoorziening.GetComponent<BasisVoorziening>().HeightData;
-	go.GetComponent<DownloadBuildings>().heightDatas.Add( heightData );
-	go.GetComponent<DownloadBuildings>().Generate();
-	
-```
-
-- Yet another method would be to load the height data from script instead of selecting a folder.
- ```
-	var heightData = GeoTiffHeight.Load( filename );
-	go.GetComponent<DownloadBuildings>().heightDatas.Add( heightData );
-	go.GetComponent<DownloadBuildings>().Generate();
- ```
-
+Height is now automatically integreated in the builds. One no longer needs to pre-download an Geotiff file from GeoTiles library.
 
 ![Image](./example.png "Example")
\ No newline at end of file
diff --git a/README.md.backup b/README.md.backup
index 88328ea..3361b6d 100644
--- a/README.md.backup
+++ b/README.md.backup
@@ -4,8 +4,9 @@ Downloads buildings from the 3DBag data set from TUDelft using the specified RD-
 
 https://3dbag.nl/en/viewer
 
-### Dependencies
+### Dependencies (GIT packages)
 - geotiff (for height) 
+- utils
 
 
 ### Usage
@@ -13,22 +14,6 @@ https://3dbag.nl/en/viewer
 There is a Sample.mkv (movie clip) included. Simply drag into the Hierarchy, then select the prefab and press Generate in the Inspector. Check Console to see if action is happening. May take a minute to complete.
 
 #### Adding (correct) elevation
-- From the inspector select a folder where the tiff tiles for the current area reside and Preload height before pressing the Generate button.
-- Alternatively, if this dataset is combined with 3dbasisvoorziening, the height data from 3dbasisvoorziening can be used to avoid loading the  data twice. 
-
-```
-	var heightData = basisVoorziening.GetComponent<BasisVoorziening>().HeightData;
-	go.GetComponent<DownloadBuildings>().heightDatas.Add( heightData );
-	go.GetComponent<DownloadBuildings>().Generate();
-	
-```
-
-- Yet another method would be to load the height data from script instead of selecting a folder.
- ```
-	var heightData = GeoTiffHeight.Load( filename );
-	go.GetComponent<DownloadBuildings>().heightDatas.Add( heightData );
-	go.GetComponent<DownloadBuildings>().Generate();
- ```
-
+Height is now automatically integreated in the builds. One no longer needs to pre-download an Geotiff file from GeoTiles library.
 
 ![Image](./example.png "Example")
\ No newline at end of file
diff --git a/Runtime/DownloadBuildings.cs b/Runtime/DownloadBuildings.cs
index 200700e..f099185 100644
--- a/Runtime/DownloadBuildings.cs
+++ b/Runtime/DownloadBuildings.cs
@@ -94,6 +94,11 @@ namespace Wander
         int numFinishedGlbLoads;
         int numFinishedMeshBuilds;
 
+        public void SetGPSCoord( Vector2 gps )
+        {
+            RDUtils.GPS2RD(gps.x, gps.y, out rdOffsetX, out rdOffsetY );
+        }
+
         public void Generate()
         {
             Cancel();
diff --git a/Runtime/com.wurwander.3dbuildings.asmdef.asmdef b/Runtime/com.wurwander.3dbuildings.asmdef.asmdef
index 7ea33a0..05ffc7c 100644
--- a/Runtime/com.wurwander.3dbuildings.asmdef.asmdef
+++ b/Runtime/com.wurwander.3dbuildings.asmdef.asmdef
@@ -2,7 +2,8 @@
     "name": "3DBuildings",
     "rootNamespace": "Wander",
     "references": [
-        "GUID:e44d054dba23a8349a137db68e558dce"
+        "GUID:e44d054dba23a8349a137db68e558dce",
+        "GUID:c2a8fdf421d3fc14dbff9693e60a8787"
     ],
     "includePlatforms": [],
     "excludePlatforms": [],
-- 
GitLab