Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
Functions | Variables
test_math_quaternion.cpp File Reference
#include <thread>
#include <cassert>
#include <cinttypes>
#include <cstring>
#include <jau/test/catch2_ext.hpp>
#include <jau/math/mat4f.hpp>
#include <jau/math/quaternion.hpp>
Include dependency graph for test_math_quaternion.cpp:

Go to the source code of this file.

Functions

 TEST_CASE ("Test 01 Normalize", "[quaternion][linear_algebra][math]")
 
 TEST_CASE ("Test 02 Rotate Zero Vector", "[quaternion][linear_algebra][math]")
 
 TEST_CASE ("Test 03 Invert and Conugate", "[quaternion][linear_algebra][math]")
 
 TEST_CASE ("Test 04 Dot", "[quaternion][linear_algebra][math]")
 
 TEST_CASE ("Test 10 Angle Axis", "[quaternion][linear_algebra][math]")
 
 TEST_CASE ("Test 11 From Vec to Vec", "[quaternion][linear_algebra][math]")
 
 TEST_CASE ("Test 12 From and to Euler Angles", "[quaternion][linear_algebra][math]")
 
 TEST_CASE ("Test 13 From Euler Angles and Rotate Vec", "[quaternion][linear_algebra][math]")
 
 TEST_CASE ("Test 14 Matrix", "[matrix][quaternion][linear_algebra][math]")
 
 TEST_CASE ("Test 15a Axes And Matrix", "[matrix][quaternion][linear_algebra][math]")
 
 TEST_CASE ("Test 15b Axes And Matrix", "[matrix][quaternion][linear_algebra][math]")
 
 TEST_CASE ("Test 15c Axes And Matrix", "[matrix][quaternion][linear_algebra][math]")
 
 TEST_CASE ("Test 20 Add Subtract", "[quaternion][linear_algebra][math]")
 
 TEST_CASE ("Test 21 Multiply", "[quaternion][linear_algebra][math]")
 
 TEST_CASE ("Test 22 Invert-Mult-Normal-Conjugate", "[quaternion][linear_algebra][math]")
 
 TEST_CASE ("Test 23 Rotation Order", "[quaternion][linear_algebra][math]")
 
 TEST_CASE ("Test 24 Axes", "[quaternion][linear_algebra][math]")
 
 TEST_CASE ("Test 25 Slerp", "[quaternion][linear_algebra][math]")
 
 TEST_CASE ("Test 26 LookAt", "[quaternion][linear_algebra][math]")
 

Variables

static constexpr const bool DEBUG_MODE = false
 
static const float EPSILON = std::numeric_limits<float>::epsilon()
 
static const float HALF_PI = (float)M_PI_2
 
static const Vec3f NEG_ONE = Vec3f ( -1, -1, -1 )
 
static const Vec4f NEG_ONE_v4 = Vec4f ( -1, -1, -1, 0 )
 
static const Vec3f NEG_UNIT_X = Vec3f ( -1, 0, 0 )
 
static const Vec3f NEG_UNIT_Y = Vec3f ( 0, -1, 0 )
 
static const Vec3f NEG_UNIT_Z = Vec3f ( 0, 0, -1 )
 
static const Vec3f ONE = Vec3f ( 1, 1, 1 )
 
static const Vec4f ONE_v4 = Vec4f ( 1, 1, 1, 0 )
 
static const float PI = (float)M_PI
 
static const float QUARTER_PI = (float)M_PI_4
 
static const Quat4f QUAT_IDENT = Quat4f(0, 0, 0, 1)
 
static const Vec3f UNIT_X = Vec3f ( 1, 0, 0 )
 
static const Vec3f UNIT_Y = Vec3f ( 0, 1, 0 )
 
static const Vec3f UNIT_Z = Vec3f ( 0, 0, 1 )
 
static const Vec3f ZERO = Vec3f ( 0, 0, 0 )
 

Function Documentation

◆ TEST_CASE() [1/19]

TEST_CASE ( "Test 01 Normalize"  ,
""  [quaternion][linear_algebra][math] 
)

Definition at line 63 of file test_math_quaternion.cpp.

◆ TEST_CASE() [2/19]

TEST_CASE ( "Test 02 Rotate Zero Vector"  ,
""  [quaternion][linear_algebra][math] 
)

Definition at line 70 of file test_math_quaternion.cpp.

◆ TEST_CASE() [3/19]

TEST_CASE ( "Test 03 Invert and Conugate"  ,
""  [quaternion][linear_algebra][math] 
)

Definition at line 76 of file test_math_quaternion.cpp.

◆ TEST_CASE() [4/19]

TEST_CASE ( "Test 04 Dot"  ,
""  [quaternion][linear_algebra][math] 
)

Definition at line 91 of file test_math_quaternion.cpp.

◆ TEST_CASE() [5/19]

TEST_CASE ( "Test 10 Angle Axis"  ,
""  [quaternion][linear_algebra][math] 
)

Definition at line 101 of file test_math_quaternion.cpp.

◆ TEST_CASE() [6/19]

TEST_CASE ( "Test 11 From Vec to Vec"  ,
""  [quaternion][linear_algebra][math] 
)

Definition at line 130 of file test_math_quaternion.cpp.

◆ TEST_CASE() [7/19]

TEST_CASE ( "Test 12 From and to Euler Angles"  ,
""  [quaternion][linear_algebra][math] 
)

Definition at line 163 of file test_math_quaternion.cpp.

◆ TEST_CASE() [8/19]

TEST_CASE ( "Test 13 From Euler Angles and Rotate Vec"  ,
""  [quaternion][linear_algebra][math] 
)

Definition at line 202 of file test_math_quaternion.cpp.

◆ TEST_CASE() [9/19]

TEST_CASE ( "Test 14 Matrix"  ,
""  [matrix][quaternion][linear_algebra][math] 
)

Definition at line 221 of file test_math_quaternion.cpp.

◆ TEST_CASE() [10/19]

TEST_CASE ( "Test 15a Axes And Matrix"  ,
""  [matrix][quaternion][linear_algebra][math] 
)

Definition at line 427 of file test_math_quaternion.cpp.

◆ TEST_CASE() [11/19]

TEST_CASE ( "Test 15b Axes And Matrix"  ,
""  [matrix][quaternion][linear_algebra][math] 
)

Definition at line 452 of file test_math_quaternion.cpp.

◆ TEST_CASE() [12/19]

TEST_CASE ( "Test 15c Axes And Matrix"  ,
""  [matrix][quaternion][linear_algebra][math] 
)

Definition at line 477 of file test_math_quaternion.cpp.

◆ TEST_CASE() [13/19]

TEST_CASE ( "Test 20 Add Subtract"  ,
""  [quaternion][linear_algebra][math] 
)

Definition at line 525 of file test_math_quaternion.cpp.

◆ TEST_CASE() [14/19]

TEST_CASE ( "Test 21 Multiply"  ,
""  [quaternion][linear_algebra][math] 
)

Definition at line 558 of file test_math_quaternion.cpp.

◆ TEST_CASE() [15/19]

TEST_CASE ( "Test 22 Invert-Mult-Normal-Conjugate"  ,
""  [quaternion][linear_algebra][math] 
)

Definition at line 622 of file test_math_quaternion.cpp.

◆ TEST_CASE() [16/19]

TEST_CASE ( "Test 23 Rotation Order"  ,
""  [quaternion][linear_algebra][math] 
)

Definition at line 649 of file test_math_quaternion.cpp.

◆ TEST_CASE() [17/19]

TEST_CASE ( "Test 24 Axes"  ,
""  [quaternion][linear_algebra][math] 
)

Definition at line 719 of file test_math_quaternion.cpp.

◆ TEST_CASE() [18/19]

TEST_CASE ( "Test 25 Slerp"  ,
""  [quaternion][linear_algebra][math] 
)

Definition at line 739 of file test_math_quaternion.cpp.

◆ TEST_CASE() [19/19]

TEST_CASE ( "Test 26 LookAt"  ,
""  [quaternion][linear_algebra][math] 
)

Definition at line 816 of file test_math_quaternion.cpp.

Variable Documentation

◆ PI

const float PI = (float)M_PI
static

Definition at line 37 of file test_math_quaternion.cpp.

◆ HALF_PI

const float HALF_PI = (float)M_PI_2
static

Definition at line 38 of file test_math_quaternion.cpp.

◆ QUARTER_PI

const float QUARTER_PI = (float)M_PI_4
static

Definition at line 39 of file test_math_quaternion.cpp.

◆ EPSILON

const float EPSILON = std::numeric_limits<float>::epsilon()
static

Definition at line 40 of file test_math_quaternion.cpp.

◆ QUAT_IDENT

const Quat4f QUAT_IDENT = Quat4f(0, 0, 0, 1)
static

Definition at line 42 of file test_math_quaternion.cpp.

◆ ZERO

const Vec3f ZERO = Vec3f ( 0, 0, 0 )
static

Definition at line 44 of file test_math_quaternion.cpp.

◆ ONE

const Vec3f ONE = Vec3f ( 1, 1, 1 )
static

Definition at line 45 of file test_math_quaternion.cpp.

◆ NEG_ONE

const Vec3f NEG_ONE = Vec3f ( -1, -1, -1 )
static

Definition at line 46 of file test_math_quaternion.cpp.

◆ UNIT_X

const Vec3f UNIT_X = Vec3f ( 1, 0, 0 )
static

Definition at line 47 of file test_math_quaternion.cpp.

◆ UNIT_Y

const Vec3f UNIT_Y = Vec3f ( 0, 1, 0 )
static

Definition at line 48 of file test_math_quaternion.cpp.

◆ UNIT_Z

const Vec3f UNIT_Z = Vec3f ( 0, 0, 1 )
static

Definition at line 49 of file test_math_quaternion.cpp.

◆ NEG_UNIT_X

const Vec3f NEG_UNIT_X = Vec3f ( -1, 0, 0 )
static

Definition at line 50 of file test_math_quaternion.cpp.

◆ NEG_UNIT_Y

const Vec3f NEG_UNIT_Y = Vec3f ( 0, -1, 0 )
static

Definition at line 51 of file test_math_quaternion.cpp.

◆ NEG_UNIT_Z

const Vec3f NEG_UNIT_Z = Vec3f ( 0, 0, -1 )
static

Definition at line 52 of file test_math_quaternion.cpp.

◆ NEG_ONE_v4

const Vec4f NEG_ONE_v4 = Vec4f ( -1, -1, -1, 0 )
static

Definition at line 54 of file test_math_quaternion.cpp.

◆ ONE_v4

const Vec4f ONE_v4 = Vec4f ( 1, 1, 1, 0 )
static

Definition at line 55 of file test_math_quaternion.cpp.

◆ DEBUG_MODE

constexpr const bool DEBUG_MODE = false
staticconstexpr

Definition at line 57 of file test_math_quaternion.cpp.