196 template <
typename T> T
lerp(T _a, T _b,
Real _t) noexcept
206 return _a*cos(angle)*cos(angle)+_b*sin(angle)*sin(angle);
209 template <
typename T> T
cubic( T _a, T _b,
Real _t) noexcept
211 Real v1=(2.0f*_t*_t*_t)-3.0
f*(_t*_t)+1.0f;
212 Real v2=-(2.0f*_t*_t*_t)+3.0
f*(_t*_t);
213 return (_a*v1)+(_b*
v2);
simple Vector class for OpenGL graphics, contains overloaded operators for most math functions...
main definition of types and namespace
NGL_DLLEXPORT Vec3 calcNormal(const Vec4 &_p1, const Vec4 &_p2, const Vec4 &_p3) noexcept
calculates the normal from 3 points and return the new normal as a Vector
constexpr Real PI
pre-compute the value for value for PI based on system M_PI
T trigInterp(T _a, T _b, Real _t) noexcept
constexpr Real PI2
pre-compute the value for value for PI/2.0
GLfloat GLfloat GLfloat v2
NGL_DLLEXPORT Mat4 perspectiveFov(Real const &_fov, Real const &_width, Real const &_height, Real const &_zNear, Real const &_zFar) noexcept
computer a perspective projection matrix similar to the one from the GLM library this is to help make...
simple Vec3 encapsulates a 3 float object like glsl vec3 but not maths use the Vec3 class for maths a...
NGL_DLLEXPORT Mat4 frustum(Real _left, Real _right, Real _bottom, Real _top, Real _nearVal, Real _farVal) noexcept
calculate frustum matrix similar to the one from the GLM library this is to help make porting glm cod...
NGL_DLLEXPORT bool isPowerOfTwo(unsigned int _x) noexcept
returns if value is a power of 2
implementation files for RibExport class
PRECISION Real
create a variable called Real which is the main data type we use (GLfloat for most cases) ...
encapsulates a 4d Homogenous Point / Vector object
NGL_DLLEXPORT Mat4 lookAt(const Vec3 &_eye, const Vec3 &_center, const Vec3 &_up) noexcept
calculate a look at matrix similar to the one from the GLM library this is to help make porting glm c...
NGL_DLLEXPORT Mat4 ortho(Real _left, Real _right, Real _bottom, Real _top, Real _zNear, Real _zFar) noexcept
calculate an ortho graphic projection at matrix similar to the one from the GLM library this is to he...
T cubic(T _a, T _b, Real _t) noexcept
constexpr Real TWO_PI
pre-compute the value for value for 2*PI convert to float to suppress windows warning as well ...
NGL_DLLEXPORT Vec3 project(const Vec3 &_pos, const Mat4 &_model, const Mat4 &_project, const Vec4 &_viewport) noexcept
NGL_DLLEXPORT Real degrees(const Real _rad) noexcept
converts Radians to Degrees
NGL_DLLEXPORT Real radians(const Real _deg)
converts Degrees to Radians
Matrix Class to do simple matrix operations included operator overloaded functions for maths and matr...
NGL_DLLEXPORT Mat4 perspective(Real _fovy, Real _aspect, Real _zNear, Real _zFar) noexcept
computer a perspective projection matrix similar to the one from the GLM library this is to help make...
NGL_DLLEXPORT Vec3 unProject(const Vec3 &_win, const Mat4 &_model, const Mat4 &_project, const Vec4 &_viewport) noexcept
unproject points similar to the one from the GLM library this is to help make porting glm code easier...
NGL_DLLEXPORT void NGLCheckGLError(const std::string &_file, const int _line) noexcept
check for openGL errors and print out.
GLsizei const GLchar *const * string
NGL_DLLEXPORT Mat4 infinitePerspective(Real _fovy, Real _aspect, Real _zNear) noexcept
computer a perspective projection matrix similar to the one from the GLM library this is to help make...
NGL_DLLEXPORT unsigned int nextPow2(unsigned int _x) noexcept
rounds up the value to next power of 2
T lerp(T _a, T _b, Real _t) noexcept
a simple template function for Linear Interpolation requires that any classes have ...
constexpr Real PI4
pre-compute the value for value for PI/4.0