const a = quat.fromEuler(Math.PI / 2, 0, 0, 'xyz');
const b = quat.fromEuler(0, Math.PI / 2, 0, 'xyz');
const c = quat.fromEuler(0, 0, Math.PI / 2, 'xyz');
const d = quat.fromEuler(Math.PI, 0, 0, 'xyz');
const tests = [
{ args: [a, b, c, d, 0], expected: a },
{ args: [a, b, c, d, 1], expected: d },
{ args: [a, b, c, d, 0.25], expected: [0.5946745811867614, 0.2612930755130939, 0.095639903470758, 0.7542818306464518] },
{ args: [a, b, c, d, 0.5], expected: [0.5702395788501929, 0.25198018251105747, 0.25198018251105747, 0.7401613323837869] },
{ args: [a, b, c, d, 0.75], expected: [0.7683175218769692, 0.10832581796559188, 0.29595163845345446, 0.5571053135948666] },
];
for (const {args, expected} of tests) {
testQuatWithAndWithoutDest((...args) => {
return quat.sqlerp(...args);
}, expected, ...args);
}
const a = quat.fromEuler(Math.PI / 2, 0, 0, 'xyz');
const b = quat.fromEuler(0, Math.PI / 2, 0, 'xyz');
const c = quat.fromEuler(0, 0, Math.PI / 2, 'xyz');
const d = quat.fromEuler(Math.PI, 0, 0, 'xyz');
const tests = [
{ args: [a, b, c, d, 0], expected: a },
{ args: [a, b, c, d, 1], expected: d },
{ args: [a, b, c, d, 0.25], expected: [0.5946745811867614, 0.2612930755130939, 0.095639903470758, 0.7542818306464518] },
{ args: [a, b, c, d, 0.5], expected: [0.5702395788501929, 0.25198018251105747, 0.25198018251105747, 0.7401613323837869] },
{ args: [a, b, c, d, 0.75], expected: [0.7683175218769692, 0.10832581796559188, 0.29595163845345446, 0.5571053135948666] },
];
for (const {args, expected} of tests) {
testQuatWithAndWithoutDest((...args) => {
return quat.sqlerp(...args);
}, expected, ...args);
}
const a = quat.fromEuler(Math.PI / 2, 0, 0, 'xyz');
const b = quat.fromEuler(0, Math.PI / 2, 0, 'xyz');
const c = quat.fromEuler(0, 0, Math.PI / 2, 'xyz');
const d = quat.fromEuler(Math.PI, 0, 0, 'xyz');
const tests = [
{ args: [a, b, c, d, 0], expected: a },
{ args: [a, b, c, d, 1], expected: d },
{ args: [a, b, c, d, 0.25], expected: [0.5946745811867614, 0.2612930755130939, 0.095639903470758, 0.7542818306464518] },
{ args: [a, b, c, d, 0.5], expected: [0.5702395788501929, 0.25198018251105747, 0.25198018251105747, 0.7401613323837869] },
{ args: [a, b, c, d, 0.75], expected: [0.7683175218769692, 0.10832581796559188, 0.29595163845345446, 0.5571053135948666] },
];
for (const {args, expected} of tests) {
testQuatWithAndWithoutDest((...args) => {
return quat.sqlerp(...args);
}, expected, ...args);
}