glVertex
5.5.2
|
#include <math.h>
#include <float.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string>
#include <iostream>
#include <iomanip>
#include <vector>
#include <limits>
Go to the source code of this file.
Classes | |
class | vec2 |
2D double vector More... | |
class | vec2f |
2D float vector More... | |
class | vec3 |
3D double vector More... | |
class | vec3f |
3D float vector More... | |
class | vec4 |
4D double vector More... | |
class | vec4f |
4D float vector More... | |
class | mat2 |
2x2 double matrix More... | |
class | mat2f |
2x2 float matrix More... | |
class | mat3 |
3x3 double matrix More... | |
class | mat3f |
3x3 float matrix More... | |
class | mat4 |
4x4 double matrix More... | |
class | mat4f |
4x4 float matrix More... | |
class | quat |
quaternion More... | |
class | glslnoise::perlinnoise |
perlin noise More... | |
Functions | |
vec2 | operator+ (const vec2 &a, const vec2 &b) |
addition of two vectors | |
vec2 | operator- (const vec2 &a, const vec2 &b) |
subtraction of two vectors | |
vec2 | operator- (const vec2 &v) |
negation of a vector | |
vec2 | operator* (const double a, const vec2 &b) |
left-hand side scalar multiplication | |
vec2 | operator* (const vec2 &a, const double b) |
right-hand side scalar multiplication | |
vec2 | operator/ (const vec2 &a, const double b) |
right-hand side scalar division | |
vec2 | operator* (const vec2 &a, const vec2 &b) |
component-wise multiplication | |
bool | operator== (const vec2 &a, const vec2 &b) |
comparison | |
bool | operator!= (const vec2 &a, const vec2 &b) |
negated comparison | |
double | length (const vec2 &v) |
get vector length | |
double | norm (const vec2 &v) |
get squared vector length | |
vec2 | normalize (const vec2 &v) |
normalization to unit length | |
double | dot (const vec2 &a, const vec2 &b) |
inner product | |
vec2 | lerp (double w, const vec2 &a, const vec2 &b) |
linear interpolation | |
vec2 | mix (const vec2 &a, const vec2 &b, double w) |
linear interpolation (GLSL-style) | |
std::ostream & | operator<< (std::ostream &out, const vec2 &v) |
output operator | |
vec2f | operator+ (const vec2f &a, const vec2f &b) |
addition of two vectors | |
vec2f | operator- (const vec2f &a, const vec2f &b) |
subtraction of two vectors | |
vec2f | operator- (const vec2f &v) |
negation of a vector | |
vec2f | operator* (const float a, const vec2f &b) |
left-hand side scalar multiplication | |
vec2f | operator* (const vec2f &a, const float b) |
right-hand side scalar multiplication | |
vec2f | operator/ (const vec2f &a, const float b) |
right-hand side scalar division | |
vec2f | operator* (const vec2f &a, const vec2f &b) |
component-wise multiplication | |
bool | operator== (const vec2f &a, const vec2f &b) |
comparison | |
bool | operator!= (const vec2f &a, const vec2f &b) |
negated comparison | |
std::ostream & | operator<< (std::ostream &out, const vec2f &v) |
output operator | |
vec3 | operator+ (const vec3 &a, const vec3 &b) |
addition of two vectors | |
vec3 | operator- (const vec3 &a, const vec3 &b) |
subtraction of two vectors | |
vec3 | operator- (const vec3 &v) |
negation of a vector | |
vec3 | operator* (const double a, const vec3 &b) |
left-hand side scalar multiplication | |
vec3 | operator* (const vec3 &a, const double b) |
right-hand side scalar multiplication | |
vec3 | operator/ (const vec3 &a, const double b) |
right-hand side scalar division | |
vec3 | operator* (const vec3 &a, const vec3 &b) |
component-wise multiplication | |
bool | operator== (const vec3 &a, const vec3 &b) |
comparison | |
bool | operator!= (const vec3 &a, const vec3 &b) |
negated comparison | |
double | length (const vec3 &v) |
get vector length | |
double | norm (const vec3 &v) |
get squared vector length | |
vec3 | normalize (const vec3 &v) |
normalization to unit length | |
double | dot (const vec3 &a, const vec3 &b) |
inner product | |
vec3 | cross (const vec3 &a, const vec3 &b) |
cross product | |
vec3 | lerp (double w, const vec3 &a, const vec3 &b) |
linear interpolation | |
vec3 | mix (const vec3 &a, const vec3 &b, double w) |
linear interpolation (GLSL-style) | |
vec3 | reflect (const vec3 &v, const vec3 &n) |
reflect incident vector at normalized surface normal | |
std::ostream & | operator<< (std::ostream &out, const vec3 &v) |
output operator | |
vec3f | operator+ (const vec3f &a, const vec3f &b) |
addition of two vectors | |
vec3f | operator- (const vec3f &a, const vec3f &b) |
subtraction of two vectors | |
vec3f | operator- (const vec3f &v) |
negation of a vector | |
vec3f | operator* (const float a, const vec3f &b) |
left-hand side scalar multiplication | |
vec3f | operator* (const vec3f &a, const float b) |
right-hand side scalar multiplication | |
vec3f | operator/ (const vec3f &a, const float b) |
right-hand side scalar division | |
vec3f | operator* (const vec3f &a, const vec3f &b) |
component-wise multiplication | |
bool | operator== (const vec3f &a, const vec3f &b) |
comparison | |
bool | operator!= (const vec3f &a, const vec3f &b) |
negated comparison | |
std::ostream & | operator<< (std::ostream &out, const vec3f &v) |
output operator | |
vec4 | operator+ (const vec4 &a, const vec4 &b) |
addition of two vectors | |
vec4 | operator- (const vec4 &a, const vec4 &b) |
subtraction of two vectors | |
vec4 | operator- (const vec4 &v) |
negation of a vector | |
vec4 | operator* (const double a, const vec4 &b) |
left-hand side scalar multiplication | |
vec4 | operator* (const vec4 &a, const double b) |
right-hand side scalar multiplication | |
vec4 | operator/ (const vec4 &a, const double b) |
right-hand side scalar division | |
vec4 | operator* (const vec4 &a, const vec4 &b) |
component-wise multiplication | |
bool | operator== (const vec4 &a, const vec4 &b) |
comparison | |
bool | operator!= (const vec4 &a, const vec4 &b) |
negated comparison | |
double | length (const vec4 &v) |
get vector length | |
double | norm (const vec4 &v) |
get squared vector length | |
vec4 | normalize (const vec4 &v) |
normalization to unit length | |
double | dot (const vec4 &a, const vec4 &b) |
inner product | |
vec4 | cross (const vec4 &a, const vec4 &b) |
cross product | |
vec4 | lerp (double w, const vec4 &a, const vec4 &b) |
linear interpolation | |
vec4 | mix (const vec4 &a, const vec4 &b, double w) |
linear interpolation (GLSL-style) | |
vec4 | reflect (const vec4 &v, const vec4 &n) |
reflect incident vector at normalized surface normal | |
std::ostream & | operator<< (std::ostream &out, const vec4 &v) |
output operator | |
vec4f | operator+ (const vec4f &a, const vec4f &b) |
addition of two vectors | |
vec4f | operator- (const vec4f &a, const vec4f &b) |
subtraction of two vectors | |
vec4f | operator- (const vec4f &v) |
negation of a vector | |
vec4f | operator* (const float a, const vec4f &b) |
left-hand side scalar multiplication | |
vec4f | operator* (const vec4f &a, const float b) |
right-hand side scalar multiplication | |
vec4f | operator/ (const vec4f &a, const float b) |
right-hand side scalar division | |
vec4f | operator* (const vec4f &a, const vec4f &b) |
component-wise multiplication | |
bool | operator== (const vec4f &a, const vec4f &b) |
comparison | |
bool | operator!= (const vec4f &a, const vec4f &b) |
negated comparison | |
std::ostream & | operator<< (std::ostream &out, const vec4f &v) |
output operator | |
mat2 | operator+ (const mat2 &m1, const mat2 &m2) |
addition of two matrices | |
mat2 | operator* (const mat2 &m1, const mat2 &m2) |
multiplication of two matrices | |
bool | operator== (const mat2 &a, const mat2 &b) |
comparison | |
bool | operator!= (const mat2 &a, const mat2 &b) |
negated comparison | |
vec2 | operator* (const mat2 &m, const vec2 &v) |
right-hand side matrix/vector multiplication | |
std::ostream & | operator<< (std::ostream &out, const mat2 &m) |
output operator | |
std::ostream & | operator<< (std::ostream &out, const mat2f &m) |
output operator | |
mat3 | operator+ (const mat3 &m1, const mat3 &m2) |
addition of two matrices | |
mat3 | operator* (const mat3 &m1, const mat3 &m2) |
multiplication of two matrices | |
bool | operator== (const mat3 &a, const mat3 &b) |
comparison | |
bool | operator!= (const mat3 &a, const mat3 &b) |
negated comparison | |
vec3 | operator* (const mat3 &m, const vec3 &v) |
right-hand side matrix/vector multiplication | |
std::ostream & | operator<< (std::ostream &out, const mat3 &m) |
output operator | |
std::ostream & | operator<< (std::ostream &out, const mat3f &m) |
output operator | |
mat4 | operator+ (const mat4 &m1, const mat4 &m2) |
addition of two matrices | |
mat4 | operator* (const mat4 &m1, const mat4 &m2) |
multiplication of two matrices | |
bool | operator== (const mat4 &a, const mat4 &b) |
comparison | |
bool | operator!= (const mat4 &a, const mat4 &b) |
negated comparison | |
mat4 | scale (const mat4 &m, const vec4 &c) |
inline scale | |
mat4 | scale (const mat4 &m, double s, double t, double r, double w=1) |
inline scale | |
mat4 | scale (const mat4 &m, double s, double w=1) |
inline scale | |
mat4 | translate (const mat4 &m, const vec4 &v) |
inline translate | |
mat4 | translate (const mat4 &m, double x, double y, double z, double w=1) |
inline translate | |
mat4 | rotate (const mat4 &m, double angle, const vec3 &v) |
inline rotate | |
mat4 | rotate (const mat4 &m, double angle, double vx, double vy, double vz) |
inline rotate | |
mat4 | rotate (const mat4 &m, const vec3 &from, const vec3 &to) |
inline rotate | |
double | determinant (const mat4 &m) |
inline determinant | |
mat4 | transpose (const mat4 &m) |
inline transpose | |
mat4 | inverse (const mat4 &m) |
inline inverse | |
mat4 | inverse_transpose (const mat4 &m) |
inline inverse transpose | |
vec4 | operator* (const mat4 &m, const vec4 &v) |
right-hand side matrix/vector multiplication | |
std::ostream & | operator<< (std::ostream &out, const mat4 &m) |
output operator | |
std::ostream & | operator<< (std::ostream &out, const mat4f &m) |
output operator | |
quat | operator+ (const quat &a, const quat &b) |
addition of two quaternions | |
quat | operator- (const quat &a, const quat &b) |
subtraction of two quaternions | |
quat | operator* (const double a, const quat &b) |
left-hand side scalar multiplication | |
quat | operator* (const quat &a, const double b) |
right-hand side scalar multiplication | |
quat | operator- (const quat &r) |
conjugation of a quaternion | |
quat | operator* (const quat &a, const quat &b) |
multiplication of two quaternions | |
vec3 | operator* (const quat &r, const vec3 &v) |
right-hand side vector multiplication with normalized quaternion | |
std::ostream & | operator<< (std::ostream &out, const quat &r) |
output operator | |
void | glslmath::print (const char *s="", std::string prefix="", std::ostream &out=std::cout) |
pretty print | |
void | glslmath::print (std::string s, std::string prefix="", std::ostream &out=std::cout) |
pretty print | |
void | glslmath::print (char c, std::string name="", std::string prefix="", std::ostream &out=std::cout) |
pretty print | |
void | glslmath::print (int v, std::string name="", std::string prefix="", std::ostream &out=std::cout) |
pretty print | |
void | glslmath::print (unsigned int v, std::string name="", std::string prefix="", std::ostream &out=std::cout) |
pretty print | |
void | glslmath::print (double v, std::string name="", std::string prefix="", std::ostream &out=std::cout) |
pretty print | |
void | glslmath::print (vec2 v, std::string name="", std::string prefix="", std::ostream &out=std::cout) |
pretty print | |
void | glslmath::print (vec2f v, std::string name="", std::string prefix="", std::ostream &out=std::cout) |
pretty print | |
void | glslmath::print (vec3 v, std::string name="", std::string prefix="", std::ostream &out=std::cout) |
pretty print | |
void | glslmath::print (vec3f v, std::string name="", std::string prefix="", std::ostream &out=std::cout) |
pretty print | |
void | glslmath::print (vec4 v, std::string name="", std::string prefix="", std::ostream &out=std::cout) |
pretty print | |
void | glslmath::print (vec4f v, std::string name="", std::string prefix="", std::ostream &out=std::cout) |
pretty print | |
void | glslmath::print (mat2 m, std::string name="", std::string prefix="", int space=13, std::ostream &out=std::cout) |
pretty print | |
void | glslmath::print (mat2f m, std::string name="", std::string prefix="", int space=13, std::ostream &out=std::cout) |
pretty print | |
void | glslmath::print (mat3 m, std::string name="", std::string prefix="", int space=13, std::ostream &out=std::cout) |
pretty print | |
void | glslmath::print (mat3f m, std::string name="", std::string prefix="", int space=13, std::ostream &out=std::cout) |
pretty print | |
void | glslmath::print (mat4 m, std::string name="", std::string prefix="", int space=13, std::ostream &out=std::cout) |
pretty print | |
void | glslmath::print (mat4f m, std::string name="", std::string prefix="", int space=13, std::ostream &out=std::cout) |
pretty print | |
void | glslmath::print (quat q, std::string name="", std::string prefix="", std::ostream &out=std::cout) |
pretty print | |
vec3 | glslmath::hsv2rgb (double hue, double sat, double val) |
hsv to rgb conversion | |
vec3 | glslmath::rgb2hsv (double r, double g, double b) |
rgb to hsv conversion | |
vec3 | glslmath::hsv2rgb (vec3 hsv) |
hsv to rgb conversion | |
vec3 | glslmath::rgb2hsv (vec3 rgb) |
rgb to hsv conversion | |
unsigned int | glslmath::gcd (unsigned int a, unsigned int b) |
greatest common divisor | |
unsigned int | glslmath::lcm (unsigned int a, unsigned int b) |
smallest common multiple | |
double | glslmath::distance2ray (vec3 p, vec3 o, vec3 d) |
calculate the distance of a point p from a ray | |
double | glslmath::distance2ray2 (vec3 p, vec3 o, vec3 d) |
calculate the squared distance of a point p from a ray | |
double | glslmath::distance2line (vec3 p, vec3 a, vec3 b) |
calculate the distance of a point p from a line segment between vectors a and b | |
double | glslmath::distance2line2 (vec3 p, vec3 a, vec3 b) |
calculate the squared distance of a point p from a line segment between vectors a and b | |
void | glslmath::merge_spheres (vec3 ¢er0, double &radius0, const vec3 ¢er1, const double radius1) |
merge two spheres | |
double | glslmath::intersect_ray_unitsphere (vec3 p, vec3 d) |
ray/unitsphere intersection | |
double | glslmath::intersect_ray_ellipsoid (vec3 p, vec3 d, vec3 o, double r1, double r2, double r3) |
ray/ellipsoid intersection | |
double | glslmath::intersect_ray_plane (vec3 p, vec3 d, vec3 o, vec3 n) |
ray/plane intersection | |
int | glslmath::intersect_ray_triangle (const vec3 &o, const vec3 &d, const vec3 &v0, const vec3 &v1, const vec3 &v2, vec3 &tuv) |
Moeller-Trumbore ray/triangle intersection. | |
double | glslmath::ray_triangle_dist (const vec3 &o, const vec3 &d, const vec3 &v1, const vec3 &v2, const vec3 &v3) |
calculate hit distance on ray to triangle | |
int | glslmath::itest_point_sphere (const vec3 &p, const vec3 &b, const double r2) |
geometric point/sphere intersection test | |
int | glslmath::itest_ray_sphere (const vec3 &o, const vec3 &d, const vec3 &b, const double r2) |
geometric ray/sphere intersection test | |
int | glslmath::itest_cone_sphere (const vec3 &o, const vec3 &d, double cone, const vec3 &b, const double r) |
geometric cone/sphere intersection test | |
int | glslmath::itest_ray_bbox (const vec3 &o, const vec3 &d, const vec3 &b, const vec3 &r) |
geometric ray/bbox intersection test | |
int | glslmath::itest_plane_sphere (const vec3 &o, const vec3 &n, const double radius, const vec3 &b, const double r2) |
geometric plane/sphere intersection test | |
int | glslmath::vtest_plane_point (const vec3 &o, const vec3 &n, const vec3 &point) |
point visibility test | |
int | glslmath::vtest_plane_sphere (const vec3 &o, const vec3 &n, const vec3 ¢er, double radius) |
bounding sphere visibility test | |
int | glslmath::vtest_plane_bbox (const vec3 &o, const vec3 &n, const vec3 ¢er, const vec3 &extent) |
bounding box visibility test | |
GLSLmath header