namespace sf
{
class Angle
{
public:
constexpr Angle() = default;
constexpr Angle(float radians);
[[nodiscard]] constexpr float asDegrees() const;
[[nodiscard]] constexpr float asRadians() const;
[[nodiscard]] constexpr Angle wrapSigned() const;
// And other really usefull methods
private:
float m_radians{};
};
}
Vector2.hpp
namespace sf
{
template <typename T>
class Vector2
{
public:
constexpr Vector2() = default;
constexpr Vector2(T x, T y);
[[nodiscard]] constexpr T dot(Vector2 rhs) const;
[[nodiscard]] constexpr T cross(Vector2 rhs) const;
// And other really usefull methods
private:
T x{};
T y{};
};
using Vector2f = Vector2<float>;
// ...
}
Angle.hpp
Vector2.hpp
Angle.proto
Vector2f.proto
Problem
I really want to use native classes from C++, for this I need to manually transfer each time from classes generated by Protobuf to native ones
Solution
Python plugin
Run
Or inside 1 file.
Output