A small game engine for 2D games based of Raylib
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

31 rindas
766 B

#pragma once
#include <cmath>
#include <numbers>
namespace ant::core {
template<typename T = float>
struct Vec2 {
T X;
T Y;
};
template<typename T>
auto operator+(const Vec2<T>& lhs, const Vec2<T>& rhs) -> Vec2<T>{
return {.X = lhs.X + rhs.X, .Y = lhs.Y + rhs.Y};
}
template<typename T>
auto operator*(const Vec2<T>& lhs, const Vec2<T>& rhs) -> Vec2<T>{
return {.X = lhs.X * rhs.X, .Y = lhs.Y * rhs.Y};
}
template<typename T = float>
struct transform {
Vec2<T> position;
float angle;
};
template<typename T>
auto operator+(const transform<T>& lhs, const transform<T>& rhs) -> transform<T>{
return {.position = lhs.position + rhs.position, .angle = std::fmod<float>(lhs.angle + rhs.angle, 180.0f)};
}
}