Has static helper math methods aka toRadians
Matrix now sets the correct elements because I thought my matrix was Column major but it wasn't
but the elements lined up when passing them to opengl is just meant that I was multiplying them together wrong
So when multiplying matrices you need to have them in this order last * third * second * first * point
Now since my matrices are row matrices (The last row has translation in it) This means vectors should be row vectors
Which means in normal maths it should be point * first but because I can't have mat4.h and vec4.h include each other
so instead the * operator is implemented in the matrix class BUT it still performs multiplication as if the vector was specified first
So even though your doing first * point it is calculating it as point * first. So out multiplication is really
last * third * second * (point * first) in actuallity
Vector array is no longer hard coded to 4 instead it uses a constant variable
Implemented unary - because it's needed in the camera object to negate a vector
Implemented length, normalisation and crossproduct between vectors
and can print a vector out
Turns out one of the problems I was having was caused because
I was multiplying my matrices and point in the wrong order, when my code was correct the shader was fucked
So now that I've unfucked my shader order I've also fixed my code
Camera now has up and movedir vectors, up defines what direction is UP
and move dir is used to move the camera when a key is pressed the correspnding direction in movedir is updates
this is then used to move the camera when it is updated
Direction is now where the camera is pointing and is updated by the mouse
which changes pitch,yaw,roll. So each frame direction is calculated using the pitch yaw roll
The position is now modified via movedir vector
The camera matrix is generated per frame, the up and direction vector crossproduct is calculated which gives a vector pointing to the right
Originally I had it around the other way which caused it to point to the left which fucked everything up
Then this vector to the right is used to caluclate the true 'up' with the direction vector, I also had this around the wrong way
These vectors are then used to initialise the camera matrix. I don't know why it works but it does
Then we tack on the inverse of cameras position as the translation
To much has changed, main points is that the perspective projection is now calculated using two functions instead
Added maths files