From 63c9e3ec8b51a9d96872a054a0d35e8591b3535d Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Mon, 15 Apr 2024 17:46:44 +1000 Subject: only round vertices if AA is on [skip ci] --- source/core/StarMatrix3.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source/core/StarMatrix3.hpp') diff --git a/source/core/StarMatrix3.hpp b/source/core/StarMatrix3.hpp index 04d8005..8cdd2d5 100644 --- a/source/core/StarMatrix3.hpp +++ b/source/core/StarMatrix3.hpp @@ -110,6 +110,8 @@ public: template Vec3 operator*(Vector const& v) const; + template + Vec2 operator*(Vector const& v) const; private: Rows m_rows; }; @@ -304,8 +306,7 @@ void Matrix3::scale(T scale, Vec2 const& point) { template template Vector Matrix3::transformVec2(Vector const& point) const { - Vector res = (*this) * Vector(point, 1); - return res.vec2(); + return (*this) * point; } template @@ -412,6 +413,13 @@ auto Matrix3::operator*(const Vector& u) const -> Vec3 { m_rows[2][0] * u[0] + m_rows[2][1] * u[1] + m_rows[2][2] * u[2]); } +template +template +auto Matrix3::operator*(const Vector& u) const -> Vec2 { + return Vec2(m_rows[0][0] * u[0] + m_rows[0][1] * u[1] + m_rows[0][2], + m_rows[1][0] * u[0] + m_rows[1][1] * u[1] + m_rows[1][2]); +} + template Matrix3 Matrix3::operator/(const T& s) const { return Matrix3(m_rows[0] / s, m_rows[1] / s, m_rows[2] / s); -- cgit v1.2.3