1
0
mirror of https://github.com/NoelFB/blah.git synced 2025-04-14 01:56:05 +08:00
blah/include/blah/numerics/mat3x2.h
2021-05-09 17:23:02 -07:00

47 lines
1.3 KiB
C++

#pragma once
namespace Blah
{
struct Vec2;
struct Mat3x2
{
float m11;
float m12;
float m21;
float m22;
float m31;
float m32;
Mat3x2();
Mat3x2(float m11, float m12, float m21, float m22, float m31, float m32);
Mat3x2 invert() const;
float scaling_factor() const;
Mat3x2 operator *(const Mat3x2& rhs) const;
Mat3x2 operator +(const Mat3x2& rhs) const;
Mat3x2 operator -(const Mat3x2& rhs) const;
Mat3x2& operator *=(const Mat3x2& rhs);
bool operator==(const Mat3x2& rhs);
bool operator!=(const Mat3x2& rhs);
static const Mat3x2 identity;
static Mat3x2 create_translation(const Vec2& position);
static Mat3x2 create_translation(float x, float y);
static Mat3x2 create_scale(float scale);
static Mat3x2 create_scale(Vec2 scale);
static Mat3x2 create_scale(float x, float y);
static Mat3x2 create_scale(float scale, Vec2 centerPoint);
static Mat3x2 create_scale(Vec2 scale, Vec2 centerPoint);
static Mat3x2 create_scale(float scaleX, float scaleY, Vec2 centerPoint);
static Mat3x2 create_rotation(float radians);
static Mat3x2 create_transform(const Vec2& position, const Vec2& origin, const Vec2& scale, float rotation);
static Mat3x2 add(const Mat3x2& a, const Mat3x2& b);
static Mat3x2 subtract(const Mat3x2& a, const Mat3x2& b);
static Mat3x2 multiply(const Mat3x2& a, const Mat3x2& b);
};
}