![]() |
CMSC23700 Common Code Library
Support code for CS23700 programming projects
|
Namespaces | |
__detail | |
Classes | |
struct | color3f |
struct | color3ub |
struct | color4f |
struct | color4ub |
class | FragmentShader |
class | GeometryShader |
class | image1d |
class | image2d |
class | ShaderProgram |
struct | Sphere |
A spherical mesh. More... | |
class | texture1D |
wrapper class for OpenGL 1D textures More... | |
class | texture2D |
wrapper class for OpenGL 2D textures More... | |
class | VertexShader |
class | Window |
abstract base class for simple GLFW windows used to view buffers, etc. More... | |
Typedefs | |
typedef __detail::AABB< float > | AABBf |
Single-precision axis-aligned bounding boxes. More... | |
typedef __detail::AABB< double > | AABBd |
Double-precision axis-aligned bounding boxes. More... | |
typedef __detail::mat2x2< float > | mat2x2f |
Single-precision 2x2 matrices. More... | |
typedef __detail::mat2x2< double > | mat2x2d |
Double-precision 2x2 matrices. More... | |
typedef mat2x2f | mat2f |
Single-precision 2x2 matrices (the same as mat2x2f) More... | |
typedef mat2x2d | mat2d |
Double-precision 2x2 matrices (the same as mat2x2d) More... | |
typedef __detail::mat2x3< float > | mat2x3f |
Single-precision 2x3 matrices. More... | |
typedef __detail::mat2x3< double > | mat2x3d |
Double-precision 2x3 matrices. More... | |
typedef __detail::mat3x2< float > | mat3x2f |
Single-precision 3x2 matrices. More... | |
typedef __detail::mat3x2< double > | mat3x2d |
Double-precision 3x2 matrices. More... | |
typedef __detail::mat3x3< float > | mat3x3f |
Single-precision 3x3 matrices. More... | |
typedef __detail::mat3x3< double > | mat3x3d |
Double-precision 3x3 matrices. More... | |
typedef mat3x3f | mat3f |
Single-precision 3x3 matrices (the same as mat3x3f) More... | |
typedef mat3x3d | mat3d |
Double-precision 3x3 matrices (the same as mat3x3f) More... | |
typedef __detail::mat4x4< float > | mat4x4f |
Single-precision 4x4 matrices. More... | |
typedef __detail::mat4x4< double > | mat4x4d |
Double-precision 4x4 matrices. More... | |
typedef mat4x4f | mat4f |
Single-precision 4x4 matrices (the same as mat4x4f) More... | |
typedef mat4x4d | mat4d |
Double-precision 4x4 matrices (the same as mat4x4d) More... | |
typedef __detail::quat< float > | quatf |
Single-precision quaternions. More... | |
typedef __detail::quat< double > | quatd |
Double-precision quaternions. More... | |
typedef __detail::vec2< float > | vec2f |
Two-element, single-precision floating-point vectors. More... | |
typedef __detail::vec2< double > | vec2d |
Two-element, double-precision floating-point vectors. More... | |
typedef __detail::vec3< float > | vec3f |
Three-element, single-precision floating-point vectors. More... | |
typedef __detail::vec3< double > | vec3d |
Three-element, double-precision floating-point vectors. More... | |
typedef __detail::vec4< float > | vec4f |
Four-element, single-precision floating-point vectors. More... | |
typedef __detail::vec4< double > | vec4d |
Four-element, double-precision floating-point vectors. More... | |
Functions | |
std::ostream & | operator<< (std::ostream &s, color3ub const &c) |
output the color to a stream More... | |
std::ostream & | operator<< (std::ostream &s, color4ub const &c) |
output the color to a stream More... | |
std::ostream & | operator<< (std::ostream &s, color3f const &c) |
output the color to a stream More... | |
std::ostream & | operator<< (std::ostream &s, color4f const &c) |
output the color to a stream More... | |
color3f | operator+ (color3f const &c1, color3f const &c2) |
color3f | operator- (color3f const &c1, color3f const &c2) |
color3f | operator* (color3f const &c1, color3f const &c2) |
color3f | mix (color3f const &c1, float t, color3f const &c2) |
void | setUniform (int loc, int const &v) |
void | setUniform (int loc, int const &v1, int const &v2) |
void | setUniform (int loc, int const &v1, int const &v2, int const &v3) |
void | setUniform (int loc, int const &v1, int const &v2, int const &v3, int const &v4) |
void | setUniform (int loc, unsigned int const &v) |
void | setUniform (int loc, unsigned int const &v1, unsigned int const &v2) |
void | setUniform (int loc, unsigned int const &v1, unsigned int const &v2, unsigned int const &v3) |
void | setUniform (int loc, unsigned int const &v1, unsigned int const &v2, unsigned int const &v3, unsigned int const &v4) |
void | setUniform (int loc, float const &v) |
void | setUniform (int loc, vec2f const &v) |
void | setUniform (int loc, vec3f const &v) |
void | setUniform (int loc, vec4f const &v) |
void | setUniform (int loc, mat2x2f const &v) |
void | setUniform (int loc, mat3x3f const &v) |
void | setUniform (int loc, mat4x4f const &v) |
void | setUniform (int loc, color3ub const &v) |
void | setUniform (int loc, color3f const &v) |
void | setUniform (int loc, color4ub const &v) |
void | setUniform (int loc, color4f const &v) |
void | setAttribute (int loc, int const &v) |
void | setAttribute (int loc, unsigned int const &v) |
void | setAttribute (int loc, float const &v) |
void | setAttribute (int loc, vec2f const &v) |
void | setAttribute (int loc, vec3f const &v) |
void | setAttribute (int loc, vec4f const &v) |
template<typename T > | |
__detail::mat4x4< T > | scale (T s) |
template<typename T > | |
__detail::mat4x4< T > | scale (__detail::mat4x4< T > const &m, T s) |
template<typename T > | |
__detail::mat4x4< T > | scale (__detail::vec3< T > const &s) |
template<typename T > | |
__detail::mat4x4< T > | scale (__detail::mat4x4< T > const &m, __detail::vec3< T > const &s) |
template<typename T > | |
__detail::mat4x4< T > | rotateX (T theta) |
template<typename T > | |
__detail::mat4x4< T > | rotateX (__detail::mat4x4< T > const &m, T theta) |
template<typename T > | |
__detail::mat4x4< T > | rotateY (T theta) |
template<typename T > | |
__detail::mat4x4< T > | rotateY (__detail::mat4x4< T > const &m, T theta) |
template<typename T > | |
__detail::mat4x4< T > | rotateZ (T theta) |
template<typename T > | |
__detail::mat4x4< T > | rotateZ (__detail::mat4x4< T > const &m, T theta) |
template<typename T > | |
__detail::mat4x4< T > | rotate (T theta, __detail::vec3< T > const &axis) |
template<typename T > | |
__detail::mat4x4< T > | rotate (__detail::mat4x4< T > const &m, T theta, __detail::vec3< T > const &axis) |
template<typename T > | |
__detail::mat4x4< T > | translate (__detail::vec3< T > const &offset) |
template<typename T > | |
__detail::mat4x4< T > | translate (__detail::mat4x4< T > const &m, __detail::vec3< T > const &offset) |
template<typename T > | |
__detail::mat4x4< T > | lookAt (__detail::vec3< T > const &eye, __detail::vec3< T > const ¢er, __detail::vec3< T > const &up) |
build a a viewing matrix derived from an eye point, a reference point indicating the center of the scene, and an up vector. More... | |
template<typename T > | |
__detail::mat4x4< T > | ortho (T const &left, T const &right, T const &bottom, T const &top, T const &nearVal, T const &farVal) |
template<typename T > | |
__detail::mat4x4< T > | ortho2D (T const &left, T const &right, T const &bottom, T const &top) |
set up a transformation matrix that produces two-dimensional orthographic viewing region More... | |
template<typename T > | |
__detail::mat4x4< T > | perspective (T const &fov, T const &aspect, T const &zNear, T const &zFar) |
specifies a perspective projection matrix More... | |
template<typename T > | |
__detail::mat4x4< T > | frustum (T const &left, T const &right, T const &bottom, T const &top, T const &nearVal, T const &farVal) |
specifies a viewing frustum into the world coordinate system More... | |
float | clamp (float f) |
clamp a value to the range [0..1]. More... | |
double | clamp (double f) |
clamp a value to the range [0..1]. More... | |
float | radians (float theta) |
convert an angle from degrees to radians More... | |
double | radians (double theta) |
convert an angle from degrees to radians More... | |
float | degrees (float theta) |
convert an angle from radians to degrees More... | |
double | degrees (double theta) |
convert an angle from radians to degrees More... | |
float | mix (float a, float t, float b) |
scalar linear interpolation More... | |
double | mix (double a, double t, double b) |
scalar linear interpolation More... | |
int | min (int a, int b) |
minimum at various types More... | |
float | min (float a, float b) |
double | min (double a, double b) |
int | max (int a, int b) |
maximum at various types More... | |
float | max (float a, float b) |
double | max (double a, double b) |
int | abs (int a) |
absolute value at various types More... | |
float | abs (float a) |
double | abs (double a) |
vec2f | toFloat (vec2d const &v) |
vec3f | toFloat (vec3d const &v) |
vec4f | toFloat (vec4d const &v) |
vec2d | toDouble (vec2f const &v) |
vec3d | toDouble (vec3f const &v) |
vec4d | toDouble (vec4f const &v) |
void | DumpGLState (std::ostream &os) |
typedef __detail::AABB<double> cs237::AABBd |
Double-precision axis-aligned bounding boxes.
typedef __detail::AABB<float> cs237::AABBf |
Single-precision axis-aligned bounding boxes.
typedef mat2x2d cs237::mat2d |
Double-precision 2x2 matrices (the same as mat2x2d)
typedef mat2x2f cs237::mat2f |
Single-precision 2x2 matrices (the same as mat2x2f)
typedef __detail::mat2x2<double> cs237::mat2x2d |
Double-precision 2x2 matrices.
typedef __detail::mat2x2<float> cs237::mat2x2f |
Single-precision 2x2 matrices.
typedef __detail::mat2x3<double> cs237::mat2x3d |
Double-precision 2x3 matrices.
typedef __detail::mat2x3<float> cs237::mat2x3f |
Single-precision 2x3 matrices.
typedef mat3x3d cs237::mat3d |
Double-precision 3x3 matrices (the same as mat3x3f)
typedef mat3x3f cs237::mat3f |
Single-precision 3x3 matrices (the same as mat3x3f)
typedef __detail::mat3x2<double> cs237::mat3x2d |
Double-precision 3x2 matrices.
typedef __detail::mat3x2<float> cs237::mat3x2f |
Single-precision 3x2 matrices.
typedef __detail::mat3x3<double> cs237::mat3x3d |
Double-precision 3x3 matrices.
typedef __detail::mat3x3<float> cs237::mat3x3f |
Single-precision 3x3 matrices.
typedef mat4x4d cs237::mat4d |
Double-precision 4x4 matrices (the same as mat4x4d)
typedef mat4x4f cs237::mat4f |
Single-precision 4x4 matrices (the same as mat4x4f)
typedef __detail::mat4x4<double> cs237::mat4x4d |
Double-precision 4x4 matrices.
typedef __detail::mat4x4<float> cs237::mat4x4f |
Single-precision 4x4 matrices.
typedef __detail::quat<double> cs237::quatd |
Double-precision quaternions.
typedef __detail::quat<float> cs237::quatf |
Single-precision quaternions.
typedef __detail::vec2<double> cs237::vec2d |
Two-element, double-precision floating-point vectors.
typedef __detail::vec2<float> cs237::vec2f |
Two-element, single-precision floating-point vectors.
typedef __detail::vec3<double> cs237::vec3d |
Three-element, double-precision floating-point vectors.
typedef __detail::vec3<float> cs237::vec3f |
Three-element, single-precision floating-point vectors.
typedef __detail::vec4<double> cs237::vec4d |
Four-element, double-precision floating-point vectors.
typedef __detail::vec4<float> cs237::vec4f |
Four-element, single-precision floating-point vectors.
|
inline |
absolute value at various types
|
inline |
|
inline |
|
inline |
clamp a value to the range [0..1].
f | the value to clamp |
|
inline |
clamp a value to the range [0..1].
f | the value to clamp |
|
inline |
convert an angle from radians to degrees
theta | the angle to convert |
|
inline |
convert an angle from radians to degrees
theta | the angle to convert |
void cs237::DumpGLState | ( | std::ostream & | os | ) |
Dump the current OpenGL state to the given output stream
os | the output stream to dump the state to |
This function dumps partial information about the current state of OpenGL to an output stream. The information includes things like the current VAO. There is lots of information that is not dumped.
__detail::mat4x4<T> cs237::frustum | ( | T const & | left, |
T const & | right, | ||
T const & | bottom, | ||
T const & | top, | ||
T const & | nearVal, | ||
T const & | farVal | ||
) |
specifies a viewing frustum into the world coordinate system
__detail::mat4x4<T> cs237::lookAt | ( | __detail::vec3< T > const & | eye, |
__detail::vec3< T > const & | center, | ||
__detail::vec3< T > const & | up | ||
) |
build a a viewing matrix derived from an eye point, a reference point indicating the center of the scene, and an up vector.
[in] | eye | specifies the position of the eye point |
[in] | center | specifies the point that is being looked at |
[in] | up | specifies the up direction of the viewer |
|
inline |
maximum at various types
|
inline |
|
inline |
|
inline |
minimum at various types
|
inline |
|
inline |
|
inline |
scalar linear interpolation
a | value for t = 0 |
t | interpolation factor |
b | value for t = 1 |
|
inline |
scalar linear interpolation
a | value for t = 0 |
t | interpolation factor |
b | value for t = 10 |
std::ostream& cs237::operator<< | ( | std::ostream & | s, |
color3ub const & | c | ||
) |
output the color to a stream
s | the stream to print to |
c | the color to print |
std::ostream& cs237::operator<< | ( | std::ostream & | s, |
color4ub const & | c | ||
) |
output the color to a stream
s | the stream to print to |
c | the color to print |
std::ostream& cs237::operator<< | ( | std::ostream & | s, |
color3f const & | c | ||
) |
output the color to a stream
s | the stream to print to |
c | the color to print |
std::ostream& cs237::operator<< | ( | std::ostream & | s, |
color4f const & | c | ||
) |
output the color to a stream
s | the stream to print to |
c | the color to print |
__detail::mat4x4<T> cs237::ortho | ( | T const & | left, |
T const & | right, | ||
T const & | bottom, | ||
T const & | top, | ||
T const & | nearVal, | ||
T const & | farVal | ||
) |
set up a transformation matrix that produces a parallel projection
left | specify the coordinates for the left vertical clipping plane |
right | specify the coordinates for the right vertical clipping plane |
bottom | specify the coordinates for the bottom horizontal clipping plane |
top | specify the coordinates for the top horizontal clipping plane |
nearVal | specify the distance to the nearer depth clipping plane |
farVal | specify the distance to the farther depth clipping plane |
The nearVal
and farVal
values are negative if the plane is to be behind the viewer.
__detail::mat4x4<T> cs237::ortho2D | ( | T const & | left, |
T const & | right, | ||
T const & | bottom, | ||
T const & | top | ||
) |
set up a transformation matrix that produces two-dimensional orthographic viewing region
__detail::mat4x4<T> cs237::perspective | ( | T const & | fov, |
T const & | aspect, | ||
T const & | zNear, | ||
T const & | zFar | ||
) |
specifies a perspective projection matrix
[in] | fov | the vertical field of view; i.e., the angle in degrees between the XZ plane and the top of the vew frustum. |
[in] | aspect | the aspect ratio (width/height) |
[in] | zNear | the distance from the viewer to the near clipping plane |
[in] | zFar | the distance from the viewer to the far clipping plane |
|
inline |
convert an angle from degrees to radians
theta | the angle to convert |
|
inline |
convert an angle from degrees to radians
theta | the angle to convert |
__detail::mat4x4<T> cs237::rotate | ( | T | theta, |
__detail::vec3< T > const & | axis | ||
) |
create a rotation about an arbitrary axis matrix
theta | the angle of rotation in degrees |
axis | the axis of rotation |
__detail::mat4x4<T> cs237::rotate | ( | __detail::mat4x4< T > const & | m, |
T | theta, | ||
__detail::vec3< T > const & | axis | ||
) |
apply a rotation about an arbitrary axis to a matrix
m | the matrix to transform |
theta | the angle of rotation in degrees |
axis | the axis of rotation |
__detail::mat4x4<T> cs237::rotateX | ( | T | theta | ) |
create a rotation about the X axis matrix
theta | the angle of rotation in degrees |
__detail::mat4x4<T> cs237::rotateX | ( | __detail::mat4x4< T > const & | m, |
T | theta | ||
) |
apply rotation about the X axis matrix to a matrix
m | the matrix to transform |
theta | the angle of rotation in degrees |
The expression cs237::rotateX(m, theta) is equivalent to m * cs237::rotateX(theta)
__detail::mat4x4<T> cs237::rotateY | ( | T | theta | ) |
create a rotation about the Y axis matrix
theta | the angle of rotation in degrees |
__detail::mat4x4<T> cs237::rotateY | ( | __detail::mat4x4< T > const & | m, |
T | theta | ||
) |
apply rotation about the Y axis matrix to a matrix
m | the matrix to transform |
theta | the angle of rotation in degrees |
The expression cs237::rotateY(m, theta) is equivalent to m * cs237::rotateY(theta)
__detail::mat4x4<T> cs237::rotateZ | ( | T | theta | ) |
create a rotation about the Z axis matrix
theta | the angle of rotation in degrees |
__detail::mat4x4<T> cs237::rotateZ | ( | __detail::mat4x4< T > const & | m, |
T | theta | ||
) |
apply rotation about the Z axis matrix to a matrix
m | the matrix to transform |
theta | the angle of rotation in degrees |
The expression cs237::rotateZ(m, theta) is equivalent to m * cs237::rotateZ(theta)
__detail::mat4x4<T> cs237::scale | ( | T | s | ) |
create an isotropic (uniform) scaling matrix
s | the scaling factor |
__detail::mat4x4<T> cs237::scale | ( | __detail::mat4x4< T > const & | m, |
T | s | ||
) |
apply isotropic (uniform) scaling to a matrix
m | the matrix to transform |
s | the scaling factor |
The expression cs237::scale(m, s) is equivalent to m * cs237::scale(s)
__detail::mat4x4<T> cs237::scale | ( | __detail::vec3< T > const & | s | ) |
create an anisotropic (non-uniform) scaling matrix
s | the vector of scaling factors |
__detail::mat4x4<T> cs237::scale | ( | __detail::mat4x4< T > const & | m, |
__detail::vec3< T > const & | s | ||
) |
apply anisotropic (non-uniform) scaling to a matrix
m | the matrix to transform |
s | the vector of scaling factors |
The expression cs237::scale(m, s) is equivalent to m * cs237::scale(s)
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
set the specified int uniform variable for current shader
loc | the location of the uniform variable |
v | the integer value bound to the variable |
|
inline |
set the specified int2 uniform variable for current shader
loc | the location of the uniform variable |
v1 | the first component of the vector bound to the variable |
v2 | the second component of the vector bound to the variable |
|
inline |
set the specified int3 uniform variable for current shader
loc | the location of the uniform variable |
v1 | the first component of the vector bound to the variable |
v2 | the second component of the vector bound to the variable |
v3 | the third component of the vector bound to the variable |
|
inline |
set the specified int4 uniform variable for current shader
loc | the location of the uniform variable |
v1 | the first component of the vector bound to the variable |
v2 | the second component of the vector bound to the variable |
v3 | the third component of the vector bound to the variable |
v4 | the fourth component of the vector bound to the variable |
|
inline |
set the specified unsigned int uniform variable for current shader
loc | the location of the uniform variable |
v | the unsigned integer value bound to the variable |
|
inline |
set the specified uint2 uniform variable for current shader
loc | the location of the uniform variable |
v1 | the first component of the vector bound to the variable |
v2 | the second component of the vector bound to the variable |
|
inline |
set the specified uint3 uniform variable for current shader
loc | the location of the uniform variable |
v1 | the first component of the vector bound to the variable |
v2 | the second component of the vector bound to the variable |
v3 | the third component of the vector bound to the variable |
|
inline |
set the specified uint4 uniform variable for current shader
loc | the location of the uniform variable |
v1 | the first component of the vector bound to the variable |
v2 | the second component of the vector bound to the variable |
v3 | the third component of the vector bound to the variable |
v4 | the fourth component of the vector bound to the variable |
|
inline |
set the specified float uniform variable for current shader
loc | the location of the uniform variable |
v | the float value bound to the variable |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
convert a single-precision vec2f value to double precision
v | the vector to convert |
convert a single-precision vec3f value to double precision
v | the vector to convert |
convert a single-precision vec4f value to double precision
v | the vector to convert |
convert a double-precision vec2d value to single precision
v | the vector to convert |
convert a double-precision vec3d value to single precision
v | the vector to convert |
convert a double-precision vec4d value to single precision
v | the vector to convert |
__detail::mat4x4<T> cs237::translate | ( | __detail::vec3< T > const & | offset | ) |
create a translation by the given offset vector
offset | the vector that defines the translation |
__detail::mat4x4<T> cs237::translate | ( | __detail::mat4x4< T > const & | m, |
__detail::vec3< T > const & | offset | ||
) |
apply a translation by an offset vector to a matrix
m | the matrix to transform |
offset | the vector that defines the translation |
The expression cs237::translate(m, offset) is equivalent to m * cs237::translate(offset)