We needed to implement a number of graphical and QOL options to improve the visual appeal of the program. In this card, i've implemented various road generation and modification tools, added models for cars and buildings, and also created helper methods for building creation.
For this we implemented a number of classes and methods:
RoadGenerator.cs: A tool to generate road networks based on a graph of nodes and points. Uses LoadRoads to generate the roads, which calls generateRoadsFromEdges which creates the main road segments, generateIntersections which generates the intersection segments, generateRoadMarkings which generates dashed lines on the road and generateCurb/generateIntersectionCurb which creates curbs for the whole network. Along with this, we created a ClearRoads method that can be used to clear the existing roads if desired.
PositionBuildings.cs: Unity editor tools to rotate the buildings to face roads they're on, and tools to position them at a fixed offset away from the buildings. RotateBuildings() is used to face buildings to their closest roads, and PositionBuildingsOnRoads faces the buildings to the closest roads.
Beyond that, for this PR
We created a CalcClosestPointOnEdge for the Building class to access the closest point on edge before runtime.
pickRandomModelAndMaterial for WaypointMover, which picks a random vehicle prefab & color to spawn in the vehicles
And we assigned a building model to the building prefab (no random picking as some of the models weren't the best)
And created a ProperMapScene to demonstrate the visual appearance of the map so far.
Reogranized Tools so they're in subcategories and easier to find
Currently this PR doesn't encapsulate ALL the changes planned to the graphics, however the road tools + vehicles + building positioning tools were already big changes that we wanted to get to main ASAP.
We needed to implement a number of graphical and QOL options to improve the visual appeal of the program. In this card, i've implemented various road generation and modification tools, added models for cars and buildings, and also created helper methods for building creation.
Sample of road generation tool: https://www.youtube.com/watch?v=-Ds8aMPkeZw Sample of building placement tools (+ dashes and curbs added to roads): https://www.youtube.com/watch?v=NipYOdNJ6gk
For this we implemented a number of classes and methods:
Beyond that, for this PR
Currently this PR doesn't encapsulate ALL the changes planned to the graphics, however the road tools + vehicles + building positioning tools were already big changes that we wanted to get to main ASAP.
Implemented by: Tomas Premoli
Validated By: Scott DeVerinne
┆Issue is synchronized with this Trello card by Unito ┆Attachments: #41 Initial graphics implementation (roads, travellers, and buildings)