Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/armature_test.cc
- This file was moved from tests/gtests/blenkernel/BKE_armature_test.cc.
| Show All 17 Lines | |||||
| */ | */ | ||||
| #include "BKE_armature.h" | #include "BKE_armature.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "testing/testing.h" | #include "testing/testing.h" | ||||
| namespace blender { | |||||
| namespace blenkernel { | |||||
| namespace tests { | |||||
| static const float FLOAT_EPSILON = 1.2e-7; | static const float FLOAT_EPSILON = 1.2e-7; | ||||
| TEST(mat3_vec_to_roll, UnitMatrix) | TEST(mat3_vec_to_roll, UnitMatrix) | ||||
| { | { | ||||
| float unit_matrix[3][3]; | float unit_matrix[3][3]; | ||||
| float roll; | float roll; | ||||
| unit_m3(unit_matrix); | unit_m3(unit_matrix); | ||||
| ▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | TEST(mat3_vec_to_roll, Rotationmatrix) | ||||
| } | } | ||||
| { | { | ||||
| const float between_x_and_y[3] = {1.0f, 1.0f, 0.0f}; | const float between_x_and_y[3] = {1.0f, 1.0f, 0.0f}; | ||||
| mat3_vec_to_roll(rotation_matrix, between_x_and_y, &roll); | mat3_vec_to_roll(rotation_matrix, between_x_and_y, &roll); | ||||
| EXPECT_NEAR(0.57158958f, roll, FLOAT_EPSILON); | EXPECT_NEAR(0.57158958f, roll, FLOAT_EPSILON); | ||||
| } | } | ||||
| } | } | ||||
| } // namespace tests | |||||
| } // namespace blenkernel | |||||
| } // namespace blender | |||||