// TODO: Optimize this (super easy) Matrix Matrix::CreateRotation(Vector3 rotation) { Matrix x = CreateRotationX(rotation.x); Matrix y = CreateRotationY(rotation.y); Matrix z = CreateRotationZ(rotation.z); return z * x * y; }
Matrix Matrix::CreateRotationY(float radians) { Matrix m; CreateRotationY(m,radians); return m; }
/* Rotate matrix around Y axis. * ARGUMENTS: * - rotation angle in degrees * float angle; * RETURNS: * - rotated matrix around axis Y * Matrix &; */ Matrix &Matrix::RotateY( float angle ) { Matrix temp = CreateRotationY(angle); temp *= *this; *this = temp; return *this; } /* End of 'RotateY' function */
Matrix Matrix::CreateRotation(float x, float y, float z) { auto m = CreateRotationX(x) * CreateRotationY(y) * CreateRotationZ(z); return m; }
Matrix4x4 Matrix4x4::CreateRotation( const float pitch, const float yaw, const float roll, bool radians ) { return CreateRotationX( pitch, radians ) * CreateRotationY( yaw, radians ) * CreateRotationZ( roll, radians ); }