Hello,
I was wondering, is there any performance difference at all from doing this :
public class Class1
{
public Vertices[] vertices;
public Polygon[] polygons;
public Class1()
{
}
public struct Vertex
{
public float x;
public float y;
}
public class Polygon
{
public Vertex[] vertices;
}
}
to doing this ?
public class Class1
{
public Vertices[] vertices;
public Polygon[] polygons;
public Class1()
{
}
public struct Vertex
{
public float x;
public float y;
}
public class Polygon
{
public int[] verticesID; // And acess the vertices using their ID on the array.
}
}
Using the first options seems a little more neat and easy to use, so i was just wondering if there were any reasons at all for using the second option?
Vertices could also be a class, and there would be quite a lot of them.
Polygons can share the same vertices of the array.
Thanks!