|
@@ -82,11 +82,11 @@ TEST_CASE("[Animation] Create value track") {
|
|
CHECK(animation->track_get_key_transition(1, 0) == doctest::Approx(real_t(-1.0)));
|
|
CHECK(animation->track_get_key_transition(1, 0) == doctest::Approx(real_t(-1.0)));
|
|
|
|
|
|
// This is a value track, so the methods below should return errors.
|
|
// This is a value track, so the methods below should return errors.
|
|
- CHECK(animation->position_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
- CHECK(animation->rotation_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
- CHECK(animation->scale_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
|
|
+ CHECK(animation->try_position_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
+ CHECK(animation->try_rotation_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
+ CHECK(animation->try_scale_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
CHECK(animation->bezier_track_interpolate(0, 0.0) == doctest::Approx(0.0));
|
|
CHECK(animation->bezier_track_interpolate(0, 0.0) == doctest::Approx(0.0));
|
|
- CHECK(animation->blend_shape_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
|
|
+ CHECK(animation->try_blend_shape_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
ERR_PRINT_ON;
|
|
ERR_PRINT_ON;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -104,22 +104,22 @@ TEST_CASE("[Animation] Create 3D position track") {
|
|
|
|
|
|
Vector3 r_interpolation;
|
|
Vector3 r_interpolation;
|
|
|
|
|
|
- CHECK(animation->position_track_interpolate(0, -0.2, &r_interpolation) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_position_track_interpolate(0, -0.2, &r_interpolation) == OK);
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(0, 1, 2)));
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(0, 1, 2)));
|
|
|
|
|
|
- CHECK(animation->position_track_interpolate(0, 0.0, &r_interpolation) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_position_track_interpolate(0, 0.0, &r_interpolation) == OK);
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(0, 1, 2)));
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(0, 1, 2)));
|
|
|
|
|
|
- CHECK(animation->position_track_interpolate(0, 0.2, &r_interpolation) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_position_track_interpolate(0, 0.2, &r_interpolation) == OK);
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(1.4, 2.2, 3.2)));
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(1.4, 2.2, 3.2)));
|
|
|
|
|
|
- CHECK(animation->position_track_interpolate(0, 0.4, &r_interpolation) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_position_track_interpolate(0, 0.4, &r_interpolation) == OK);
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(2.8, 3.4, 4.4)));
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(2.8, 3.4, 4.4)));
|
|
|
|
|
|
- CHECK(animation->position_track_interpolate(0, 0.5, &r_interpolation) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_position_track_interpolate(0, 0.5, &r_interpolation) == OK);
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(3.5, 4, 5)));
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(3.5, 4, 5)));
|
|
|
|
|
|
- CHECK(animation->position_track_interpolate(0, 0.6, &r_interpolation) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_position_track_interpolate(0, 0.6, &r_interpolation) == OK);
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(3.5, 4, 5)));
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(3.5, 4, 5)));
|
|
|
|
|
|
// 3D position tracks always use linear interpolation for performance reasons.
|
|
// 3D position tracks always use linear interpolation for performance reasons.
|
|
@@ -129,10 +129,10 @@ TEST_CASE("[Animation] Create 3D position track") {
|
|
// This is a 3D position track, so the methods below should return errors.
|
|
// This is a 3D position track, so the methods below should return errors.
|
|
ERR_PRINT_OFF;
|
|
ERR_PRINT_OFF;
|
|
CHECK(animation->value_track_interpolate(0, 0.0).is_null());
|
|
CHECK(animation->value_track_interpolate(0, 0.0).is_null());
|
|
- CHECK(animation->rotation_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
- CHECK(animation->scale_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
|
|
+ CHECK(animation->try_rotation_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
+ CHECK(animation->try_scale_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
CHECK(animation->bezier_track_interpolate(0, 0.0) == doctest::Approx(0.0));
|
|
CHECK(animation->bezier_track_interpolate(0, 0.0) == doctest::Approx(0.0));
|
|
- CHECK(animation->blend_shape_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
|
|
+ CHECK(animation->try_blend_shape_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
ERR_PRINT_ON;
|
|
ERR_PRINT_ON;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -150,22 +150,22 @@ TEST_CASE("[Animation] Create 3D rotation track") {
|
|
|
|
|
|
Quaternion r_interpolation;
|
|
Quaternion r_interpolation;
|
|
|
|
|
|
- CHECK(animation->rotation_track_interpolate(0, -0.2, &r_interpolation) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_rotation_track_interpolate(0, -0.2, &r_interpolation) == OK);
|
|
CHECK(r_interpolation.is_equal_approx(Quaternion(0.403423, 0.259035, 0.73846, 0.47416)));
|
|
CHECK(r_interpolation.is_equal_approx(Quaternion(0.403423, 0.259035, 0.73846, 0.47416)));
|
|
|
|
|
|
- CHECK(animation->rotation_track_interpolate(0, 0.0, &r_interpolation) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_rotation_track_interpolate(0, 0.0, &r_interpolation) == OK);
|
|
CHECK(r_interpolation.is_equal_approx(Quaternion(0.403423, 0.259035, 0.73846, 0.47416)));
|
|
CHECK(r_interpolation.is_equal_approx(Quaternion(0.403423, 0.259035, 0.73846, 0.47416)));
|
|
|
|
|
|
- CHECK(animation->rotation_track_interpolate(0, 0.2, &r_interpolation) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_rotation_track_interpolate(0, 0.2, &r_interpolation) == OK);
|
|
CHECK(r_interpolation.is_equal_approx(Quaternion(0.336182, 0.30704, 0.751515, 0.477425)));
|
|
CHECK(r_interpolation.is_equal_approx(Quaternion(0.336182, 0.30704, 0.751515, 0.477425)));
|
|
|
|
|
|
- CHECK(animation->rotation_track_interpolate(0, 0.4, &r_interpolation) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_rotation_track_interpolate(0, 0.4, &r_interpolation) == OK);
|
|
CHECK(r_interpolation.is_equal_approx(Quaternion(0.266585, 0.352893, 0.759303, 0.477344)));
|
|
CHECK(r_interpolation.is_equal_approx(Quaternion(0.266585, 0.352893, 0.759303, 0.477344)));
|
|
|
|
|
|
- CHECK(animation->rotation_track_interpolate(0, 0.5, &r_interpolation) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_rotation_track_interpolate(0, 0.5, &r_interpolation) == OK);
|
|
CHECK(r_interpolation.is_equal_approx(Quaternion(0.231055, 0.374912, 0.761204, 0.476048)));
|
|
CHECK(r_interpolation.is_equal_approx(Quaternion(0.231055, 0.374912, 0.761204, 0.476048)));
|
|
|
|
|
|
- CHECK(animation->rotation_track_interpolate(0, 0.6, &r_interpolation) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_rotation_track_interpolate(0, 0.6, &r_interpolation) == OK);
|
|
CHECK(r_interpolation.is_equal_approx(Quaternion(0.231055, 0.374912, 0.761204, 0.476048)));
|
|
CHECK(r_interpolation.is_equal_approx(Quaternion(0.231055, 0.374912, 0.761204, 0.476048)));
|
|
|
|
|
|
// 3D rotation tracks always use linear interpolation for performance reasons.
|
|
// 3D rotation tracks always use linear interpolation for performance reasons.
|
|
@@ -175,10 +175,10 @@ TEST_CASE("[Animation] Create 3D rotation track") {
|
|
// This is a 3D rotation track, so the methods below should return errors.
|
|
// This is a 3D rotation track, so the methods below should return errors.
|
|
ERR_PRINT_OFF;
|
|
ERR_PRINT_OFF;
|
|
CHECK(animation->value_track_interpolate(0, 0.0).is_null());
|
|
CHECK(animation->value_track_interpolate(0, 0.0).is_null());
|
|
- CHECK(animation->position_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
- CHECK(animation->scale_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
|
|
+ CHECK(animation->try_position_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
+ CHECK(animation->try_scale_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
CHECK(animation->bezier_track_interpolate(0, 0.0) == doctest::Approx(real_t(0.0)));
|
|
CHECK(animation->bezier_track_interpolate(0, 0.0) == doctest::Approx(real_t(0.0)));
|
|
- CHECK(animation->blend_shape_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
|
|
+ CHECK(animation->try_blend_shape_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
ERR_PRINT_ON;
|
|
ERR_PRINT_ON;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -196,22 +196,22 @@ TEST_CASE("[Animation] Create 3D scale track") {
|
|
|
|
|
|
Vector3 r_interpolation;
|
|
Vector3 r_interpolation;
|
|
|
|
|
|
- CHECK(animation->scale_track_interpolate(0, -0.2, &r_interpolation) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_scale_track_interpolate(0, -0.2, &r_interpolation) == OK);
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(0, 1, 2)));
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(0, 1, 2)));
|
|
|
|
|
|
- CHECK(animation->scale_track_interpolate(0, 0.0, &r_interpolation) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_scale_track_interpolate(0, 0.0, &r_interpolation) == OK);
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(0, 1, 2)));
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(0, 1, 2)));
|
|
|
|
|
|
- CHECK(animation->scale_track_interpolate(0, 0.2, &r_interpolation) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_scale_track_interpolate(0, 0.2, &r_interpolation) == OK);
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(1.4, 2.2, 3.2)));
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(1.4, 2.2, 3.2)));
|
|
|
|
|
|
- CHECK(animation->scale_track_interpolate(0, 0.4, &r_interpolation) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_scale_track_interpolate(0, 0.4, &r_interpolation) == OK);
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(2.8, 3.4, 4.4)));
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(2.8, 3.4, 4.4)));
|
|
|
|
|
|
- CHECK(animation->scale_track_interpolate(0, 0.5, &r_interpolation) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_scale_track_interpolate(0, 0.5, &r_interpolation) == OK);
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(3.5, 4, 5)));
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(3.5, 4, 5)));
|
|
|
|
|
|
- CHECK(animation->scale_track_interpolate(0, 0.6, &r_interpolation) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_scale_track_interpolate(0, 0.6, &r_interpolation) == OK);
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(3.5, 4, 5)));
|
|
CHECK(r_interpolation.is_equal_approx(Vector3(3.5, 4, 5)));
|
|
|
|
|
|
// 3D scale tracks always use linear interpolation for performance reasons.
|
|
// 3D scale tracks always use linear interpolation for performance reasons.
|
|
@@ -221,10 +221,10 @@ TEST_CASE("[Animation] Create 3D scale track") {
|
|
// This is a 3D scale track, so the methods below should return errors.
|
|
// This is a 3D scale track, so the methods below should return errors.
|
|
ERR_PRINT_OFF;
|
|
ERR_PRINT_OFF;
|
|
CHECK(animation->value_track_interpolate(0, 0.0).is_null());
|
|
CHECK(animation->value_track_interpolate(0, 0.0).is_null());
|
|
- CHECK(animation->position_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
- CHECK(animation->rotation_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
|
|
+ CHECK(animation->try_position_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
+ CHECK(animation->try_rotation_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
CHECK(animation->bezier_track_interpolate(0, 0.0) == doctest::Approx(0.0));
|
|
CHECK(animation->bezier_track_interpolate(0, 0.0) == doctest::Approx(0.0));
|
|
- CHECK(animation->blend_shape_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
|
|
+ CHECK(animation->try_blend_shape_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
ERR_PRINT_ON;
|
|
ERR_PRINT_ON;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -247,22 +247,22 @@ TEST_CASE("[Animation] Create blend shape track") {
|
|
CHECK(animation->blend_shape_track_get_key(0, 1, &r_blend) == OK);
|
|
CHECK(animation->blend_shape_track_get_key(0, 1, &r_blend) == OK);
|
|
CHECK(r_blend == doctest::Approx(1.0f));
|
|
CHECK(r_blend == doctest::Approx(1.0f));
|
|
|
|
|
|
- CHECK(animation->blend_shape_track_interpolate(0, -0.2, &r_blend) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_blend_shape_track_interpolate(0, -0.2, &r_blend) == OK);
|
|
CHECK(r_blend == doctest::Approx(-1.0f));
|
|
CHECK(r_blend == doctest::Approx(-1.0f));
|
|
|
|
|
|
- CHECK(animation->blend_shape_track_interpolate(0, 0.0, &r_blend) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_blend_shape_track_interpolate(0, 0.0, &r_blend) == OK);
|
|
CHECK(r_blend == doctest::Approx(-1.0f));
|
|
CHECK(r_blend == doctest::Approx(-1.0f));
|
|
|
|
|
|
- CHECK(animation->blend_shape_track_interpolate(0, 0.2, &r_blend) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_blend_shape_track_interpolate(0, 0.2, &r_blend) == OK);
|
|
CHECK(r_blend == doctest::Approx(-0.2f));
|
|
CHECK(r_blend == doctest::Approx(-0.2f));
|
|
|
|
|
|
- CHECK(animation->blend_shape_track_interpolate(0, 0.4, &r_blend) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_blend_shape_track_interpolate(0, 0.4, &r_blend) == OK);
|
|
CHECK(r_blend == doctest::Approx(0.6f));
|
|
CHECK(r_blend == doctest::Approx(0.6f));
|
|
|
|
|
|
- CHECK(animation->blend_shape_track_interpolate(0, 0.5, &r_blend) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_blend_shape_track_interpolate(0, 0.5, &r_blend) == OK);
|
|
CHECK(r_blend == doctest::Approx(1.0f));
|
|
CHECK(r_blend == doctest::Approx(1.0f));
|
|
|
|
|
|
- CHECK(animation->blend_shape_track_interpolate(0, 0.6, &r_blend) == OK);
|
|
|
|
|
|
+ CHECK(animation->try_blend_shape_track_interpolate(0, 0.6, &r_blend) == OK);
|
|
CHECK(r_blend == doctest::Approx(1.0f));
|
|
CHECK(r_blend == doctest::Approx(1.0f));
|
|
|
|
|
|
// Blend shape tracks always use linear interpolation for performance reasons.
|
|
// Blend shape tracks always use linear interpolation for performance reasons.
|
|
@@ -272,9 +272,9 @@ TEST_CASE("[Animation] Create blend shape track") {
|
|
// This is a blend shape track, so the methods below should return errors.
|
|
// This is a blend shape track, so the methods below should return errors.
|
|
ERR_PRINT_OFF;
|
|
ERR_PRINT_OFF;
|
|
CHECK(animation->value_track_interpolate(0, 0.0).is_null());
|
|
CHECK(animation->value_track_interpolate(0, 0.0).is_null());
|
|
- CHECK(animation->position_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
- CHECK(animation->rotation_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
- CHECK(animation->scale_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
|
|
+ CHECK(animation->try_position_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
+ CHECK(animation->try_rotation_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
+ CHECK(animation->try_scale_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
CHECK(animation->bezier_track_interpolate(0, 0.0) == doctest::Approx(0.0));
|
|
CHECK(animation->bezier_track_interpolate(0, 0.0) == doctest::Approx(0.0));
|
|
ERR_PRINT_ON;
|
|
ERR_PRINT_ON;
|
|
}
|
|
}
|
|
@@ -302,10 +302,10 @@ TEST_CASE("[Animation] Create Bezier track") {
|
|
// This is a bezier track, so the methods below should return errors.
|
|
// This is a bezier track, so the methods below should return errors.
|
|
ERR_PRINT_OFF;
|
|
ERR_PRINT_OFF;
|
|
CHECK(animation->value_track_interpolate(0, 0.0).is_null());
|
|
CHECK(animation->value_track_interpolate(0, 0.0).is_null());
|
|
- CHECK(animation->position_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
- CHECK(animation->rotation_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
- CHECK(animation->scale_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
- CHECK(animation->blend_shape_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
|
|
+ CHECK(animation->try_position_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
+ CHECK(animation->try_rotation_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
+ CHECK(animation->try_scale_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
|
|
+ CHECK(animation->try_blend_shape_track_interpolate(0, 0.0, nullptr) == ERR_INVALID_PARAMETER);
|
|
ERR_PRINT_ON;
|
|
ERR_PRINT_ON;
|
|
}
|
|
}
|
|
|
|
|