openMSX
|
Go to the source code of this file.
Functions | |
template<std::floating_point T> | |
bool | approxEq (T x, T y) |
template<int N, std::floating_point T> | |
bool | approxEq (const vecN< N, T > &x, const vecN< N, T > &y) |
TEST_CASE ("gl_vec: rsqrt") | |
TEST_CASE ("gl_vec: radians, degrees") | |
TEST_CASE ("gl_vec: constructors") | |
TEST_CASE ("gl_vec: modify elements") | |
CHECK (vec2(1, 2) !=vec2(1, 4)) | |
CHECK (ivec2(1, 2)==ivec2(1, 2)) | |
CHECK (ivec2(1, 2) !=ivec2(1, 4)) | |
CHECK (vec3(1, 2, 3)==vec3(1, 2, 3)) | |
CHECK (vec3(1, 2, 3) !=vec3(1, 2, 4)) | |
CHECK (ivec3(1, 2, 3)==ivec3(1, 2, 3)) | |
CHECK (ivec3(1, 2, 3) !=ivec3(1, 2, 4)) | |
CHECK (vec4(1, 2, 3, 4)==vec4(1, 2, 3, 4)) | |
CHECK (vec4(1, 2, 3, 4) !=vec4(1, 2, 4, 4)) | |
CHECK (ivec4(1, 2, 3, 4)==ivec4(1, 2, 3, 4)) | |
CHECK (ivec4(1, 2, 3, 4) !=ivec4(1, 2, 4, 4)) | |
TEST_CASE ("gl_vec: copy constructor, assignment") | |
TEST_CASE ("gl_vec: construct from larger vector") | |
TEST_CASE ("gl_vec: vector add") | |
TEST_CASE ("gl_vec: vector subtract") | |
TEST_CASE ("gl_vec: vector negate") | |
TEST_CASE ("gl_vec: component-wise vector multiplication") | |
CHECK (approxEq(recip(vec4(4, 2, 0.5, 1)), vec4(0.25, 0.5, 2, 1))) | |
CHECK ((v3/2.0f)==vec3(0, 0.5f, -2)) | |
CHECK ((6.0f/w3)==vec3(-6, -3, 3)) | |
CHECK ((v3/w3)==vec3(0, -0.5f, -2)) | |
CHECK (approxEq((v4/-2.0f), vec4(-1, -0.5f, 2, 1.5f))) | |
CHECK (approxEq((6.0f/w4), vec4(-6, 3, 3, -1))) | |
CHECK (approxEq((v4/w4), vec4(-2, 0.5f, -2, 0.5f))) | |
TEST_CASE ("gl_vec: component-wise min/max") | |
TEST_CASE ("gl_vec: minimum component within a vector") | |
TEST_CASE ("gl_vec: clamp") | |
TEST_CASE ("gl_vec: sum of vector components") | |
TEST_CASE ("gl_vec: dot product") | |
CHECK (cross(ivec3(4, -3, 2), ivec3(-1, 3, 2))==ivec3(-12, -10, 9)) | |
CHECK (length2(ivec3(4, -3, 2))==29) | |
CHECK (length2(vec4(4, -3, 2, -1))==30.0f) | |
CHECK (length2(ivec4(4, -3, 2, -1))==30) | |
TEST_CASE ("gl_vec: vector length (2-norm), (only floating point)") | |
TEST_CASE ("gl_vec: vector normalization, only floating point") | |
TEST_CASE ("gl_vec: round") | |
TEST_CASE ("gl_vec: trunc") | |
TEST_CASE ("gl_vec: named elements") | |
Variables | |
vec3 | w3 (-1, -2, 2) |
vec4 | v4 (2, 1, -4, -3) |
vec4 | w4 (-1, 2, 2, -6) |
bool approxEq | ( | const vecN< N, T > & | x, |
const vecN< N, T > & | y | ||
) |
Definition at line 15 of file gl_vec.cc.
References gl::length2().
bool approxEq | ( | T | x, |
T | y | ||
) |
Definition at line 10 of file gl_vec.cc.
Referenced by TEST_CASE().
CHECK | ( | (v3/2.0f) | = =vec3(0, 0.5f, -2) | ) |
CHECK | ( | length2(ivec3(4, -3, 2)) | = =29 | ) |
CHECK | ( | length2(ivec4(4, -3, 2, -1)) | = =30 | ) |
CHECK | ( | length2(vec4(4, -3, 2, -1)) | = =30.0f | ) |
Referenced by TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), and TEST_CASE().
TEST_CASE | ( | "gl_vec: clamp" | ) |
Definition at line 427 of file gl_vec.cc.
References CHECK(), and gl::clamp().
TEST_CASE | ( | "gl_vec: component-wise min/max" | ) |
TEST_CASE | ( | "gl_vec: component-wise vector multiplication" | ) |
TEST_CASE | ( | "gl_vec: construct from larger vector" | ) |
TEST_CASE | ( | "gl_vec: constructors" | ) |
TEST_CASE | ( | "gl_vec: copy | constructor, |
assignment" | |||
) |
TEST_CASE | ( | "gl_vec: dot product" | ) |
Definition at line 450 of file gl_vec.cc.
References CHECK(), gl::dot(), and gl::dot_broadcast().
TEST_CASE | ( | "gl_vec: minimum component within a vector" | ) |
Definition at line 419 of file gl_vec.cc.
References CHECK(), and gl::min_component().
TEST_CASE | ( | "gl_vec: modify elements" | ) |
TEST_CASE | ( | "gl_vec: named elements" | ) |
TEST_CASE | ( | "gl_vec: | radians, |
degrees" | |||
) |
Definition at line 27 of file gl_vec.cc.
References approxEq(), CHECK(), gl::degrees(), Math::pi, and gl::radians().
TEST_CASE | ( | "gl_vec: round" | ) |
Definition at line 486 of file gl_vec.cc.
References CHECK(), and gl::round().
TEST_CASE | ( | "gl_vec: rsqrt" | ) |
Definition at line 21 of file gl_vec.cc.
References CHECK(), and gl::rsqrt().
TEST_CASE | ( | "gl_vec: sum of vector components" | ) |
Definition at line 439 of file gl_vec.cc.
References CHECK(), gl::sum(), and gl::sum_broadcast().
TEST_CASE | ( | "gl_vec: trunc" | ) |
Definition at line 494 of file gl_vec.cc.
References CHECK(), and gl::trunc().
TEST_CASE | ( | "gl_vec: vector add" | ) |
TEST_CASE | ( | "gl_vec: vector length | 2-norm, |
(only floating point)" | |||
) |
Definition at line 474 of file gl_vec.cc.
References CHECK(), and gl::length().
TEST_CASE | ( | "gl_vec: vector | normalization, |
only floating point" | |||
) |
Definition at line 480 of file gl_vec.cc.
References CHECK(), and gl::normalize().
TEST_CASE | ( | "gl_vec: vector subtract" | ) |
vec4 v4(2, 1, -4, -3) | ( | 2 | , |
1 | , | ||
- | 4, | ||
- | 3 | ||
) |
Referenced by TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), and xxhash_impl().
vec3 w3(-1, -2, 2) | ( | - | 1, |
- | 2, | ||
2 | |||
) |
Referenced by openmsx::PixelOperations::blend(), openmsx::PixelOperations::blend(), openmsx::PixelOperations::blend(), ImBezierCubicCalc(), ImBezierQuadraticCalc(), and TEST_CASE().
vec4 w4(-1, 2, 2, -6) | ( | - | 1, |
2 | , | ||
2 | , | ||
- | 6 | ||
) |
Referenced by openmsx::PixelOperations::blend(), openmsx::PixelOperations::blend(), ImBezierCubicCalc(), TEST_CASE(), and TEST_CASE().