Hello. I get an error when trying to get value from another class which are also in one big class. Error: Type name is not allowed.
Here is the actual code:
namespace vector2d
{
class fvector
{
public:
class pixelQuantity
{
float px_quantity = 0.0f;
float px_quantity_x_cycle = 0.0f;
float px_quantity_y_cycle = 0.0f;
};
class transform
{
class position
{
float x1 = 0.0f;
float y1 = 0.0f;
float x2 = 0.0f;
float y2 = 0.0f;
//Calculate X Center of a vector
float centerx()
{
return (x2 - x1) / 2.0f;
}
//Calculate Y Center of a vector
float centery()
{
return (y2 - y1) / 2.0f;
}
};
class rotation
{
float angle = 0.0f;
pivot pivot_rotation = center;
rotation_direction_ rotation_direction = clockwise;
};
class size
{
int thickness_l = 1; //thickness left
int thickness_r = 1; //thickness right
//Calculate Vector's magnitude
float magnitude()
{
float adx = fabs(position.x2 - position.x1);
float ady = fabs(position.y2 - position.y1);
return sqrt(adx * adx + ady * ady);
}
};
};
Error is in the magnitude() function and when i create an object vector2d::fvector v1() and try to access v1.transform i also get an error that Type name is not allowed.