I have a 2D array organized as
float vertices[3][3]
In one iterative loop of my program, I see in my debugger that the the array fills up as so:
vertices[0] = {-1, -1, 1}
vertices[1] = {-1, -.5, .5}
vertices[2] = {-.5, -1, .5}
I then pass the three vertices to my triangle class.
Triangle *t = new Triangle(vertices[0], vertices[1], vertices[2]);
triangles.push_back(*t);
The triangle constructor is coded as so:
Triangle::Triangle(float *a, float *b, float *c)
{
memcpy(v1, a, sizeof(a));
memcpy(v2, b, sizeof(b));
memcpy(v3, c, sizeof(c));
}
My debugger now shows
v1 = {-1, -431602080, -431602080}
v2 = {-1, -431602080, -431602080}
v3 = {-.5, -431602080, -431602080}
Debugger also shows that a/b/c are only 1 element long? So apparently only the first element of the array is being passed?