#pragma once #include #include #include namespace ZL { struct Vector4f { std::array v = { 0.f, 0.f, 0.f, 0.f }; }; struct Vector3f { std::array v = { 0.f, 0.f, 0.f }; }; struct Vector2f { std::array v = {0.f, 0.f}; }; Vector2f operator+(const Vector2f& x, const Vector2f& y); Vector2f operator-(const Vector2f& x, const Vector2f& y); struct Matrix3f { std::array m = { 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, }; static Matrix3f Identity(); }; struct Matrix4f { std::array m = { 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f }; static Matrix4f Identity(); }; Matrix4f operator*(const Matrix4f& m1, const Matrix4f& m2); Matrix4f MakeOrthoMatrix(float width, float height, float zNear, float zFar); Matrix4f MakePerspectiveMatrix(float fovY, float aspectRatio, float zNear, float zFar); Matrix3f QuatToMatrix(const Vector4f& q); Vector4f QuatFromRotateAroundX(float angle); Vector4f QuatFromRotateAroundY(float angle); Vector4f QuatFromRotateAroundZ(float angle); Vector3f operator*(Vector3f v, float scale); Vector3f MultVectorMatrix(Vector3f v, Matrix3f mt); };