public static void RoadNetworkToMesh() { var roadNetworkDescription = GetSelectedRoadNetwork(); if (roadNetworkDescription == null) { return; } var go = RoadNetworkMesher.GenerateMesh(roadNetworkDescription); AddRoadNetworkReference(go, roadNetworkDescription); }
public void GenerateMeshTypeRoads(RoadNetworkDescription road, MeshGenerationType roadMeshGenerationType) { if (roadMeshGenerationType == MeshGenerationType.MeshRoad) { RoadNetworkMesher.GenerateMesh(road); } else if (roadMeshGenerationType == MeshGenerationType.MeshLanes) { RoadNetworkMesher.GenerateLineRenderer(road); } else if (roadMeshGenerationType == MeshGenerationType.MeshLineRenderer) { RoadNetworkMesher.GenerateLineRenderer(road); } }
public void GenerateOpenDRIVELanesToMesh(string file) { testHelpers.GetTestRoadNetwork(file, out road); testHelpers.GenerateMeshTypeRoads(road, TestHelpers.MeshGenerationType.MeshRoad); var meshContainer = RoadNetworkMesher.GenerateMesh(road); var laneContainer = RoadNetworkMesher.GenerateMeshWithLanes(road); var roadContainer = new GameObject("TestOpenDRIVE"); meshContainer.name = "Mesh"; laneContainer.name = "Lanes"; meshContainer.transform.parent = roadContainer.transform; laneContainer.transform.parent = roadContainer.transform; Assert.IsNotNull(roadContainer, "TestOpenDrive was never created"); Assert.IsNotNull(meshContainer, "Mesh container was never created"); Assert.IsNotNull(laneContainer, "Lane container was never created"); Assert.IsNotEmpty(road.AllJunctions, "OpenDrive mesh doesn't junction contain data"); Assert.IsNotEmpty(road.AllRoads, "OpenDrive mesh doesn't road contain data"); LogAssert.NoUnexpectedReceived(); }