/**
This file is a part of our_dick
Copyright (C) 2020 rexy712
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
#ifndef OUR_DICK_MATH_PROJECTION_HPP
#define OUR_DICK_MATH_PROJECTION_HPP
#include "mat.hpp"
#include "vec.hpp"
namespace math{
template
matrix fov_projection(T fov, T asp, T near, T far);
template
matrix fov_asymetric_projection(T fovl, T fovr, T fovb, T fovt, T asp, T near, T far);
template
matrix ortho_projection(T w, T h, T n, T f);
template
matrix ortho_asymetric_projection(T l, T r, T b, T t, T n, T f);
template
vec3 project(const mat4& viewproj_mat, const vec3& world_coords, const vec4& viewport);
template
vec3 unproject(const mat4& viewproj_mat, const vec3& viewport_coords, const vec4& viewport);
}
#include "projection.tpp"
#endif