#ifndef __MATH_H #define __MATH_H int mod(int a,int b); struct Vector2f{ float x; float y; Vector2f(); Vector2f(float _x, float _y); Vector2f operator+=(Vector2f _vec); }; struct Vector3f{ float x; float y; float z; Vector3f(); Vector3f(float _x, float _y, float _z); Vector3f operator+=(Vector3f _vec); Vector3f operator+(Vector3f _vec); Vector3f operator*(float c); Vector3f operator-(); }; Vector3f operator*(float c, Vector3f v); struct Vector3i{ int x; int y; int z; Vector3i(); Vector3i(int _x, int _y, int _z); Vector3i(Vector3f v); Vector3i operator+=(Vector3i _vec); Vector3i operator-(); bool operator==(Vector3i); }; struct Vertex{ Vector3f pos; Vector2f texturePos; Vertex(); Vertex(Vector3f pos,Vector2f texturePos); }; struct Matrix4f{ float M[4][4]; Matrix4f(); void Translate(Vector3f t); Matrix4f operator*(Matrix4f _m); }; struct Matrix4f ScaleMatrix(float s); struct Matrix4f PerspectiveProjectionMatrix( //Everything closer to the player than nearZ will be invisible float nearZ, //Everything further to the player than farZ will be invisible float farZ, float screenRatio); struct Matrix4f TranslationMatrix(Vector3f translation); struct Matrix4f YawRotationMatrix(float yaw); struct Matrix4f PitchRotationMatrix(float pitch); #endif