i have a struct sVect3D (basically a structure holding x,y,z coordinates. i also have a camera class (basically used for all the info on the camera, and some different ways of manipulating the camera position, most of which isn't implemented (yet - mainly because i ran to a snag...)
i want to return sVect3D from GetAngle();
been 4 years since i last touched c++ compiler so i have like no idea what i'm doing atm
struct sVect3D {
float x;
float y;
float z;
};
class cCamera {
private:
sVect3D pos, angle;
int type;
unsigned byte err; // 0 = no error.
public:
cCamera();
cCamera(float x, float y, float z);
cCamera(float x, float y, float z, float ax, float ay, float az);
~cCamera();
sVect3D GetAngle();
sVect3D GetPos();
void SetPos(float x, float y, float z);
void SetAngle(float x, float y, float z);
/* i want to get rid of this part.
float GetPosX();
float GetPosY();
float GetPosZ();
float GetAngleX();
float GetAngleY();
float GetAngleZ();
*/
bool error(); // is there an error?
// byte whaterror();
};
so how should i define the GetAngle()?
what i want to do, is instead of writing
x = cam->GetPosX();
y = cam->GetPosY();
z = cam->GetPosZ();
dbPositionCamera(x,y,z);
i want to write something like
sVect3D pos;
pos = cam->GetPos();
dbPositionCamera(pos.x,pos.y,pos.z);
i hope someone understands half of what i'm trying to do