public static Room RoomWithTiltedRoof(double radius) { var firstRightBottom = (0D, 0d, 0d); var firstRightTop = (0D, 0d, HeightLower); var firstLeftBottom = (0D, Width, 0d); var firstLeftTop = (0d, Width, HeightLower); var secondRightBottom = (Distance, 0d, 0d); var secondRightTop = (Distance, 0d, HeightHigher); var secondLeftBottom = (Distance, Width, 0d); var secondLeftTop = (Distance, Width, HeightHigher); var frontWall = new Wall(new Vector3D[] { firstRightBottom, firstRightTop, firstLeftTop, firstLeftBottom }); var oppositeWall = new Wall(new Vector3D[] { secondRightBottom, secondRightTop, secondLeftTop, secondLeftBottom }); var rightWall = new Wall(new Vector3D[] { firstRightBottom, secondRightBottom, secondRightTop, firstRightTop }); var leftWall = new Wall(new Vector3D[] { firstLeftBottom, secondLeftBottom, secondLeftTop, firstLeftTop }); var roof = new Wall(new Vector3D[] { firstRightTop, secondRightTop, secondLeftTop, firstLeftTop }); var floor = new Wall( new Vector3D[] { firstRightBottom, secondRightBottom, secondLeftBottom, firstLeftBottom }); var walls = new ITrackBoundary[] { frontWall, oppositeWall, rightWall, leftWall, roof, floor }.ToList(); walls = CreateCylinders(walls.ToList(), radius); walls = CreateSpheres(walls.ToList(), radius); return(new Room(walls, radius)); }
public static int Selector(ITrackBoundary trackBoundary) { switch (trackBoundary) { case Sphere _: return(0); case Cylinder _: return(1); case Wall _: return(2); default: throw new NotSupportedException(); } }