NGL  6.5
The NCCA Graphics Library
ngl Namespace Reference

implementation files for RibExport class More...

Classes

class  AABB
 
class  AbstractMesh
 an abstract base mesh used to build specific meshes such as Obj More...
 
class  AbstractSerializer
 an abstract base clase for all serialization in NGL More...
 
class  AbstractVAO
 base class for all VAO from the VAOFactory this defines the base class type with simple draw / bind behaviour, the user must allocate the data and do any more complex setup. See SimpleVAO for examples as well as the other ngl examples More...
 
class  BBox
 Simple Bounding box class used in various parts of ngl and other example programs. More...
 
class  BezierCurve
 Generic Bezier Curve Class allowing the user to generate basic curves using a number of different constriction methods, such as array of Vectors, array of numbers etc The class can automatically generate knot vectors as well or the user can specify their own. More...
 
class  Camera
 simple camera class to allow movement in an opengl scene. a lot of this stuff is from the HILL book Computer Graphics with OpenGL 2nd Ed Prentice Hall a very good book fustrum culling modified from http://www.lighthouse3d.com/opengl/viewfrustum/index.php?defvf More...
 
class  Colour
 simple class to hold colour information and set the basic opengl colour state. also has overloaded methods to do basic math on colour values. More...
 
class  Face
 simple class used to encapsulate a single face of an abstract mesh file More...
 
struct  FontChar
 a structure to hold the font char texture id and the vao. The vao for each font will be a different size need to investigate is a scale would be quicker / more efficient than storing multiple billboards (some will be the same size) More...
 
class  HouDictionaryEntry
 a class to hold the dictionary entries for the houdini geo header this will be put into a map for easy lookup of the data when parsing More...
 
class  HoudiniGeo
 a class to load in the ASCII houdini .geo files for poly data the spec for the format can be found here http://www.sidefx.com/docs/houdini9.5/io/formats/geo More...
 
class  Image
 
class  IndexRef
 a class to hold the index into vert / norm and tex list for creating the VBO data structure More...
 
class  Light
 Simple class to encapsulate OpenGL Light functions this will fill in the following structure. More...
 
class  Logger
 
class  Mat3
 Mat3 basic 3x3 matrix for certain glsl ops. More...
 
class  Mat4
 Matrix Class to do simple matrix operations included operator overloaded functions for maths and matrix * vector type maths. More...
 
class  MultiBufferVAO
 Simple non index vao using multiple buffers see https://github.com/NCCA/VertexArrayObject/tree/master/MultiBufferVAOFactory for examples of use. More...
 
class  NCCABinMesh
 basically this class Loads the contents of the current VBO to file, this is basically the AbstractMesh packed Vert, Texture cord and Normal data Which are stored in contiguous blocks from the Parent Save method. this will then create a VBO which can be mapped and drawn etc. More...
 
class  NCCAPointBake
 Class to load and manipulate NCCAPointBake data, this will replace the Houdini Clip files as they are now not supported in the educational version of Houdini. More...
 
class  NGLInit
 a class to initialise all of the ngl elements includeing GLEW if needed as well vbo prims this class is a singletone so can only be created once More...
 
class  Obj
 used to load in an alias wave front obj format file and draw using open gl has been completly re-written to use boost::spirit parser, most of this code is a modified version of the OBJReader class from the cortex-vfx lib framework here http://code.google.com/p/cortex-vfx/ More...
 
class  PathCamera
 Inherits from Camera and adds a path for both eye and look using two Bezier Curves. More...
 
class  Plane
 
class  Quaternion
 
class  Random
 wrapper for std random and distribution functions, it will generate two basic random functions for RandPositiveFloat (0-1) and RandFloat() +/- 1 these are also overloaded to have a param for range added to this are functions for Random Colours and Vectors and Points and also the ability to add other distributions random library. More...
 
class  RibExport
 simple rib export class, attempts to auto tab the rib file etc. needs lots of work to make it complete!! More...
 
class  Shader
 and encapsulation of an OpenGL Shader object with associations for source code, etc. Used in conjunction with the ShaderProgram class More...
 
class  ShaderLib
 Singleton Class to init and Use GLSL Shaders the class stores the shaders as a map of shader objects and they can be found by name Updated to use templated singleton Updated to use a map to store the shaders by name and hence removed the name from the ShaderObject Class Also Added methods to adjust shader parameters by shader / param name, at present use only 1-4 Floats and a few others need to think of a better way of doing this. More...
 
class  ShaderProgram
 
class  SimpleIndexVAO
 Simple indexed vao using one buffer and float data see https://github.com/NCCA/VertexArrayObject/tree/master/SimpleIndexVAOFactory for examples of use. More...
 
class  SimpleVAO
 Simple non index vao using one buffer and float data see https://github.com/NCCA/VertexArrayObject/tree/master/SimpleVAOFactory for examples of use. More...
 
class  Singleton
 Singleton template added to NGL framework 20/04/10 by jmacey. More...
 
class  SpotLight
 Encapsulation of OpenGL spotlight inherits from the Light class. More...
 
class  Text
 
class  Texture
 simple texture object using QImage to load and convert to OpenGL texturing, needs loads of work for multi texture support etc as well as different texture types More...
 
class  Transformation
 Transformation describes a transformation (translate, scale, rotation) modifed by j macey and included into NGL. More...
 
class  VAOFactory
 extensible factory to allow different types of VAO's to be generated for NGL two default ones will be created but allows the user to do more complex stuff if required More...
 
class  VAOPrimitives
 VAO based object primitives used for fast openGL drawing this is a singelton class so we use the instance method to get access and construct the only instance. More...
 
class  Vec2
 simple Vec2 encapsulates a 3 float object like glsl Vec2 but not maths use the Vec2 class for maths and the asVec2 to return a Vec2 More...
 
class  Vec3
 simple Vec3 encapsulates a 3 float object like glsl vec3 but not maths use the Vec3 class for maths and the asVec3 to return a vec3 More...
 
class  Vec4
 simple Vector class for OpenGL graphics, contains overloaded operators for most math functions, including operators for manipulation by Point3 and Matrix has a simple union to allow data to be access as x,y,z,w or float[4] array More...
 
struct  vertData
 
struct  VertData
 
class  VertexArrayObject
 a class to encapsulate an OpenGL VAO More...
 
class  XMLSerializer
 

Typedefs

typedef boost::tokenizer< boost::char_separator< char > > tokenizer
 
typedef spt::rule< spt::phrase_scanner_t > srule
 
using PRECISION = GLfloat
 Set the PRECISION of all data types Set PRECISION to be a GLfloat so we only have to change one value to set the data type. More...
 
using Real = PRECISION
 create a variable called Real which is the main data type we use (GLfloat for most cases) More...
 

Enumerations

enum  CameraIntercept : char { CameraIntercept::OUTSIDE, CameraIntercept::INTERSECT, CameraIntercept::INSIDE }
 
enum  LightModes : char { LightModes::DIRECTIONALLIGHT, LightModes::POINTLIGHT, LightModes::SPOTLIGHT =1 }
 
enum  Colours : char {
  Colours::CNORMAL, Colours::RED, Colours::GREEN, Colours::YELLOW,
  Colours::BLUE, Colours::MAGENTA, Colours::CYAN, Colours::WHITE,
  Colours::RESET
}
 
enum  TimeFormat : char { TimeFormat::TIME, TimeFormat::TIMEDATE, TimeFormat::TIMEDATEDAY }
 
enum  RANDDIST {
  RANDDIST::uniform_smallint, RANDDIST::uniform_int, RANDDIST::uniform_real, RANDDIST::bernoulli_distribution,
  RANDDIST::binomial_distribution, RANDDIST::cauchy_distribution, RANDDIST::gamma_distribution, RANDDIST::poisson_distribution,
  RANDDIST::geometric_distribution, RANDDIST::triangle_distribution, RANDDIST::exponential_distribution, RANDDIST::normal_distribution,
  RANDDIST::lognormal_distribution
}
 enumerated list of the different distributions we can add to the generator, More...
 
enum  ShaderType : char {
  ShaderType::VERTEX, ShaderType::FRAGMENT, ShaderType::GEOMETRY, ShaderType::TESSCONTROL,
  ShaderType::TESSEVAL, ShaderType::COMPUTE, ShaderType::NONE
}
 
enum  ActiveMatrix : char { ActiveMatrix::NORMAL, ActiveMatrix::TRANSPOSE, ActiveMatrix::INVERSE }
 

Functions

NGL_DLLEXPORT std::ostream & operator<< (std::ostream &_output, const Vec2 &_s)
 insertion operator to print out the Vec2 More...
 
NGL_DLLEXPORT std::istream & operator>> (std::istream &_input, Vec2 &_s)
 extraction operator to read in the Vec2 More...
 
NGL_DLLEXPORT std::ostream & operator<< (std::ostream &_output, const Vec3 &_s)
 insertion operator to print out the Vec3 More...
 
NGL_DLLEXPORT std::istream & operator>> (std::istream &_input, Vec3 &_s)
 extraction operator to read in the Vec3 More...
 
NGL_DLLEXPORT std::ostream & operator<< (std::ostream &_output, const Vec4 &_s)
 insertion operator to print out the vector More...
 
NGL_DLLEXPORT std::istream & operator>> (std::istream &_input, Vec4 &_s)
 extraction operator to read in the vector More...
 
NGL_DLLEXPORT std::ostream & operator<< (std::ostream &_output, const Camera &_c)
 << extraction operator to prints out the colour in the format [r,g,b,a] More...
 
NGL_DLLEXPORT std::ostream & operator<< (std::ostream &_output, const Colour &_s)
 << extraction operator to prints out the colour in the format [r,g,b,a] More...
 
NGL_DLLEXPORT std::istream & operator>> (std::istream &_input, Colour &_s)
 

insertion operator to read in the colour data r -> g -> b -> a

More...
 
NGL_DLLEXPORT std::ostream & operator<< (std::ostream &output, const Mat3 &M)
 insertion operator to write matrix to stream More...
 
NGL_DLLEXPORT std::ostream & operator<< (std::ostream &output, const Mat4 &M)
 insertion operator to write matrix to stream More...
 
NGL_DLLEXPORT std::ostream & operator<< (std::ostream &i_s, const Quaternion &i_q)
 the streaming operator for the quaternion More...
 
void printInfoLog (const GLuint &_obj)
 
void ceckGLError (const std::string &_file, const int _line) noexcept
 
unsigned int nearestPowerOfTwo (unsigned int _num)
 code taken from here http://jeffreystedfast.blogspot.com/2008/06/calculating-nearest-power-of-2.html More...
 
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 More...
 
NGL_DLLEXPORT Vec3 calcNormal (const Vec3 &_p1, const Vec3 &_p2, const Vec3 &_p3) noexcept
 calculates the normal from 3 points and return the new normal as a Vector More...
 
NGL_DLLEXPORT Real radians (const Real _deg) noexcept
 converts Degrees to Radians More...
 
NGL_DLLEXPORT Real degrees (const Real _rad) noexcept
 converts Radians to Degrees More...
 
NGL_DLLEXPORT void NGLCheckGLError (const std::string &_file, const int _line) noexcept
 check for openGL errors and print out. More...
 
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 prorting glm code easier http://glm.g-truc.net/ More...
 
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 prorting glm code easier http://glm.g-truc.net/ More...
 
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 prorting glm code easier http://glm.g-truc.net/ More...
 
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 code easier http://glm.g-truc.net/ More...
 
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 help make porting glm code easier http://glm.g-truc.net/ More...
 
NGL_DLLEXPORT Mat4 ortho (Real _left, Real _right, Real _bottom, Real _top) noexcept
 calculate an ortho graphic projection at matrix similar to the one from the GLM library this is to help make porting glm code easier http://glm.g-truc.net/ More...
 
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 code easier http://glm.g-truc.net/ More...
 
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 http://glm.g-truc.net/ More...
 
NGL_DLLEXPORT Vec3 project (const Vec3 &_pos, const Mat4 &_model, const Mat4 &_project, const Vec4 &_viewport) noexcept
 
NGL_DLLEXPORT bool isPowerOfTwo (unsigned int _x) noexcept
 returns if value is a power of 2 More...
 
NGL_DLLEXPORT unsigned int nextPow2 (unsigned int _x) noexcept
 rounds up the value to next power of 2 More...
 
bool operator== (const ngl::Mat3 &_m1, const ngl::Mat3 &_m2)
 
bool operator== (const ngl::Mat4 &_m1, const ngl::Mat4 &_m2)
 
NGL_DLLEXPORT std::ostream & operator<< (std::ostream &_output, TransformStack &_m)
 insertion operator to write matrix to stream More...
 
NGL_DLLEXPORT std::istream & operator>> (std::istream &_ifs, Quaternion &_q)
 the streaming operator for the quaternion More...
 
template<typename T >
lerp (T _a, T _b, Real _t) noexcept
 a simple template function for Linear Interpolation requires that any classes have More...
 
template<typename T >
trigInterp (T _a, T _b, Real _t) noexcept
 
template<typename T >
cubic (T _a, T _b, Real _t) noexcept
 
Vec2 operator* (Real _k, const Vec2 &_v) noexcept
 scalar * vector operator More...
 
Vec3 operator* (Real _k, const Vec3 &_v) noexcept
 scalar * vector operator More...
 
Vec4 operator* (Real _k, const Vec4 &_v) noexcept
 scalar * vector operator More...
 

Variables

constexpr GLubyte indices []
 
constexpr GLubyte lindices []
 
constexpr Real CAMERANEARLIMIT =0.00001f
 
constexpr int buddahSIZE =2400000
 
static float buddah [buddahSIZE]
 
constexpr int bunnySIZE =1671984
 
static float bunny [bunnySIZE]
 
constexpr int cubeSIZE =288
 
static const float cube [cubeSIZE]
 
constexpr int dodecahedronSIZE =864
 
static float dodecahedron [dodecahedronSIZE]
 
constexpr int dragonSIZE =2400000
 
static const float dragon [dragonSIZE]
 
constexpr int footballSIZE =2784
 
static float football [footballSIZE]
 
constexpr int icosahedronSIZE =480
 
static float icosahedron [icosahedronSIZE]
 
static const int OctahedronSIZE =192
 
static float Octahedron [OctahedronSIZE]
 
constexpr unsigned int teapotSIZE =337608
 
static float teapot [teapotSIZE]
 
constexpr int trollSIZE =876288
 
static float troll [trollSIZE]
 
constexpr auto RandomFloat ="RandomFloat"
 
constexpr auto RandomPositiveFloat ="RandomPositiveFloat"
 
constexpr float EPSILON = 0.001f
 define EPSILON for floating point comparison More...
 
constexpr Real TWO_PI = Real(2*M_PI)
 pre-compute the value for value for 2*PI convert to float to suppress windows warning as well More...
 
constexpr Real PI =Real(M_PI)
 pre-compute the value for value for PI based on system M_PI More...
 
constexpr Real PI2 =Real(M_PI/2.0)
 pre-compute the value for value for PI/2.0 More...
 
constexpr Real PI4 =Real(M_PI/4.0)
 pre-compute the value for value for PI/4.0 More...
 

Detailed Description

implementation files for RibExport class

logger class for writing to stream and file.

: bundled all the graphics lib code in this namespace to allow several global namespace enums and variables

Typedef Documentation

using ngl::PRECISION = typedef GLfloat

Set the PRECISION of all data types Set PRECISION to be a GLfloat so we only have to change one value to set the data type.

Definition at line 121 of file Types.h.

using ngl::Real = typedef PRECISION

create a variable called Real which is the main data type we use (GLfloat for most cases)

Definition at line 127 of file Types.h.

typedef spt::rule<spt::phrase_scanner_t> ngl::srule

Definition at line 35 of file Obj.cpp.

typedef boost::tokenizer<boost::char_separator<char> > ngl::tokenizer

Definition at line 30 of file NCCAPointBake.cpp.

Enumeration Type Documentation

enum ngl::ActiveMatrix : char
strong
Enumerator
NORMAL 
TRANSPOSE 
INVERSE 

Definition at line 34 of file Transformation.h.

enum ngl::CameraIntercept : char
strong
Enumerator
OUTSIDE 
INTERSECT 
INSIDE 

Definition at line 36 of file Camera.h.

enum ngl::Colours : char
strong
Enumerator
CNORMAL 
RED 
GREEN 
YELLOW 
BLUE 
MAGENTA 
CYAN 
WHITE 
RESET 

Definition at line 16 of file Logger.h.

enum ngl::LightModes : char
strong
Enumerator
DIRECTIONALLIGHT 
POINTLIGHT 

directional light from old OPenGL

SPOTLIGHT 

point light

Definition at line 40 of file Light.h.

enum ngl::RANDDIST
strong

enumerated list of the different distributions we can add to the generator,

Enumerator
uniform_smallint 
uniform_int 
uniform_real 
bernoulli_distribution 
binomial_distribution 
cauchy_distribution 
gamma_distribution 
poisson_distribution 
geometric_distribution 
triangle_distribution 
exponential_distribution 
normal_distribution 
lognormal_distribution 

Definition at line 37 of file Random.h.

enum ngl::ShaderType : char
strong
Enumerator
VERTEX 
FRAGMENT 
GEOMETRY 
TESSCONTROL 
TESSEVAL 
COMPUTE 
NONE 

Definition at line 30 of file Shader.h.

enum ngl::TimeFormat : char
strong
Enumerator
TIME 
TIMEDATE 
TIMEDATEDAY 

Definition at line 17 of file Logger.h.

Function Documentation

NGL_DLLEXPORT Vec3 ngl::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

Parameters
[in]_p1the first point
[in]_p2the second point
[in]_p3the third point
Returns
the normal of the 3 points

Definition at line 31 of file Util.cpp.

References ngl::Vec3::m_x, ngl::Vec3::m_y, and ngl::Vec3::m_z.

NGL_DLLEXPORT Vec3 ngl::calcNormal ( const Vec3 _p1,
const Vec3 _p2,
const Vec3 _p3 
)
noexcept

calculates the normal from 3 points and return the new normal as a Vector

Parameters
[in]_p1the first point
[in]_p2the second point
[in]_p3the third point
Returns
the normal of the 3 points

Definition at line 61 of file Util.cpp.

References ngl::Vec3::m_x, ngl::Vec3::m_y, and ngl::Vec3::m_z.

void ngl::ceckGLError ( const std::string _file,
const int  _line 
)
noexcept

Definition at line 585 of file ShaderLib.cpp.

References NGLCheckGLError().

+ Here is the call graph for this function:

template<typename T >
T ngl::cubic ( _a,
_b,
Real  _t 
)
noexcept

Definition at line 209 of file Util.h.

NGL_DLLEXPORT Real ngl::degrees ( const Real  _rad)
noexcept

converts Radians to Degrees

Parameters
[in]_radthe angle in radians
Returns
the angle in Degrees

Definition at line 95 of file Util.cpp.

+ Here is the caller graph for this function:

NGL_DLLEXPORT Mat4 ngl::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 code easier http://glm.g-truc.net/

Parameters
[in]_leftthe left most value of the projection
[in]_rightthe right most value of the projection
[in]_bottomthe bottom most value of the projection
[in]_topthe top most value of the projection
[in]_zNearthe near plane for projection
[in]_zFarthe far plane for the projection

Definition at line 251 of file Util.cpp.

References ngl::Mat4::m_00, ngl::Mat4::m_11, ngl::Mat4::m_20, ngl::Mat4::m_21, ngl::Mat4::m_22, ngl::Mat4::m_23, ngl::Mat4::m_32, and ngl::Mat4::null().

+ Here is the call graph for this function:

NGL_DLLEXPORT Mat4 ngl::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 prorting glm code easier http://glm.g-truc.net/

Parameters
[in]_fovythe fov of the camera frustrum
[in]_aspectthe aspect ratio of the screen
[in]_zNearthe near plane for projection

Definition at line 180 of file Util.cpp.

References ngl::Mat4::m_00, ngl::Mat4::m_11, ngl::Mat4::m_22, ngl::Mat4::m_23, ngl::Mat4::m_32, ngl::Mat4::null(), and radians().

+ Here is the call graph for this function:

NGL_DLLEXPORT bool ngl::isPowerOfTwo ( unsigned int  _x)
noexcept

returns if value is a power of 2

Parameters
[in]_xvalue to check
Returns
true if a power of 2

Definition at line 301 of file Util.cpp.

template<typename T >
T ngl::lerp ( _a,
_b,
Real  _t 
)
noexcept

a simple template function for Linear Interpolation requires that any classes have

  • - and * scalar (i.e. Real) overloaded operators In the graphics lib this will work for Vector and Colour
    Parameters
    [in]_athe template value for the first parameter
    [in]_bthe template value for the first parameter
    [in]_tthe value for the blend between _a and _b must be between 0 - 1

Definition at line 196 of file Util.h.

NGL_DLLEXPORT Mat4 ngl::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 code easier http://glm.g-truc.net/

Parameters
[in]_eyethe eye position
[in]_centerwhere we are looking at
[in]_upthe nominal up direction of the camera

Definition at line 201 of file Util.cpp.

References ngl::Vec3::cross(), ngl::Mat4::m_00, ngl::Mat4::m_01, ngl::Mat4::m_02, ngl::Mat4::m_10, ngl::Mat4::m_11, ngl::Mat4::m_12, ngl::Mat4::m_20, ngl::Mat4::m_21, ngl::Mat4::m_22, ngl::Mat4::m_30, ngl::Mat4::m_31, ngl::Mat4::m_32, ngl::Vec3::m_x, ngl::Vec3::m_y, ngl::Vec3::m_z, and ngl::Vec3::normalize().

+ Here is the call graph for this function:

unsigned int ngl::nearestPowerOfTwo ( unsigned int  _num)

code taken from here http://jeffreystedfast.blogspot.com/2008/06/calculating-nearest-power-of-2.html

Parameters
_numthe number we wish to get the nearest power from

Definition at line 40 of file Text.cpp.

+ Here is the caller graph for this function:

NGL_DLLEXPORT unsigned int ngl::nextPow2 ( unsigned int  _x)
noexcept

rounds up the value to next power of 2

Parameters
[in]_xvalue to round
Returns
the next pow 2 value

Definition at line 312 of file Util.cpp.

NGL_DLLEXPORT void ngl::NGLCheckGLError ( const std::string _file,
const int  _line 
)
noexcept

check for openGL errors and print out.

Parameters
[in]_filethe current file where the error occured
[in]_linethe line number

Definition at line 101 of file Util.cpp.

References GL_INVALID_ENUM, GL_INVALID_FRAMEBUFFER_OPERATION, GL_INVALID_OPERATION, GL_INVALID_VALUE, GL_NO_ERROR, GL_OUT_OF_MEMORY, GL_STACK_OVERFLOW, GL_STACK_UNDERFLOW, and glGetError().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Vec2 ngl::operator* ( Real  _k,
const Vec2 _v 
)
inlinenoexcept

scalar * vector operator

Parameters
_kthe float value
_vthe vector value
Returns
a vector _k*v

Definition at line 286 of file Vec2.h.

+ Here is the caller graph for this function:

Vec3 ngl::operator* ( Real  _k,
const Vec3 _v 
)
inlinenoexcept

scalar * vector operator

Parameters
_kthe float value
_vthe vector value
Returns
a vector _k*v

Definition at line 341 of file Vec3.h.

Vec4 ngl::operator* ( Real  _k,
const Vec4 _v 
)
inlinenoexcept

scalar * vector operator

Parameters
_kthe float value
_vthe vector value
Returns
a vector _k*v

Definition at line 355 of file Vec4.h.

NGL_DLLEXPORT std::ostream & ngl::operator<< ( std::ostream &  _output,
const Vec2 _s 
)

insertion operator to print out the Vec2

Parameters
[in]_outputthe stream to write to
[in]_sthe Vec2 to write

Definition at line 15 of file NGLStream.cpp.

References ngl::Vec2::m_x, and ngl::Vec2::m_y.

NGL_DLLEXPORT std::ostream & ngl::operator<< ( std::ostream &  _output,
const Vec3 _s 
)

insertion operator to print out the Vec3

Parameters
[in]_outputthe stream to write to
[in]_sthe Vec3 to write

Definition at line 27 of file NGLStream.cpp.

References ngl::Vec3::m_x, ngl::Vec3::m_y, and ngl::Vec3::m_z.

NGL_DLLEXPORT std::ostream & ngl::operator<< ( std::ostream &  _output,
const Vec4 _s 
)

insertion operator to print out the vector

Parameters
[in]_outputthe stream to write to
[in]_sthe vector to write

Definition at line 39 of file NGLStream.cpp.

References ngl::Vec4::m_w, ngl::Vec4::m_x, ngl::Vec4::m_y, and ngl::Vec4::m_z.

NGL_DLLEXPORT std::ostream & ngl::operator<< ( std::ostream &  _output,
const Camera _c 
)

<< extraction operator to prints out the colour in the format [r,g,b,a]

Parameters
[in]_outputthe outstream class pointer
[in]_cthe camera to print out

Definition at line 50 of file NGLStream.cpp.

References ngl::Camera::getEye(), ngl::Camera::getLook(), and ngl::Camera::getUp().

+ Here is the call graph for this function:

NGL_DLLEXPORT std::ostream & ngl::operator<< ( std::ostream &  _output,
const Colour _s 
)

<< extraction operator to prints out the colour in the format [r,g,b,a]

Parameters
[in]_outputthe outstream class pointer
[in]_sthe colour to print out

Definition at line 56 of file NGLStream.cpp.

References ngl::Colour::m_a, ngl::Colour::m_b, ngl::Colour::m_g, and ngl::Colour::m_r.

NGL_DLLEXPORT std::ostream & ngl::operator<< ( std::ostream &  output,
const Mat3 M 
)

insertion operator to write matrix to stream

Parameters
[in]outputthe stream to write to
[in]Mthe matrix to write

Definition at line 70 of file NGLStream.cpp.

References ngl::Mat3::m_00, ngl::Mat3::m_01, ngl::Mat3::m_02, ngl::Mat3::m_10, ngl::Mat3::m_11, ngl::Mat3::m_12, ngl::Mat3::m_20, ngl::Mat3::m_21, and ngl::Mat3::m_22.

NGL_DLLEXPORT std::ostream & ngl::operator<< ( std::ostream &  output,
const Mat4 M 
)

insertion operator to write matrix to stream

Parameters
[in]outputthe stream to write to
[in]Mthe matrix to write

Definition at line 81 of file NGLStream.cpp.

References ngl::Mat4::m_00, ngl::Mat4::m_01, ngl::Mat4::m_02, ngl::Mat4::m_03, ngl::Mat4::m_10, ngl::Mat4::m_11, ngl::Mat4::m_12, ngl::Mat4::m_13, ngl::Mat4::m_20, ngl::Mat4::m_21, ngl::Mat4::m_22, ngl::Mat4::m_23, ngl::Mat4::m_30, ngl::Mat4::m_31, ngl::Mat4::m_32, and ngl::Mat4::m_33.

NGL_DLLEXPORT std::ostream & ngl::operator<< ( std::ostream &  i_s,
const Quaternion i_q 
)

the streaming operator for the quaternion

Parameters
[in]i_ifs- the input stream
[in]i_q- the place to read the values into

Definition at line 99 of file NGLStream.cpp.

References ngl::Quaternion::getS(), ngl::Quaternion::getX(), ngl::Quaternion::getY(), and ngl::Quaternion::getZ().

+ Here is the call graph for this function:

NGL_DLLEXPORT std::ostream& ngl::operator<< ( std::ostream &  _output,
TransformStack &  _m 
)

insertion operator to write matrix to stream

Parameters
[in]_outputthe stream to write to
[in]_mthe matrix-stack to write
bool ngl::operator== ( const ngl::Mat3 _m1,
const ngl::Mat3 _m2 
)
inline

Definition at line 297 of file Mat3.h.

References FCompare, and ngl::Mat3::m_openGL.

+ Here is the caller graph for this function:

bool ngl::operator== ( const ngl::Mat4 _m1,
const ngl::Mat4 _m2 
)
inline

Definition at line 335 of file Mat4.h.

References FCompare, and ngl::Mat4::m_openGL.

NGL_DLLEXPORT std::istream & ngl::operator>> ( std::istream &  _input,
Vec2 _s 
)

extraction operator to read in the Vec2

Parameters
[in]_inputthe stream read from
[in]_sthe Vec2 to write

Definition at line 20 of file NGLStream.cpp.

References ngl::Vec2::m_x, and ngl::Vec2::m_y.

NGL_DLLEXPORT std::istream & ngl::operator>> ( std::istream &  _input,
Vec3 _s 
)

extraction operator to read in the Vec3

Parameters
[in]_inputthe stream read from
[in]_sthe Vec3 to write

Definition at line 32 of file NGLStream.cpp.

References ngl::Vec3::m_x, ngl::Vec3::m_y, and ngl::Vec3::m_z.

NGL_DLLEXPORT std::istream & ngl::operator>> ( std::istream &  _input,
Vec4 _s 
)

extraction operator to read in the vector

Parameters
[in]_inputthe stream read from
[in]_sthe vector to write

Definition at line 44 of file NGLStream.cpp.

References ngl::Vec4::m_w, ngl::Vec4::m_x, ngl::Vec4::m_y, and ngl::Vec4::m_z.

NGL_DLLEXPORT std::istream & ngl::operator>> ( std::istream &  _input,
Colour _s 
)

insertion operator to read in the colour data r -> g -> b -> a

Parameters
[in]_inputthe instream class pointer
[in]_sthe colour to read in to

Definition at line 63 of file NGLStream.cpp.

References ngl::Colour::m_a, ngl::Colour::m_b, ngl::Colour::m_g, and ngl::Colour::m_r.

NGL_DLLEXPORT std::istream& ngl::operator>> ( std::istream &  _ifs,
Quaternion _q 
)

the streaming operator for the quaternion

Parameters
[in]_ifs- the input stream
[in]_q- the place to read the values into
NGL_DLLEXPORT Mat4 ngl::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 help make porting glm code easier http://glm.g-truc.net/

Parameters
[in]_leftthe left most value of the projection
[in]_rightthe right most value of the projection
[in]_bottomthe bottom most value of the projection
[in]_topthe top most value of the projection
[in]_zNearthe near plane for projection
[in]_zFarthe far plane for the projection

Definition at line 228 of file Util.cpp.

References ngl::Mat4::m_00, ngl::Mat4::m_11, ngl::Mat4::m_22, ngl::Mat4::m_30, ngl::Mat4::m_31, and ngl::Mat4::m_32.

NGL_DLLEXPORT Mat4 ngl::ortho ( Real  _left,
Real  _right,
Real  _bottom,
Real  _top 
)
noexcept

calculate an ortho graphic projection at matrix similar to the one from the GLM library this is to help make porting glm code easier http://glm.g-truc.net/

Parameters
[in]_leftthe left most value of the projection
[in]_rightthe right most value of the projection
[in]_bottomthe bottom most value of the projection
[in]_topthe top most value of the projection

Definition at line 240 of file Util.cpp.

References ngl::Mat4::m_00, ngl::Mat4::m_11, ngl::Mat4::m_22, ngl::Mat4::m_30, and ngl::Mat4::m_31.

NGL_DLLEXPORT Mat4 ngl::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 prorting glm code easier http://glm.g-truc.net/

Parameters
[in]_fovythe fov of the camera frustrum in degrees
[in]_aspectthe aspect ratio of the screen
[in]_zNearthe near plane for projection
[in]_zFarthe far plane for the projection

Definition at line 133 of file Util.cpp.

References ngl::Mat4::m_00, ngl::Mat4::m_11, ngl::Mat4::m_22, ngl::Mat4::m_23, ngl::Mat4::m_32, ngl::Mat4::null(), and radians().

+ Here is the call graph for this function:

NGL_DLLEXPORT Mat4 ngl::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 prorting glm code easier http://glm.g-truc.net/

Parameters
[in]_fovthe fov of the camera frustrum
[in]_widththe width of the screen
[in]_heightthe height of the screen
[in]_zNearthe near plane for projection
[in]_zFarthe far plane for the projection

Definition at line 162 of file Util.cpp.

References ngl::Mat4::m_00, ngl::Mat4::m_11, ngl::Mat4::m_22, ngl::Mat4::m_23, ngl::Mat4::m_32, ngl::Mat4::null(), and radians().

+ Here is the call graph for this function:

void ngl::printInfoLog ( const GLuint _obj)

Definition at line 31 of file Shader.cpp.

References GL_INFO_LOG_LENGTH, glGetShaderInfoLog, and glGetShaderiv.

+ Here is the caller graph for this function:

NGL_DLLEXPORT Vec3 ngl::project ( const Vec3 _pos,
const Mat4 _model,
const Mat4 _project,
const Vec4 _viewport 
)
noexcept

Definition at line 284 of file Util.cpp.

References ngl::Vec4::m_w.

NGL_DLLEXPORT Real ngl::radians ( const Real  _deg)
noexcept

converts Degrees to Radians

Parameters
[in]_degthe angle to convert
Returns
the angle in Radians

Definition at line 89 of file Util.cpp.

+ Here is the caller graph for this function:

template<typename T >
T ngl::trigInterp ( _a,
_b,
Real  _t 
)
noexcept

Definition at line 203 of file Util.h.

References radians().

+ Here is the call graph for this function:

NGL_DLLEXPORT Vec3 ngl::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 http://glm.g-truc.net/

Parameters
[in]_winthe window position
[in]_modelthe model matrix
[in]_projectthe projection matrix
[in]_viewportthe viewport extents.

Definition at line 265 of file Util.cpp.

References ngl::Vec4::m_w, ngl::Vec4::m_x, ngl::Vec4::m_y, ngl::Vec4::toVec3(), and ngl::Mat4::transpose().

+ Here is the call graph for this function:

Variable Documentation

float ngl::buddah[buddahSIZE]
static

Definition at line 27 of file Buddah.h.

constexpr int ngl::buddahSIZE =2400000

Definition at line 26 of file Buddah.h.

float ngl::bunny[bunnySIZE]
static

Definition at line 27 of file Bunny.h.

constexpr int ngl::bunnySIZE =1671984

Definition at line 26 of file Bunny.h.

constexpr Real ngl::CAMERANEARLIMIT =0.00001f

Definition at line 35 of file Camera.cpp.

const float ngl::cube[cubeSIZE]
static

Definition at line 29 of file Cube.h.

constexpr int ngl::cubeSIZE =288

Definition at line 27 of file Cube.h.

float ngl::dodecahedron[dodecahedronSIZE]
static

Definition at line 27 of file Dodecahedron.h.

constexpr int ngl::dodecahedronSIZE =864

Definition at line 26 of file Dodecahedron.h.

const float ngl::dragon[dragonSIZE]
static

Definition at line 29 of file Dragon.h.

constexpr int ngl::dragonSIZE =2400000

Definition at line 27 of file Dragon.h.

constexpr float ngl::EPSILON = 0.001f

define EPSILON for floating point comparison

Definition at line 131 of file Types.h.

float ngl::football[footballSIZE]
static

Definition at line 27 of file Football.h.

constexpr int ngl::footballSIZE =2784

Definition at line 26 of file Football.h.

float ngl::icosahedron[icosahedronSIZE]
static

Definition at line 27 of file Icosahedron.h.

constexpr int ngl::icosahedronSIZE =480

Definition at line 26 of file Icosahedron.h.

constexpr GLubyte ngl::indices[]
Initial value:
= {
0,1,5,0,4,5,
3,2,6,7,6,3,
0,1,2,3,2,0,
4,5,6,7,6,4,
0,3,4,4,7,3,
1,5,2,2,6,5
}

Definition at line 27 of file BBox.cpp.

constexpr GLubyte ngl::lindices[]
Initial value:
= {
0,3,7,4,0,
0,1,5,4,0,
1,2,6,5,1,
0,1,2,3,0,
4,5,6,7,4
}

Definition at line 37 of file BBox.cpp.

float ngl::Octahedron[OctahedronSIZE]
static

Definition at line 28 of file Octahedron.h.

const int ngl::OctahedronSIZE =192
static

Definition at line 27 of file Octahedron.h.

constexpr Real ngl::PI =Real(M_PI)

pre-compute the value for value for PI based on system M_PI

Definition at line 44 of file Util.h.

constexpr Real ngl::PI2 =Real(M_PI/2.0)

pre-compute the value for value for PI/2.0

Definition at line 48 of file Util.h.

constexpr Real ngl::PI4 =Real(M_PI/4.0)

pre-compute the value for value for PI/4.0

Definition at line 52 of file Util.h.

constexpr auto ngl::RandomFloat ="RandomFloat"

Definition at line 28 of file Random.cpp.

constexpr auto ngl::RandomPositiveFloat ="RandomPositiveFloat"

Definition at line 29 of file Random.cpp.

float ngl::teapot[teapotSIZE]
static

Definition at line 29 of file Teapot.h.

constexpr unsigned int ngl::teapotSIZE =337608

Definition at line 28 of file Teapot.h.

float ngl::troll[trollSIZE]
static

Definition at line 27 of file Troll.h.

constexpr int ngl::trollSIZE =876288

Definition at line 26 of file Troll.h.

constexpr Real ngl::TWO_PI = Real(2*M_PI)

pre-compute the value for value for 2*PI convert to float to suppress windows warning as well

Definition at line 40 of file Util.h.