Open taeko-chan opened 4 years ago
I love this. Can't wait for it to be merged so I can start working on adding lane markings. Honestly it seems like a bad idea to add an additional option for "advanced roads." This seems like a feature that should be built in to the default road generation.
I love this. Can't wait for it to be merged so I can start working on adding lane markings. Honestly it seems like a bad idea to add an additional option for "advanced roads." This seems like a feature that should be built in to the default road generation.
I ended up writing a new populator that uses the Vec3d object to store coordinates, as I saw it more fitting. It also lets you do vector math easier. We could possibly just use VectorPathGenerator instead of RoadGenerator from now on, as it does the same thing RoadGenerator does + the tunnels/bridges and road surfaces.
what does it do? This pull request adds tunnels and bridges to Terra 1 to 1. It is done by getting the start and end points of an OSM way as well as the start and end heights, and calculating the height using: y = y1 + (c/d) * Δy1 where c is the distance along the tunnel, d is the length of the tunnel and y1 is the origin y.
As of current, all (famous last words) bugs have been fixed. Tunnels and bridges both generate correctly (outside of the edge cases listed below). The pavement is standard asphalt, although one photo has orange asphalt because it was taken before I changed it back.
Here are some photos of the results (more coming soon):
Near Airolo, Switzerland: Terra 1 to 1:![Screenshot (6)](https://user-images.githubusercontent.com/46656618/80274572-b45a5480-86db-11ea-9455-1a493968368b.png)
Real life:![Screenshot (8)](https://user-images.githubusercontent.com/46656618/80274584-bfad8000-86db-11ea-8a33-02f06ecafaae.png)
Gubrist Tunnel, Switzerland Terra 1 to 1:![Screenshot (10)](https://user-images.githubusercontent.com/46656618/80318629-b91e2600-880b-11ea-9c63-b18577c66c8c.png)
Real Life:![Screenshot (14)](https://user-images.githubusercontent.com/46656618/80318640-d5ba5e00-880b-11ea-925c-fb630a6edab2.png)
Lærdalstunnelen, Norway (World's longest tunnel): Terra 1 to 1:![Screenshot (11)](https://user-images.githubusercontent.com/46656618/80318666-eff43c00-880b-11ea-8022-dd9181ee4d63.png)
Real Life:![Screenshot (13)](https://user-images.githubusercontent.com/46656618/80318669-f5ea1d00-880b-11ea-9a08-a06e0395f2dd.png)
view from inside mountain of Lærdalstunnelen:![Screenshot (12)](https://user-images.githubusercontent.com/46656618/80318681-069a9300-880c-11ea-808a-294c95833f8c.png)
Gotthard Pass (Ticino Side), Switzerland (no companion irl photo yet):![Screenshot (9)](https://user-images.githubusercontent.com/46656618/80318695-1c0fbd00-880c-11ea-8927-c0fe4da29bcd.png)
Keep in mind the orange parts are asphalt in the pull request.
what still needs to be done?
CHANGE LOG (major stuff):
i left the class itself in just in case, but the osm path generation is now done by VectorPathGenerator.
Also important: Because there hasn't been a grounding fix yet it may be best to wait until after that is fixed to avoid conflicts in OpenStreetMaps.java.
If you want to try out a complied version with tunnels and bridges, here it is (this version is a commit behind): https://drive.google.com/open?id=1YaFy01VRi-lPOT-ccfkaYenwbSE1eQcV
That pretty much summarizes it, if anyone has any suggestions around this basic feature set, go ahead and comment and I may implement them as well.