const tests = [
{ expected: [0, 0, 0, 1], mat: mat4.identity(), },
{ expected: [1, 0, 0, 0], mat: mat4.rotationX(Math.PI), },
{ expected: [0, 1, 0, 0], mat: mat4.rotationY(Math.PI), },
{ expected: [0, 0, 1, 0], mat: mat4.rotationZ(Math.PI), },
].map(({expected, mat}) => [
{ expected, mat },
{ expected, mat: mat3.fromMat4(mat), },
]).flat();
for (const {mat, expected} of tests) {
testQuatWithAndWithoutDest((mat, dst) => {
return quat.fromMat(mat, dst);
}, expected, mat);
}
const tests = [
{ expected: [0, 0, 0, 1], mat: mat4.identity(), },
{ expected: [1, 0, 0, 0], mat: mat4.rotationX(Math.PI), },
{ expected: [0, 1, 0, 0], mat: mat4.rotationY(Math.PI), },
{ expected: [0, 0, 1, 0], mat: mat4.rotationZ(Math.PI), },
].map(({expected, mat}) => [
{ expected, mat },
{ expected, mat: mat3.fromMat4(mat), },
]).flat();
for (const {mat, expected} of tests) {
testQuatWithAndWithoutDest((mat, dst) => {
return quat.fromMat(mat, dst);
}, expected, mat);
}
const tests = [
{ expected: [0, 0, 0, 1], mat: mat4.identity(), },
{ expected: [1, 0, 0, 0], mat: mat4.rotationX(Math.PI), },
{ expected: [0, 1, 0, 0], mat: mat4.rotationY(Math.PI), },
{ expected: [0, 0, 1, 0], mat: mat4.rotationZ(Math.PI), },
].map(({expected, mat}) => [
{ expected, mat },
{ expected, mat: mat3.fromMat4(mat), },
]).flat();
for (const {mat, expected} of tests) {
testQuatWithAndWithoutDest((mat, dst) => {
return quat.fromMat(mat, dst);
}, expected, mat);
}