TriangleVector.push_back(new Triangle);
Its a pointer...
there must be another reason for that error because that's the only way i create vectors.
well anyway I'm at home now not at school and it is working here and that's all I really care about.
Okay I take that back this isn't working anymore, here is the code
Code:
while(fin.good()) {
TriangleVector.push_back(new Triangle);
fin >> Dummy;
fin >> XA;
fin >> YA;
fin >> ZA;
fin >> Dummy;
fin >> Dummy;
fin >> XB;
fin >> YB;
fin >> ZB;
fin >> Dummy;
fin >> Dummy;
fin >> XC;
fin >> YC;
fin >> ZC;
TriangleVector[Index]->VertexA->X = XA;
TriangleVector[Index]->VertexA->Y = YA;
TriangleVector[Index]->VertexA->Z = ZA;
Here is what I am actually using for the triangle struct:
Code:
struct Vertex {
float X, Y, Z;
};
class Triangle{
struct VertexA {
float X, Y, Z;
};
struct VertexB {
float X, Y, Z;
};
struct VertexC {
float X, Y, Z;
};
};
vector<Triangle*>TriangleVector;
You can say it, I'm an idiot, but say that after you fix my problem