Original Post
Hi, when you use 2 classes, for example like these:
class CVertex {
public:
float x,y,z;
void Set(float _x,float _y,float _z);
};
class CNormal {
public:
float x,y,z;
void Set(float _x,float _y,float _z);
void Normalize();
};
Would it be faster in runtime when doing it with just one class like this:
class CVertex {
public:
float x,y,z;
void Set(float _x,float _y,float _z);
void Normalize();
};
Or does it not make any difference?
Thanks in advance.
Also i was wondering if there is a difference between having variables of classes in a parent class and having all variables all together in one (this sounds confusing i think, i mean this) :
class CPoint {
public:
CVertex v;
CNormal n;
};
so if that's slower than this:
class CPoint {
public:
float x,y,z;
float nx,ny,nz;
};
And in what amount.
I guess it all doesn't matter really much but just to be sure and out of interest.
Thanks
[edited by - Tree Penguin on June 7, 2004 6:09:28 PM]