class Vector_3
{
float x,y,z;
};
But sometimes u need an array of 3 or 4 floats for opengl calls like light colors positions etc.
How do you handle this?Make it a float array?Or is there another way?
I overloaded the [] operator this way
const float &operator[](int i)
{
if(i==0)
return x;
else if(i==1)
return y;
else if(i==2)
return z;
}
But I dont think its a good way O_O