Representing the world with Dirichlet domains
Also called a Voronoi polygon, a Dirichlet domain is a way of dividing space into regions consisting of a set of points closer to a given seed point than to any other. This graph representation helps in distributing the space using Unity's primitives or existing meshes, thus not really adhering to the definition, but using the concept as a means to an end. Dirichlet domains are usually mapped using cones for delimiting the area of a given vertex, but we're adapting that principle to our specific needs and tool.
Getting ready
Before building our new Graph
class, it's important to create the VertexReport
class, make some modifications to our Graph
class, and add the Vertex
tag in the project:
Prepend the
VertexReport
class to theGraph
class specification, in the same file:public class VertexReport { public int vertex; public GameObject obj; public VertexReport(int vertexId, GameObject obj...