OGLplus (0.52.0) a C++ wrapper for OpenGL

GC-related math utilities

Classes

class  oglplus::Angle< T >
 Class implementing planar angle-related functionality. More...
 
class  oglplus::BezierCurves< Type, Parameter, Order >
 A sequence of Bezier curves, possibly connected at end points. More...
 
class  oglplus::CubicBezierLoop< Type, Parameter >
 A closed smooth cubic Bezier spline passing through all input points. More...
 
class  oglplus::ModelMatrix< T >
 Class implementing model transformation matrix named constructors. More...
 
class  oglplus::CameraMatrix< T >
 Class implementing camera matrix named constructors. More...
 
class  oglplus::Plane< T >
 Class implementing plane-related functionality. More...
 
class  oglplus::Quaternion< T >
 Template class for quaternions. More...
 
class  oglplus::QuaternionSLERP< T >
 Functor template for quaternion spherical-linear interpolation. More...
 
class  oglplus::BaseSLERP< Value, T >
 Base template for spherical-linear interpolation functors. More...
 
class  oglplus::Sphere< T >
 Class implementing sphere-related functionality. More...
 
class  oglplus::Vector< T, N >
 Basic template for vector types. More...
 

Typedefs

typedef Matrix< GLfloat, 2, 2 > oglplus::Mat2f
 2x2 float matrix
 
typedef Matrix< GLfloat, 2, 3 > oglplus::Mat2x3f
 2x3 float matrix
 
typedef Matrix< GLfloat, 2, 4 > oglplus::Mat2x4f
 2x4 float matrix
 
typedef Matrix< GLfloat, 3, 2 > oglplus::Mat3x2f
 3x2 float matrix
 
typedef Matrix< GLfloat, 3, 3 > oglplus::Mat3f
 3x3 float matrix
 
typedef Matrix< GLfloat, 3, 4 > oglplus::Mat3x4f
 3x4 float matrix
 
typedef Matrix< GLfloat, 4, 2 > oglplus::Mat4x2f
 4x2 float matrix
 
typedef Matrix< GLfloat, 4, 3 > oglplus::Mat4x3f
 4x3 float matrix
 
typedef Matrix< GLfloat, 4, 4 > oglplus::Mat4f
 4x4 float matrix
 
typedef Matrix< GLdouble, 2, 2 > oglplus::Mat2d
 2x2 double-precision matrix
 
typedef Matrix< GLdouble, 2, 3 > oglplus::Mat2x3d
 2x3 double-precision matrix
 
typedef Matrix< GLdouble, 2, 4 > oglplus::Mat2x4d
 2x4 double-precision matrix
 
typedef Matrix< GLdouble, 3, 2 > oglplus::Mat3x2d
 3x2 double-precision matrix
 
typedef Matrix< GLdouble, 3, 3 > oglplus::Mat3d
 3x3 double-precision matrix
 
typedef Matrix< GLdouble, 3, 4 > oglplus::Mat3x4d
 3x4 double-precision matrix
 
typedef Matrix< GLdouble, 4, 2 > oglplus::Mat4x2d
 4x2 double-precision matrix
 
typedef Matrix< GLdouble, 4, 3 > oglplus::Mat4x3d
 4x3 double-precision matrix
 
typedef Matrix< GLdouble, 4, 4 > oglplus::Mat4d
 4x4 double-precision matrix
 
typedef ModelMatrix< GLfloat > oglplus::ModelMatrixf
 Model transformation float matrix.
 
typedef ModelMatrix< GLdouble > oglplus::ModelMatrixd
 Model transformation double precision matrix.
 
typedef CameraMatrix< GLfloat > oglplus::CamMatrixf
 Camera matrix using float numbers.
 
typedef CameraMatrix< GLdouble > oglplus::CamMatrixd
 Camera matrix using double precition numbers.
 
typedef Quaternion< GLfloat > oglplus::Quatf
 Float quaternion.
 
typedef Quaternion< GLdouble > oglplus::Quatd
 Double-precision quaternion.
 
typedef Vector< GLint, 1 > oglplus::Vec1i
 1D int (degenerate) vector
 
typedef Vector< GLint, 2 > oglplus::Vec2i
 2D int vector
 
typedef Vector< GLint, 3 > oglplus::Vec3i
 3D int vector
 
typedef Vector< GLint, 4 > oglplus::Vec4i
 4D int vector
 
typedef Vector< GLfloat, 1 > oglplus::Vec1f
 1D float (degenerate) vector
 
typedef Vector< GLfloat, 2 > oglplus::Vec2f
 2D float vector
 
typedef Vector< GLfloat, 3 > oglplus::Vec3f
 3D float vector
 
typedef Vector< GLfloat, 4 > oglplus::Vec4f
 4D float vector
 
typedef Vector< GLdouble, 1 > oglplus::Vec1d
 1D double-precision (degenerate) vector
 
typedef Vector< GLdouble, 2 > oglplus::Vec2d
 2D double-precision vector
 
typedef Vector< GLdouble, 3 > oglplus::Vec3d
 3D double-precision vector
 
typedef Vector< GLdouble, 4 > oglplus::Vec4d
 4D double-precision vector
 

Functions

Angle< AngleValueType > oglplus::Radians (AngleValueType val_rad)
 Creates a new angle from a value in radians. More...
 
Angle< AngleValueType > oglplus::Degrees (AngleValueType val_deg)
 Creates a new angle from a value in degrees. More...
 
Angle< AngleValueType > oglplus::FullCircles (AngleValueType value)
 Creates a new angle from a value in "full circles" (i.e. 360 degrees) More...
 
Angle< AngleValueType > oglplus::RightAngles (AngleValueType value)
 Creates a new angle from a value in "right angles" (i.e. 90 deg.) More...
 
Angle< AngleValueType > oglplus::ArcSin (AngleValueType x)
 Creates a new angle using the arc sine function. More...
 
Angle< AngleValueType > oglplus::ArcCos (AngleValueType x)
 Creates a new angle using the arc cosine function. More...
 
Angle< AngleValueType > oglplus::ArcTan (AngleValueType x)
 Creates a new angle using the arc tangent function. More...
 
Angle< AngleValueType > oglplus::ArcTan (AngleValueType y, AngleValueType x)
 Creates a new angle using the arc tangent function with 2 parameters. More...
 
template<typename T >
oglplus::SineWave (T t)
 Returns a value on a sine wave at the specified point. More...
 
template<typename T >
oglplus::SineWave01 (T t)
 Returns a value on a sine wave transformed to range <0, 1> More...
 
template<typename T >
oglplus::CosineWave (T t)
 Returns a value on a cosine wave at the specified point. More...
 
template<typename T >
oglplus::CosineWave01 (T t)
 Returns a value on a cosine wave transformed to range <0, 1> More...
 

Detailed Description

This group contains classes and functions which do not directly deal with OpenGL, but are related to computer graphics, like angles, vectors, matrices, etc. The OGLplus example make use these classes, but the library does not force you to use them if you don't want to.

Function Documentation

Angle<AngleValueType> oglplus::ArcCos ( AngleValueType  x)

Creates a new angle using the arc cosine function.

Parameters
xthe value must be between -1.0 and 1.0
See Also
Radians
Degrees
FullCircles
RightAngles
ArcSin
ArcTan

References oglplus::Angle< T >::ArcCos().

Angle<AngleValueType> oglplus::ArcSin ( AngleValueType  x)

Creates a new angle using the arc sine function.

Parameters
xthe value must be between -1.0 and 1.0
See Also
Radians
Degrees
FullCircles
RightAngles
ArcCos
ArcTan
Examples:
oglplus/028_depth_map_sss.cpp.

References oglplus::Angle< T >::ArcSin().

Angle<AngleValueType> oglplus::ArcTan ( AngleValueType  x)

Creates a new angle using the arc tangent function.

See Also
Radians
Degrees
FullCircles
RightAngles
ArcSin
ArcTan

References oglplus::Angle< T >::Radians().

Angle<AngleValueType> oglplus::ArcTan ( AngleValueType  y,
AngleValueType  x 
)

Creates a new angle using the arc tangent function with 2 parameters.

See Also
Radians
Degrees
FullCircles
RightAngles
ArcSin
ArcTan

References oglplus::Angle< T >::Radians().

template<typename T >
T oglplus::CosineWave ( t)

Returns a value on a cosine wave at the specified point.

This function returns the value of cos(2.PI.t), i.e. integer values of t are the ends of the previous full cosine wave and the begining of the next "iteration". The following is true:

CosineWave(t) == cos(2.0*PI*t);
CosineWave(0.00) == 1.0;
CosineWave(0.25) == 0.0;
CosineWave(0.50) == -1.0;
CosineWave(0.75) == 0.0;
CosineWave(1.00) == 1.0;
Parameters
tthe point for which to calculate the value on the wave.
See Also
SineWave
CosineWave01
Examples:
oglplus/007_voronoi.cpp, oglplus/021_morphing.cpp, oglplus/023_sky.cpp, oglplus/023_waves.cpp, oglplus/026_ssao.cpp, oglplus/027_brain_scan_vis.cpp, oglplus/030_light_rays.cpp, oglplus/032_bar_grid.cpp, oglplus/032_transitions.cpp, oglplus/033_steam.cpp, oglplus/041_blob_mt.cpp, standalone/020_oglplus_oalplus.cpp, and standalone/025_bitmap_font_text.cpp.

Referenced by oglplus::CosineWave01().

template<typename T >
T oglplus::CosineWave01 ( t)

Returns a value on a cosine wave transformed to range <0, 1>

This function returns the value of (cos(2.PI.t)+1)/2, i.e. integer values of t are the ends of the previous full cosine wave and the begining of the next "iteration". The following is true:

CosineWave(t) == (cos(2.0*PI*t)+1)/2;
CosineWave(0.00) == 1.0;
CosineWave(0.25) == 0.5;
CosineWave(0.50) == 0.0;
CosineWave(0.75) == 0.5;
CosineWave(1.00) == 1.0;
Parameters
tthe point for which to calculate the value on the wave.
See Also
CosineWave
SineWave01
Examples:
oglplus/026_ssao.cpp, and oglplus/028_monkeycraft.cpp.

References oglplus::CosineWave().

Angle<AngleValueType> oglplus::Degrees ( AngleValueType  val_deg)

Creates a new angle from a value in degrees.

This function creates a new instance of Angle<AngleValueType> from a floating-point value in degrees. Examples:

// create a 30 degree angle
Degrees(30);
// create a right angle
Degrees(90);
Parameters
val_dega value in degrees
See Also
Radians
FullCircles
RightAngles
ArcSin
ArcCos
ArcTan

References oglplus::Angle< T >::Degrees().

Angle<AngleValueType> oglplus::FullCircles ( AngleValueType  value)

Creates a new angle from a value in "full circles" (i.e. 360 degrees)

This function creates a new angle from a value specifying the fraction of a full 360 degree (2 pi radians) angle. For example the following is true:

FullCircles(0.125) == Degrees(45);
FullCircles(0.25) == Degrees(90);
FullCircles(0.25) == Radians(PI / 2);
FullCircles(0.5) == Degrees(180);
FullCircles(0.5) == Radians(PI);
FullCircles(0.9) == Radians(2 * PI * 0.9);
Parameters
valuea value in 360-degree units
See Also
Radians
Degrees
ArcSin
ArcCos
ArcTan
Examples:
oglplus/006_cartoon_sun.cpp, oglplus/006_newton_zoom.cpp, oglplus/015_obj_mesh.cpp, oglplus/016_cartoon_torus.cpp, oglplus/016_metallic_torus.cpp, oglplus/016_noise_torus.cpp, oglplus/016_textured_cube.cpp, oglplus/016_textured_cube_glsl120.cpp, oglplus/017_clipped_torus.cpp, oglplus/017_phong_torus.cpp, oglplus/017_sky_box.cpp, oglplus/018_atomic_counters.cpp, oglplus/018_particle_system.cpp, oglplus/018_stained_glass_cube.cpp, oglplus/019_helium.cpp, oglplus/020_cube_mapping.cpp, oglplus/020_golf_ball.cpp, oglplus/020_icosphere.cpp, oglplus/020_octree.cpp, oglplus/020_texture_projection.cpp, oglplus/021_morphing.cpp, oglplus/021_translucent_arrow.cpp, oglplus/021_wooden_crate.cpp, oglplus/022_blender_mesh.cpp, oglplus/022_parallax_map.cpp, oglplus/022_vase.cpp, oglplus/022_volumetric_light.cpp, oglplus/022_xyz_planes.cpp, oglplus/023_sky.cpp, oglplus/023_waves.cpp, oglplus/024_extruded_torus.cpp, oglplus/024_particle_trails.cpp, oglplus/024_simple_picking.cpp, oglplus/025_multi_viewport.cpp, oglplus/025_recursive_texture.cpp, oglplus/025_rendered_texture.cpp, oglplus/025_rendered_texture_mt.cpp, oglplus/025_subroutines.cpp, oglplus/026_furry_torus.cpp, oglplus/026_nv_path_rendering.cpp, oglplus/026_shape_halo.cpp, oglplus/026_ssao.cpp, oglplus/026_stencil_shadow.cpp, oglplus/027_brain_scan_vis.cpp, oglplus/027_depth_of_field.cpp, oglplus/027_reflected_shape.cpp, oglplus/027_smoke_trails.cpp, oglplus/027_tessellation.cpp, oglplus/028_depth_map_sss.cpp, oglplus/028_glass_shape.cpp, oglplus/028_monkeycraft.cpp, oglplus/028_ripples.cpp, oglplus/028_volume.cpp, oglplus/029_flares.cpp, oglplus/029_gpu_sort_tfb.cpp, oglplus/029_muddy_stones.cpp, oglplus/029_shadow_mapping.cpp, oglplus/029_surface.cpp, oglplus/029_waves.cpp, oglplus/030_cube_mapping.cpp, oglplus/030_light_rays.cpp, oglplus/030_pin_display.cpp, oglplus/030_pool_tiles.cpp, oglplus/030_rain.cpp, oglplus/031_blob.cpp, oglplus/031_brick_torus.cpp, oglplus/031_fog.cpp, oglplus/031_sketch.cpp, oglplus/032_bar_grid.cpp, oglplus/032_object_tracking.cpp, oglplus/032_transitions.cpp, oglplus/033_metal_and_glass.cpp, oglplus/033_steam.cpp, oglplus/034_billiard_balls.cpp, oglplus/041_blob_mt.cpp, standalone/003_dsa_texture.cpp, standalone/004_any_text_rendering.cpp, standalone/004_bitmap_text_rendering.cpp, standalone/004_stbttf_text_rendering.cpp, standalone/025_bitmap_font_text.cpp, and standalone/026_blender_mesh_loader.cpp.

References oglplus::Angle< T >::Radians().

Referenced by oglplus::shapes::RevolveY< Type >::Bitangents(), oglplus::shapes::RevolveY< Type >::Normals(), oglplus::shapes::RevolveY< Type >::Positions(), and oglplus::shapes::RevolveY< Type >::Tangents().

Angle<AngleValueType> oglplus::Radians ( AngleValueType  val_rad)

Creates a new angle from a value in radians.

This function creates a new instance of Angle<T> from a floating-point value in radians.

Parameters
val_rada value in radians
See Also
Degrees
FullCircles
RightAngles
ArcSin
ArcCos
ArcTan

References oglplus::Angle< T >::Radians().

Angle<AngleValueType> oglplus::RightAngles ( AngleValueType  value)

Creates a new angle from a value in "right angles" (i.e. 90 deg.)

This function creates a new angle from a value specifying the fraction of a quarter 90 degree (pi/2 radians) angle. For example the following is true:

RightAngles(0.5) == Degrees(45);
RightAngles(1.0) == Degrees(90);
RightAngles(1.0) == Radians(PI / 2);
RightAngles(2.0) == Degrees(180);
RightAngles(2.0) == Radians(PI);
RightAngles(0.9) == Radians(0.9 * PI / 2);
Parameters
valuea value in 90-degree units
See Also
Radians
Degrees
ArcSin
ArcCos
ArcTan
Examples:
oglplus/021_morphing.cpp, oglplus/026_nv_path_rendering.cpp, oglplus/027_brain_scan_vis.cpp, oglplus/027_depth_of_field.cpp, and oglplus/041_blob_mt.cpp.

References oglplus::Angle< T >::Radians().

template<typename T >
T oglplus::SineWave ( t)

Returns a value on a sine wave at the specified point.

This function returns the value of sin(2.PI.t), i.e. integer values of t are the ends of the previous full sine wave and the begining of the next "iteration". The following is true:

SineWave(t) == sin(2.0*PI*t);
SineWave(0.00) == 0.0;
SineWave(0.25) == 1.0;
SineWave(0.50) == 0.0;
SineWave(0.75) == -1.0;
SineWave(1.00) == 0.0;
Parameters
tthe point for which to calculate the value on the wave.
See Also
SineWave01
CosineWave
Examples:
oglplus/007_voronoi.cpp, oglplus/012_checker_sphere.cpp, oglplus/013_striped_cubes.cpp, oglplus/014_multi_cube.cpp, oglplus/014_multi_cube_gs.cpp, oglplus/014_multi_cube_ub.cpp, oglplus/015_obj_mesh.cpp, oglplus/016_cartoon_torus.cpp, oglplus/016_metallic_torus.cpp, oglplus/016_noise_torus.cpp, oglplus/016_textured_cube.cpp, oglplus/016_textured_cube_glsl120.cpp, oglplus/017_clipped_torus.cpp, oglplus/017_phong_torus.cpp, oglplus/017_single_pass_edges.cpp, oglplus/017_sky_box.cpp, oglplus/018_atomic_counters.cpp, oglplus/018_stained_glass_cube.cpp, oglplus/019_bpatch_tess.cpp, oglplus/019_gs_tessell.cpp, oglplus/019_helium.cpp, oglplus/019_subsurf_scatter.cpp, oglplus/019_tessellation.cpp, oglplus/020_cube_mapping.cpp, oglplus/020_golf_ball.cpp, oglplus/020_icosphere.cpp, oglplus/020_octree.cpp, oglplus/020_shaded_objects.cpp, oglplus/020_texture_projection.cpp, oglplus/021_morphing.cpp, oglplus/021_overdraw.cpp, oglplus/021_translucent_arrow.cpp, oglplus/021_wooden_crate.cpp, oglplus/022_blender_mesh.cpp, oglplus/022_parallax_map.cpp, oglplus/022_vase.cpp, oglplus/022_volumetric_light.cpp, oglplus/022_xyz_planes.cpp, oglplus/023_reflected_cube.cpp, oglplus/023_sky.cpp, oglplus/023_waves.cpp, oglplus/024_extruded_torus.cpp, oglplus/024_particle_trails.cpp, oglplus/024_simple_picking.cpp, oglplus/025_multi_viewport.cpp, oglplus/025_recursive_texture.cpp, oglplus/025_reflected_torus.cpp, oglplus/025_rendered_texture.cpp, oglplus/025_rendered_texture_mt.cpp, oglplus/025_subroutines.cpp, oglplus/026_clouds.cpp, oglplus/026_furry_torus.cpp, oglplus/026_nv_path_rendering.cpp, oglplus/026_shape_halo.cpp, oglplus/026_ssao.cpp, oglplus/026_stencil_shadow.cpp, oglplus/027_brain_scan_vis.cpp, oglplus/027_depth_of_field.cpp, oglplus/027_reflected_shape.cpp, oglplus/027_smoke_trails.cpp, oglplus/027_tessellation.cpp, oglplus/028_depth_map_sss.cpp, oglplus/028_glass_shape.cpp, oglplus/028_monkeycraft.cpp, oglplus/028_ripples.cpp, oglplus/028_volume.cpp, oglplus/029_flares.cpp, oglplus/029_gpu_sort_tfb.cpp, oglplus/029_muddy_stones.cpp, oglplus/029_shadow_mapping.cpp, oglplus/029_surface.cpp, oglplus/029_waves.cpp, oglplus/030_cube_mapping.cpp, oglplus/030_light_rays.cpp, oglplus/030_pin_display.cpp, oglplus/030_pool_tiles.cpp, oglplus/030_rain.cpp, oglplus/031_blob.cpp, oglplus/031_brick_torus.cpp, oglplus/031_fog.cpp, oglplus/031_motion_blur.cpp, oglplus/031_neon.cpp, oglplus/031_sketch.cpp, oglplus/032_bar_grid.cpp, oglplus/032_object_tracking.cpp, oglplus/032_transitions.cpp, oglplus/033_metal_and_glass.cpp, oglplus/033_steam.cpp, oglplus/034_billiard_balls.cpp, oglplus/040_jelly_cube.cpp, oglplus/041_blob_mt.cpp, standalone/003_dsa_texture.cpp, standalone/004_any_text_rendering.cpp, standalone/004_bitmap_text_hello.cpp, standalone/004_bitmap_text_rendering.cpp, standalone/004_pango_cairo_hello.cpp, standalone/004_stbttf_text_rendering.cpp, standalone/020_oglplus_oalplus.cpp, standalone/025_bitmap_font_text.cpp, and standalone/026_blender_mesh_loader.cpp.

Referenced by oglplus::SineWave01().

template<typename T >
T oglplus::SineWave01 ( t)

Returns a value on a sine wave transformed to range <0, 1>

This function returns the value of (sin(2.PI.t)+1)/2, i.e. integer values of t are the ends of the previous full sine wave and the begining of the next "iteration". The following is true:

SineWave01(t) == (sin(2.0*PI*t)+1)/2;
SineWave01(0.00) == 0.5;
SineWave01(0.25) == 1.0;
SineWave01(0.50) == 0.5;
SineWave01(0.75) == 0.0;
SineWave01(1.00) == 0.5;
Parameters
tthe point for which to calculate the value on the wave.
See Also
SineWave
CosineWave01

References oglplus::SineWave().


Copyright © 2010-2014 Matúš Chochlík, University of Žilina, Žilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Mon Sep 22 2014 by Doxygen (version 1.8.6).