Skip to content

Commit 1f27e29

Browse files
committed
Add test for cubic_slerp
1 parent 4bd3114 commit 1f27e29

File tree

1 file changed

+11
-1
lines changed
  • gdnative-core/src/core_types

1 file changed

+11
-1
lines changed

gdnative-core/src/core_types/quat.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ mod test {
259259
let p = Quat::new(0.485489, 0.142796, -0.862501, 0.001113);
260260
let t = 0.2;
261261
let e = Quat::new(-0.638517, -0.620742, 0.454844, 0.009609);
262-
dbg!(q.slerp(p, t), e);
263262
assert!(e.is_equal_approx(q.slerp(p, t)));
264263
}
265264

@@ -271,4 +270,15 @@ mod test {
271270
let e = Quat::new(-0.535331, -0.836627, -0.114954, 0.016143);
272271
assert!(e.is_equal_approx(q.slerpni(p, t)));
273272
}
273+
274+
#[test]
275+
fn cubic_slerp() {
276+
let a = Quat::new(-0.635115, -0.705592, 0.314052, 0.011812);
277+
let b = Quat::new(0.485489, 0.142796, -0.862501, 0.001113);
278+
let c = Quat::new(-0.666276, 0.03859, 0.083527, -0.740007);
279+
let d = Quat::new(-0.856633, -0.430228, -0.284017, 0.020464);
280+
let t = 0.2;
281+
let e = Quat::new(-0.768253, -0.490687, 0.341836, -0.22839);
282+
assert!(e.is_equal_approx(a.cubic_slerp(b, c, d, t)));
283+
}
274284
}

0 commit comments

Comments
 (0)