I am currently writing a Vector2d class in c++ and there is an "Angle" method which is used without an instance of vector2d (static). The problem is, user is able to call other non-static methods as you see here(all the other methods are non-static and therefore should not be seen).
But I don't want them to access the non-static methods. How can I do that?
Here is my .h and .cpp files for the Angle method.
Vector2D.h
static float Angle(Vector2D v, Vector2D v2);
Vector2D.cpp
float Vector2D::Angle(Vector2D v, Vector2D v2)
{
float _angle = acosf(v.Dot(v2) / (v.Magnitude() * v2.Magnitude()));
return _angle * 180 / PI;
}
Note: I use struct for Vector2D
I examined Unity's Vector2 class. They have exactly what I want to have I've tried to make the methods private but it does not solve anything