34 # define QUAT_EPSILON 0.0001
49 q[1] = q[2] = q[3] = 0.0f;
62 return (q[0] == 0 && q[1] == 0 && q[2] == 0 && q[3] == 0);
69 t0 =
a[0] * b[0] -
a[1] * b[1] -
a[2] * b[2] -
a[3] * b[3];
70 t1 =
a[0] * b[1] +
a[1] * b[0] +
a[2] * b[3] -
a[3] * b[2];
71 t2 =
a[0] * b[2] +
a[2] * b[0] +
a[3] * b[1] -
a[1] * b[3];
72 q[3] =
a[0] * b[3] +
a[3] * b[0] +
a[1] * b[2] -
a[2] * b[1];
101 t0 = -q[1] *
r[0] - q[2] *
r[1] - q[3] *
r[2];
102 t1 = q[0] *
r[0] + q[2] *
r[2] - q[3] *
r[1];
103 t2 = q[0] *
r[1] + q[3] *
r[0] - q[1] *
r[2];
104 r[2] = q[0] *
r[2] + q[1] *
r[1] - q[2] *
r[0];
108 t1 = t0 * -q[1] +
r[0] * q[0] -
r[1] * q[3] +
r[2] * q[2];
109 t2 = t0 * -q[2] +
r[1] * q[0] -
r[2] * q[1] +
r[0] * q[3];
110 r[2] = t0 * -q[3] +
r[2] * q[0] -
r[0] * q[2] +
r[1] * q[1];
132 return a[0] * b[0] +
a[1] * b[1] +
a[2] * b[2] +
a[3] * b[3];
209 const float eps = 1e-4f;
231 double q0,
q1, q2, q3, qda, qdb, qdc, qaa, qab, qac, qbb, qbc, qcc;
248 m[0][0] = (
float)(1.0 - qbb - qcc);
249 m[0][1] = (
float)(qdc + qab);
250 m[0][2] = (
float)(-qdb + qac);
252 m[1][0] = (
float)(-qdc + qab);
253 m[1][1] = (
float)(1.0 - qaa - qcc);
254 m[1][2] = (
float)(qda + qbc);
256 m[2][0] = (
float)(qdb + qac);
257 m[2][1] = (
float)(-qda + qbc);
258 m[2][2] = (
float)(1.0 - qaa - qbb);
265 if (!((f =
dot_qtqt(q, q)) == 0.0f || (
fabsf(f - 1.0f) < (
float)QUAT_EPSILON))) {
267 "Warning! quat_to_mat3() called with non-normalized: size %.8f *** report a bug ***\n",
277 double q0,
q1, q2, q3, qda, qdb, qdc, qaa, qab, qac, qbb, qbc, qcc;
280 if (!((q0 =
dot_qtqt(q, q)) == 0.0 || (
fabs(q0 - 1.0) < QUAT_EPSILON))) {
282 "Warning! quat_to_mat4() called with non-normalized: size %.8f *** report a bug ***\n",
302 m[0][0] = (
float)(1.0 - qbb - qcc);
303 m[0][1] = (
float)(qdc + qab);
304 m[0][2] = (
float)(-qdb + qac);
307 m[1][0] = (
float)(-qdc + qab);
308 m[1][1] = (
float)(1.0 - qaa - qcc);
309 m[1][2] = (
float)(qda + qbc);
312 m[2][0] = (
float)(qdb + qac);
313 m[2][1] = (
float)(-qda + qbc);
314 m[2][2] = (
float)(1.0 - qaa - qbb);
317 m[3][0] = m[3][1] = m[3][2] = 0.0f;
326 const float trace = mat[0][0] + mat[1][1] + mat[2][2];
329 float s = 2.0f *
sqrtf(1.0f + trace);
335 q[1] = (mat[1][2] - mat[2][1]) * s;
336 q[2] = (mat[2][0] - mat[0][2]) * s;
337 q[3] = (mat[0][1] - mat[1][0]) * s;
342 if (mat[0][0] > mat[1][1] && mat[0][0] > mat[2][2]) {
343 float s = 2.0f *
sqrtf(1.0f + mat[0][0] - mat[1][1] - mat[2][2]);
349 q[0] = (mat[1][2] - mat[2][1]) * s;
350 q[2] = (mat[1][0] + mat[0][1]) * s;
351 q[3] = (mat[2][0] + mat[0][2]) * s;
353 else if (mat[1][1] > mat[2][2]) {
354 float s = 2.0f *
sqrtf(1.0f + mat[1][1] - mat[0][0] - mat[2][2]);
360 q[0] = (mat[2][0] - mat[0][2]) * s;
361 q[1] = (mat[1][0] + mat[0][1]) * s;
362 q[3] = (mat[2][1] + mat[1][2]) * s;
365 float s = 2.0f *
sqrtf(1.0f + mat[2][2] - mat[0][0] - mat[1][1]);
371 q[0] = (mat[0][1] - mat[1][0]) * s;
372 q[1] = (mat[2][0] + mat[0][2]) * s;
373 q[2] = (mat[2][1] + mat[1][2]) * s;
386 float unit_mat[3][3];
412 float mat[3][3], matr[3][3], matn[3][3],
q1[4], q2[4],
angle, si, co,
nor[3];
431 q1[1] = -
nor[0] * si;
432 q1[2] = -
nor[1] * si;
433 q1[3] = -
nor[2] * si;
462 q[0] = q[2] = q[3] = 0.0f;
492 if (angle_sin > FLT_EPSILON) {
499 if (angle_cos > 0.0f) {
579 float t =
atan2f(q[axis + 1], q[0]);
581 if (r_swing || r_twist) {
588 twist_inv[0] = cos_t;
590 twist_inv[axis + 1] = -sin_t;
601 r_twist[axis + 1] = sin_t;
619 return 2.0f *
saacos(q[0]);
645 float quat1[4], quat2[4];
669 return 2.0f *
saacos(q[0]);
672 return -2.0f *
saacos(-q[0]);
708 void vec_to_quat(
float q[4],
const float vec[3],
short axis,
const short upflag)
710 const float eps = 1e-4f;
711 float nor[3], tvec[3];
729 axis = (short)(axis - 3);
750 else if (axis == 1) {
778 if (axis != upflag) {
781 const float *fp = mat[2];
792 else if (axis == 1) {
812 q2[1] = tvec[0] * si;
813 q2[2] = tvec[1] * si;
814 q2[3] = tvec[2] * si;
823 void QuatInterpolW(
float *
result,
float quat1[4],
float quat2[4],
float t)
825 float omega, cosom, sinom, sc1, sc2;
827 cosom = quat1[0] * quat2[0] + quat1[1] * quat2[1] + quat1[2] * quat2[2] + quat1[3] * quat2[3];
830 if ((1.0f + cosom) > 0.0001f) {
832 if ((1.0f - cosom) > 0.0001f) {
835 sc1 =
sinf((1.0 -
t) * omega) / sinom;
836 sc2 =
sinf(
t * omega) / sinom;
842 result[0] = sc1 * quat1[0] + sc2 * quat2[0];
843 result[1] = sc1 * quat1[1] + sc2 * quat2[1];
844 result[2] = sc1 * quat1[2] + sc2 * quat2[2];
845 result[3] = sc1 * quat1[3] + sc2 * quat2[3];
874 const float eps = 1e-4f;
882 omega =
acosf(cosom);
884 r_w[0] =
sinf((1.0f -
t) * omega) / sinom;
885 r_w[1] =
sinf(
t * omega) / sinom;
896 float quat[4], cosom,
w[2];
914 q[0] =
w[0] * quat[0] +
w[1] * b[0];
915 q[1] =
w[0] * quat[1] +
w[1] * b[1];
916 q[2] =
w[0] * quat[2] +
w[1] * b[2];
917 q[3] =
w[0] * quat[3] +
w[1] * b[3];
920 void add_qt_qtqt(
float q[4],
const float a[4],
const float b[4],
const float t)
922 q[0] =
a[0] +
t * b[0];
923 q[1] =
a[1] +
t * b[1];
924 q[2] =
a[2] +
t * b[2];
925 q[3] =
a[3] +
t * b[3];
931 float quat[4],
const float v1[3],
const float v2[3],
const float v3[3],
const float no_orig[3])
934 float vec[3],
q1[4], q2[4], n[3], si, co,
angle, mat[3][3], imat[3][3];
949 if (n[0] == 0.0f && n[1] == 0.0f) {
985 float tri_to_quat(
float q[4],
const float a[3],
const float b[3],
const float c[3])
996 printf(
"%s: %.3f %.3f %.3f %.3f\n",
str, q[0], q[1], q[2], q[3]);
1003 const float phi = 0.5f *
angle;
1004 const float si =
sinf(phi);
1005 const float co =
cosf(phi);
1029 if (!((ha =
dot_qtqt(q, q)) == 0.0f || (
fabsf(ha - 1.0f) < (
float)QUAT_EPSILON))) {
1031 "Warning! quat_to_axis_angle() called with non-normalized: size %.8f *** report a bug "
1045 if (
fabsf(si) < 0.0005f) {
1049 axis[0] = q[1] / si;
1050 axis[1] = q[2] / si;
1051 axis[2] = q[3] / si;
1087 const float axis[3],
1088 const float angle_sin,
1089 const float angle_cos)
1092 float n_00, n_01, n_11, n_02, n_12, n_22;
1098 ico = (1.0f - angle_cos);
1099 nsi[0] = axis[0] * angle_sin;
1100 nsi[1] = axis[1] * angle_sin;
1101 nsi[2] = axis[2] * angle_sin;
1103 n_00 = (axis[0] * axis[0]) * ico;
1104 n_01 = (axis[0] * axis[1]) * ico;
1105 n_11 = (axis[1] * axis[1]) * ico;
1106 n_02 = (axis[0] * axis[2]) * ico;
1107 n_12 = (axis[1] * axis[2]) * ico;
1108 n_22 = (axis[2] * axis[2]) * ico;
1110 mat[0][0] = n_00 + angle_cos;
1111 mat[0][1] = n_01 + nsi[2];
1112 mat[0][2] = n_02 - nsi[1];
1113 mat[1][0] = n_01 - nsi[2];
1114 mat[1][1] = n_11 + angle_cos;
1115 mat[1][2] = n_12 + nsi[0];
1116 mat[2][0] = n_02 + nsi[1];
1117 mat[2][1] = n_12 - nsi[0];
1118 mat[2][2] = n_22 + angle_cos;
1211 R[1][1] = angle_cos;
1212 R[1][2] = angle_sin;
1214 R[2][1] = -angle_sin;
1215 R[2][2] = angle_cos;
1218 R[0][0] = angle_cos;
1220 R[0][2] = -angle_sin;
1224 R[2][0] = angle_sin;
1226 R[2][2] = angle_cos;
1229 R[0][0] = angle_cos;
1230 R[0][1] = angle_sin;
1232 R[1][0] = -angle_sin;
1233 R[1][1] = angle_cos;
1251 R[0][0] = angle_cos;
1252 R[0][1] = angle_sin;
1253 R[1][0] = -angle_sin;
1254 R[1][1] = angle_cos;
1259 const float angle_half =
angle * 0.5f;
1260 const float angle_cos =
cosf(angle_half);
1261 const float angle_sin =
sinf(angle_half);
1262 const int axis_index = (axis -
'X');
1268 q[axis_index + 1] = angle_sin;
1311 double ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
1324 mat[0][0] = (
float)(cj * ch);
1325 mat[1][0] = (
float)(sj * sc - cs);
1326 mat[2][0] = (
float)(sj * cc + ss);
1327 mat[0][1] = (
float)(cj * sh);
1328 mat[1][1] = (
float)(sj * ss + cc);
1329 mat[2][1] = (
float)(sj * cs - sc);
1330 mat[0][2] = (
float)-sj;
1331 mat[1][2] = (
float)(cj * si);
1332 mat[2][2] = (
float)(cj * ci);
1338 double ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
1351 mat[0][0] = (
float)(cj * ch);
1352 mat[1][0] = (
float)(sj * sc - cs);
1353 mat[2][0] = (
float)(sj * cc + ss);
1354 mat[0][1] = (
float)(cj * sh);
1355 mat[1][1] = (
float)(sj * ss + cc);
1356 mat[2][1] = (
float)(sj * cs - sc);
1357 mat[0][2] = (
float)-sj;
1358 mat[1][2] = (
float)(cj * si);
1359 mat[2][2] = (
float)(cj * ci);
1361 mat[3][0] = mat[3][1] = mat[3][2] = mat[0][3] = mat[1][3] = mat[2][3] = 0.0f;
1370 const float cy =
hypotf(mat[0][0], mat[0][1]);
1374 if (cy > 16.0f * FLT_EPSILON) {
1376 eul1[0] =
atan2f(mat[1][2], mat[2][2]);
1377 eul1[1] =
atan2f(-mat[0][2], cy);
1378 eul1[2] =
atan2f(mat[0][1], mat[0][0]);
1380 eul2[0] =
atan2f(-mat[1][2], -mat[2][2]);
1381 eul2[1] =
atan2f(-mat[0][2], -cy);
1382 eul2[2] =
atan2f(-mat[0][1], -mat[0][0]);
1385 eul1[0] =
atan2f(-mat[2][1], mat[1][1]);
1386 eul1[1] =
atan2f(-mat[0][2], cy);
1396 float eul1[3], eul2[3];
1411 float unit_mat[3][3];
1433 float unit_mat[3][3];
1441 float ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
1457 quat[0] = cj * cc + sj * ss;
1458 quat[1] = cj * sc - sj * cs;
1459 quat[2] = cj * ss + sj * cc;
1460 quat[3] = cj * cs - sj * sc;
1466 float eul[3], mat1[3][3], mat2[3][3], totmat[3][3];
1470 eul[0] = eul[1] = eul[2] = 0.0f;
1474 else if (axis ==
'Y') {
1494 const float pi_thresh = (5.1f);
1495 const float pi_x2 = (2.0f * (
float)
M_PI);
1501 for (i = 0; i < 3; i++) {
1502 deul[i] = eul[i] - oldrot[i];
1503 if (deul[i] > pi_thresh) {
1504 eul[i] -=
floorf((deul[i] / pi_x2) + 0.5f) * pi_x2;
1505 deul[i] = eul[i] - oldrot[i];
1507 else if (deul[i] < -pi_thresh) {
1508 eul[i] +=
floorf((-deul[i] / pi_x2) + 0.5f) * pi_x2;
1509 deul[i] = eul[i] - oldrot[i];
1514 if (
fabsf(deul[0]) > 3.2f &&
fabsf(deul[1]) < 1.6f &&
fabsf(deul[2]) < 1.6f) {
1515 if (deul[0] > 0.0f) {
1522 if (
fabsf(deul[1]) > 3.2f &&
fabsf(deul[2]) < 1.6f &&
fabsf(deul[0]) < 1.6f) {
1523 if (deul[1] > 0.0f) {
1530 if (
fabsf(deul[2]) > 3.2f &&
fabsf(deul[0]) < 1.6f &&
fabsf(deul[1]) < 1.6f) {
1531 if (deul[2] > 0.0f) {
1545 float eul1[3], eul2[3];
1553 d1 =
fabsf(eul1[0] - oldrot[0]) +
fabsf(eul1[1] - oldrot[1]) +
fabsf(eul1[2] - oldrot[2]);
1554 d2 =
fabsf(eul2[0] - oldrot[0]) +
fabsf(eul2[1] - oldrot[1]) +
fabsf(eul2[2] - oldrot[2]);
1566 float unit_mat[3][3];
1573 float unit_mat[3][3];
1629 short i =
R->axis[0], j =
R->axis[1], k =
R->axis[2];
1630 double ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
1634 tj =
e[j] * (
R->parity ? -0.5f : 0.5f);
1649 a[i] = cj * sc - sj * cs;
1650 a[j] = cj * ss + sj * cc;
1651 a[k] = cj * cs - sj * sc;
1653 q[0] = (
float)(cj * cc + sj * ss);
1659 q[j + 1] = -q[j + 1];
1666 float unit_mat[3][3];
1676 short i =
R->axis[0], j =
R->axis[1], k =
R->axis[2];
1677 double ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
1702 M[i][i] = (
float)(cj * ch);
1703 M[j][i] = (
float)(sj * sc - cs);
1704 M[k][i] = (
float)(sj * cc + ss);
1705 M[i][j] = (
float)(cj * sh);
1706 M[j][j] = (
float)(sj * ss + cc);
1707 M[k][j] = (
float)(sj * cs - sc);
1709 M[j][k] = (
float)(cj * si);
1710 M[k][k] = (
float)(cj * ci);
1720 short i =
R->axis[0], j =
R->axis[1], k =
R->axis[2];
1725 cy =
hypotf(mat[i][i], mat[i][j]);
1727 if (cy > 16.0f * FLT_EPSILON) {
1728 eul1[i] =
atan2f(mat[j][k], mat[k][k]);
1729 eul1[j] =
atan2f(-mat[i][k], cy);
1730 eul1[k] =
atan2f(mat[i][j], mat[i][i]);
1732 eul2[i] =
atan2f(-mat[j][k], -mat[k][k]);
1733 eul2[j] =
atan2f(-mat[i][k], -cy);
1734 eul2[k] =
atan2f(-mat[i][j], -mat[i][i]);
1737 eul1[i] =
atan2f(-mat[k][j], mat[j][j]);
1738 eul1[j] =
atan2f(-mat[i][k], cy);
1753 float unit_mat[3][3];
1763 float eul1[3], eul2[3];
1781 float unit_mat[3][3];
1806 const float oldrot[3],
1808 const float mat[3][3])
1810 float eul1[3], eul2[3];
1818 d1 =
fabsf(eul1[0] - oldrot[0]) +
fabsf(eul1[1] - oldrot[1]) +
fabsf(eul1[2] - oldrot[2]);
1819 d2 =
fabsf(eul2[0] - oldrot[0]) +
fabsf(eul2[1] - oldrot[1]) +
fabsf(eul2[2] - oldrot[2]);
1830 const float oldrot[3],
1832 const float mat[3][3])
1834 float unit_mat[3][3];
1841 const float oldrot[3],
1843 const float m[4][4])
1852 const float oldrot[3],
1854 const float m[4][4])
1865 const float oldrot[3],
1867 const float quat[4])
1869 float unit_mat[3][3];
1880 float eul[3], mat1[3][3], mat2[3][3], totmat[3][3];
1889 else if (axis ==
'Y') {
1918 teul[
R->axis[0]] = 0;
1924 gmat[
R->axis[2]][
R->axis[2]] = 1;
1960 float *
t, *q, dscale[3], scale[3], basequat[4], mat3[3][3];
1961 float baseRS[4][4], baseinv[4][4], baseR[4][4], baseRinv[4][4];
1962 float R[4][4], S[4][4];
1969 dscale[0] = scale[0] - 1.0f;
1970 dscale[1] = scale[1] - 1.0f;
1971 dscale[2] = scale[2] - 1.0f;
2010 dq->
trans[0] = -0.5f * (
t[0] * q[1] +
t[1] * q[2] +
t[2] * q[3]);
2011 dq->
trans[1] = 0.5f * (
t[0] * q[0] +
t[1] * q[3] -
t[2] * q[2]);
2012 dq->
trans[2] = 0.5f * (-
t[0] * q[3] +
t[1] * q[0] +
t[2] * q[1]);
2013 dq->
trans[3] = 0.5f * (
t[0] * q[2] -
t[1] * q[1] +
t[2] * q[0]);
2036 R[3][0] = 2.0f * (-
t[0] * q0[1] +
t[1] * q0[0] -
t[2] * q0[3] +
t[3] * q0[2]) *
len;
2037 R[3][1] = 2.0f * (-
t[0] * q0[2] +
t[1] * q0[3] +
t[2] * q0[0] -
t[3] * q0[1]) *
len;
2038 R[3][2] = 2.0f * (-
t[0] * q0[3] -
t[1] * q0[2] +
t[2] * q0[1] +
t[3] * q0[0]) *
len;
2048 bool flipped =
false;
2057 dq_sum->
quat[0] += weight * dq->
quat[0];
2058 dq_sum->
quat[1] += weight * dq->
quat[1];
2059 dq_sum->
quat[2] += weight * dq->
quat[2];
2060 dq_sum->
quat[3] += weight * dq->
quat[3];
2087 const float scale = 1.0f / totweight;
2099 dq->
scale[0][0] += addweight;
2100 dq->
scale[1][1] += addweight;
2101 dq->
scale[2][2] += addweight;
2102 dq->
scale[3][3] += addweight;
2112 float M[3][3],
t[3], scalemat[3][3], len2;
2117 M[0][0] =
w *
w +
x *
x -
y *
y -
z *
z;
2118 M[1][0] = 2 * (
x *
y -
w *
z);
2119 M[2][0] = 2 * (
x *
z +
w *
y);
2121 M[0][1] = 2 * (
x *
y +
w *
z);
2122 M[1][1] =
w *
w +
y *
y -
x *
x -
z *
z;
2123 M[2][1] = 2 * (
y *
z -
w *
x);
2125 M[0][2] = 2 * (
x *
z -
w *
y);
2126 M[1][2] = 2 * (
y *
z +
w *
x);
2127 M[2][2] =
w *
w +
z *
z -
x *
x -
y *
y;
2135 t[0] = 2 * (-t0 *
x +
w * t1 - t2 *
z +
y * t3);
2136 t[1] = 2 * (-t0 *
y + t1 *
z -
x * t3 +
w * t2);
2137 t[2] = 2 * (-t0 *
z +
x * t2 +
w * t3 - t1 *
y);
2146 r[0] = (
r[0] +
t[0]) * len2;
2147 r[1] = (
r[1] +
t[1]) * len2;
2148 r[2] = (
r[2] +
t[2]) * len2;
2173 const float quat_track[][4] = {
2175 {sqrt_1_2, 0.0, -sqrt_1_2, 0.0},
2177 {0.5, 0.5, 0.5, 0.5},
2179 {sqrt_1_2, 0.0, 0.0, sqrt_1_2},
2181 {sqrt_1_2, 0.0, sqrt_1_2, 0.0},
2183 {0.5, -0.5, -0.5, 0.5},
2185 {0.0, sqrt_1_2, sqrt_1_2, 0.0},
2194 axis = (short)(axis - 3);
2200 if (upflag != (2 - axis) >> 1) {
2201 float q[4] = {sqrt_1_2, 0.0, 0.0, 0.0};
2202 q[axis + 1] = ((axis == 1)) ? sqrt_1_2 : -sqrt_1_2;
2252 return 2.0f *
atanf((sensor / 2.0f) / focal_length);
2257 return (sensor / 2.0f) /
tanf(hfov * 0.5f);
2284 {{-1.0, 0.0, 0.0}, {0.0, -1.0, 0.0}, {0.0, 0.0, 1.0}},
2285 {{-1.0, 0.0, 0.0}, {0.0, 0.0, -1.0}, {0.0, -1.0, 0.0}},
2286 {{-1.0, 0.0, 0.0}, {0.0, 0.0, 1.0}, {0.0, 1.0, 0.0}},
2287 {{-1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, -1.0}},
2288 {{0.0, -1.0, 0.0}, {-1.0, 0.0, 0.0}, {0.0, 0.0, -1.0}},
2289 {{0.0, 0.0, 1.0}, {-1.0, 0.0, 0.0}, {0.0, -1.0, 0.0}},
2290 {{0.0, 0.0, -1.0}, {-1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}},
2291 {{0.0, 1.0, 0.0}, {-1.0, 0.0, 0.0}, {0.0, 0.0, 1.0}},
2292 {{0.0, -1.0, 0.0}, {0.0, 0.0, 1.0}, {-1.0, 0.0, 0.0}},
2293 {{0.0, 0.0, -1.0}, {0.0, -1.0, 0.0}, {-1.0, 0.0, 0.0}},
2294 {{0.0, 0.0, 1.0}, {0.0, 1.0, 0.0}, {-1.0, 0.0, 0.0}},
2295 {{0.0, 1.0, 0.0}, {0.0, 0.0, -1.0}, {-1.0, 0.0, 0.0}},
2296 {{0.0, -1.0, 0.0}, {0.0, 0.0, -1.0}, {1.0, 0.0, 0.0}},
2297 {{0.0, 0.0, 1.0}, {0.0, -1.0, 0.0}, {1.0, 0.0, 0.0}},
2298 {{0.0, 0.0, -1.0}, {0.0, 1.0, 0.0}, {1.0, 0.0, 0.0}},
2299 {{0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}, {1.0, 0.0, 0.0}},
2300 {{0.0, -1.0, 0.0}, {1.0, 0.0, 0.0}, {0.0, 0.0, 1.0}},
2301 {{0.0, 0.0, -1.0}, {1.0, 0.0, 0.0}, {0.0, -1.0, 0.0}},
2302 {{0.0, 0.0, 1.0}, {1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}},
2303 {{0.0, 1.0, 0.0}, {1.0, 0.0, 0.0}, {0.0, 0.0, -1.0}},
2304 {{1.0, 0.0, 0.0}, {0.0, -1.0, 0.0}, {0.0, 0.0, -1.0}},
2305 {{1.0, 0.0, 0.0}, {0.0, 0.0, 1.0}, {0.0, -1.0, 0.0}},
2306 {{1.0, 0.0, 0.0}, {0.0, 0.0, -1.0}, {0.0, 1.0, 0.0}},
2310 {0x8C8, 0x4D0, 0x2E0, 0xAE8, 0x701, 0x511, 0x119, 0xB29, 0x682, 0x88A, 0x09A, 0x2A2,
2311 0x80B, 0x413, 0x223, 0xA2B, 0x644, 0x454, 0x05C, 0xA6C, 0x745, 0x94D, 0x15D, 0x365},
2312 {0xAC8, 0x8D0, 0x4E0, 0x2E8, 0x741, 0x951, 0x159, 0x369, 0x702, 0xB0A, 0x11A, 0x522,
2313 0xA0B, 0x813, 0x423, 0x22B, 0x684, 0x894, 0x09C, 0x2AC, 0x645, 0xA4D, 0x05D, 0x465},
2314 {0x4C8, 0x2D0, 0xAE0, 0x8E8, 0x681, 0x291, 0x099, 0x8A9, 0x642, 0x44A, 0x05A, 0xA62,
2315 0x40B, 0x213, 0xA23, 0x82B, 0x744, 0x354, 0x15C, 0x96C, 0x705, 0x50D, 0x11D, 0xB25},
2316 {0x2C8, 0xAD0, 0x8E0, 0x4E8, 0x641, 0xA51, 0x059, 0x469, 0x742, 0x34A, 0x15A, 0x962,
2317 0x20B, 0xA13, 0x823, 0x42B, 0x704, 0xB14, 0x11C, 0x52C, 0x685, 0x28D, 0x09D, 0x8A5},
2318 {0x708, 0xB10, 0x120, 0x528, 0x8C1, 0xAD1, 0x2D9, 0x4E9, 0x942, 0x74A, 0x35A, 0x162,
2319 0x64B, 0xA53, 0x063, 0x46B, 0x804, 0xA14, 0x21C, 0x42C, 0x885, 0x68D, 0x29D, 0x0A5},
2320 {0xB08, 0x110, 0x520, 0x728, 0x941, 0x151, 0x359, 0x769, 0x802, 0xA0A, 0x21A, 0x422,
2321 0xA4B, 0x053, 0x463, 0x66B, 0x884, 0x094, 0x29C, 0x6AC, 0x8C5, 0xACD, 0x2DD, 0x4E5},
2322 {0x508, 0x710, 0xB20, 0x128, 0x881, 0x691, 0x299, 0x0A9, 0x8C2, 0x4CA, 0x2DA, 0xAE2,
2323 0x44B, 0x653, 0xA63, 0x06B, 0x944, 0x754, 0x35C, 0x16C, 0x805, 0x40D, 0x21D, 0xA25},
2324 {0x108, 0x510, 0x720, 0xB28, 0x801, 0x411, 0x219, 0xA29, 0x882, 0x08A, 0x29A, 0x6A2,
2325 0x04B, 0x453, 0x663, 0xA6B, 0x8C4, 0x4D4, 0x2DC, 0xAEC, 0x945, 0x14D, 0x35D, 0x765},
2326 {0x748, 0x350, 0x160, 0x968, 0xAC1, 0x2D1, 0x4D9, 0x8E9, 0xA42, 0x64A, 0x45A, 0x062,
2327 0x68B, 0x293, 0x0A3, 0x8AB, 0xA04, 0x214, 0x41C, 0x82C, 0xB05, 0x70D, 0x51D, 0x125},
2328 {0x948, 0x750, 0x360, 0x168, 0xB01, 0x711, 0x519, 0x129, 0xAC2, 0x8CA, 0x4DA, 0x2E2,
2329 0x88B, 0x693, 0x2A3, 0x0AB, 0xA44, 0x654, 0x45C, 0x06C, 0xA05, 0x80D, 0x41D, 0x225},
2330 {0x348, 0x150, 0x960, 0x768, 0xA41, 0x051, 0x459, 0x669, 0xA02, 0x20A, 0x41A, 0x822,
2331 0x28B, 0x093, 0x8A3, 0x6AB, 0xB04, 0x114, 0x51C, 0x72C, 0xAC5, 0x2CD, 0x4DD, 0x8E5},
2332 {0x148, 0x950, 0x760, 0x368, 0xA01, 0x811, 0x419, 0x229, 0xB02, 0x10A, 0x51A, 0x722,
2333 0x08B, 0x893, 0x6A3, 0x2AB, 0xAC4, 0x8D4, 0x4DC, 0x2EC, 0xA45, 0x04D, 0x45D, 0x665},
2334 {0x688, 0x890, 0x0A0, 0x2A8, 0x4C1, 0x8D1, 0xAD9, 0x2E9, 0x502, 0x70A, 0xB1A, 0x122,
2335 0x74B, 0x953, 0x163, 0x36B, 0x404, 0x814, 0xA1C, 0x22C, 0x445, 0x64D, 0xA5D, 0x065},
2336 {0x888, 0x090, 0x2A0, 0x6A8, 0x501, 0x111, 0xB19, 0x729, 0x402, 0x80A, 0xA1A, 0x222,
2337 0x94B, 0x153, 0x363, 0x76B, 0x444, 0x054, 0xA5C, 0x66C, 0x4C5, 0x8CD, 0xADD, 0x2E5},
2338 {0x288, 0x690, 0x8A0, 0x0A8, 0x441, 0x651, 0xA59, 0x069, 0x4C2, 0x2CA, 0xADA, 0x8E2,
2339 0x34B, 0x753, 0x963, 0x16B, 0x504, 0x714, 0xB1C, 0x12C, 0x405, 0x20D, 0xA1D, 0x825},
2340 {0x088, 0x290, 0x6A0, 0x8A8, 0x401, 0x211, 0xA19, 0x829, 0x442, 0x04A, 0xA5A, 0x662,
2341 0x14B, 0x353, 0x763, 0x96B, 0x4C4, 0x2D4, 0xADC, 0x8EC, 0x505, 0x10D, 0xB1D, 0x725},
2342 {0x648, 0x450, 0x060, 0xA68, 0x2C1, 0x4D1, 0x8D9, 0xAE9, 0x282, 0x68A, 0x89A, 0x0A2,
2343 0x70B, 0x513, 0x123, 0xB2B, 0x204, 0x414, 0x81C, 0xA2C, 0x345, 0x74D, 0x95D, 0x165},
2344 {0xA48, 0x650, 0x460, 0x068, 0x341, 0x751, 0x959, 0x169, 0x2C2, 0xACA, 0x8DA, 0x4E2,
2345 0xB0B, 0x713, 0x523, 0x12B, 0x284, 0x694, 0x89C, 0x0AC, 0x205, 0xA0D, 0x81D, 0x425},
2346 {0x448, 0x050, 0xA60, 0x668, 0x281, 0x091, 0x899, 0x6A9, 0x202, 0x40A, 0x81A, 0xA22,
2347 0x50B, 0x113, 0xB23, 0x72B, 0x344, 0x154, 0x95C, 0x76C, 0x2C5, 0x4CD, 0x8DD, 0xAE5},
2348 {0x048, 0xA50, 0x660, 0x468, 0x201, 0xA11, 0x819, 0x429, 0x342, 0x14A, 0x95A, 0x762,
2349 0x10B, 0xB13, 0x723, 0x52B, 0x2C4, 0xAD4, 0x8DC, 0x4EC, 0x285, 0x08D, 0x89D, 0x6A5},
2350 {0x808, 0xA10, 0x220, 0x428, 0x101, 0xB11, 0x719, 0x529, 0x142, 0x94A, 0x75A, 0x362,
2351 0x8CB, 0xAD3, 0x2E3, 0x4EB, 0x044, 0xA54, 0x65C, 0x46C, 0x085, 0x88D, 0x69D, 0x2A5},
2352 {0xA08, 0x210, 0x420, 0x828, 0x141, 0x351, 0x759, 0x969, 0x042, 0xA4A, 0x65A, 0x462,
2353 0xACB, 0x2D3, 0x4E3, 0x8EB, 0x084, 0x294, 0x69C, 0x8AC, 0x105, 0xB0D, 0x71D, 0x525},
2354 {0x408, 0x810, 0xA20, 0x228, 0x081, 0x891, 0x699, 0x2A9, 0x102, 0x50A, 0x71A, 0xB22,
2355 0x4CB, 0x8D3, 0xAE3, 0x2EB, 0x144, 0x954, 0x75C, 0x36C, 0x045, 0x44D, 0x65D, 0xA65},
2362 return (axis < 3) ? axis : axis - 3;
2370 int src_forward,
int src_up,
int dst_forward,
int dst_up,
float r_mat[3][3])
2374 if (src_forward == dst_forward && src_up == dst_up) {
2386 value = ((src_forward << (0 * 3)) | (src_up << (1 * 3)) | (dst_forward << (2 * 3)) |
2387 (dst_up << (3 * 3)));
2406 if (src_axis == dst_axis) {
2412 int src_axis_next = (src_axis + 1) % 3;
2413 int dst_axis_next = (dst_axis + 1) % 3;
2415 if ((src_axis < 3) != (dst_axis < 3)) {
typedef float(TangentPoint)[2]
MINLINE float saacos(float fac)
#define BLI_ASSERT_UNIT_EPSILON
#define BLI_ASSERT_UNIT_M3(m)
MINLINE float square_f(float a)
#define BLI_ASSERT_UNIT_QUAT(q)
#define BLI_ASSERT_UNIT_V3(v)
float normal_tri_v3(float n[3], const float v1[3], const float v2[3], const float v3[3])
void orthogonalize_m4(float R[4][4], int axis)
void mul_m3_v3(const float M[3][3], float r[3])
void mul_m4_fl(float R[4][4], float f)
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void normalize_m3_m3(float R[3][3], const float M[3][3]) ATTR_NONNULL()
void copy_m3_m3(float m1[3][3], const float m2[3][3])
void unit_m3(float m[3][3])
void add_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void copy_m3_m4(float m1[3][3], const float m2[4][4])
void mul_m3_fl(float R[3][3], float f)
void unit_m4(float m[4][4])
void copy_m4_m3(float m1[4][4], const float m2[3][3])
bool invert_m4_m4(float R[4][4], const float A[4][4])
void normalize_m3(float R[3][3]) ATTR_NONNULL()
bool is_orthonormal_m3(const float mat[3][3])
void mul_m4_v3(const float M[4][4], float r[3])
#define mul_m4_series(...)
float determinant_m4(const float m[4][4])
bool invert_m3_m3(float R[3][3], const float A[3][3])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void mat4_to_size(float size[3], const float M[4][4])
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE float len_squared_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v3(float r[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void negate_v3_v3(float r[3], const float a[3])
MINLINE bool is_zero_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
void ortho_v3_v3(float out[3], const float v[3])
MINLINE void negate_v3(float r[3])
MINLINE float normalize_v3_v3(float r[3], const float a[3])
MINLINE float len_squared_v4v4(const float a[4], const float b[4]) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v3_length(float r[3], const float unit_scale)
MINLINE void zero_v3(float r[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
float angle_normalized_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void negate_v4_v4(float r[4], const float a[3])
MINLINE void negate_v4(float r[4])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
Strict compiler flags for areas of code we want to ensure don't do conversions without us knowing abo...
#define IN_RANGE_INCL(a, b, c)
typedef double(DMatrix)[4][4]
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble z
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint order
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
float angle_compat_rad(float angle, float angle_compat)
void rotation_between_quats_to_quat(float q[4], const float q1[4], const float q2[4])
void eulO_to_quat(float q[4], const float e[3], const short order)
float angle_qtqt(const float q1[4], const float q2[4])
void angle_to_mat2(float R[2][2], const float angle)
void mat3_normalized_to_eulO(float eul[3], const short order, const float m[3][3])
void mat4_to_compatible_eulO(float eul[3], const float oldrot[3], const short order, const float m[4][4])
void mat3_to_quat(float q[4], const float m[3][3])
static const RotOrderInfo * get_rotation_order_info(const short order)
float angle_signed_normalized_qtqt(const float q1[4], const float q2[4])
void rotation_between_vecs_to_quat(float q[4], const float v1[3], const float v2[3])
void print_qt(const char *str, const float q[4])
void vec_apply_track(float vec[3], short axis)
static void mat3_normalized_to_eulo2(const float mat[3][3], float eul1[3], float eul2[3], const short order)
float angle_normalized_qt(const float q[4])
float tri_to_quat(float q[4], const float a[3], const float b[3], const float c[3])
void mat3_normalized_to_compatible_eul(float eul[3], const float oldrot[3], float mat[3][3])
void quat_to_compatible_eulO(float eul[3], const float oldrot[3], const short order, const float quat[4])
void mat3_to_quat_is_ok(float q[4], const float wmat[3][3])
float angle_signed_qt(const float q[4])
void invert_qt_normalized(float q[4])
void invert_qt_qt(float q1[4], const float q2[4])
void conjugate_qt_qt(float q1[4], const float q2[4])
void eul_to_mat3(float mat[3][3], const float eul[3])
static float mod_inline(float a, float b)
void add_weighted_dq_dq(DualQuat *dq_sum, const DualQuat *dq, float weight)
void eulO_to_axis_angle(float axis[3], float *angle, const float eul[3], const short order)
void mul_qt_fl(float q[4], const float f)
void quat_to_mat3(float m[3][3], const float q[4])
void mat3_to_eulO(float eul[3], const short order, const float m[3][3])
void axis_angle_normalized_to_mat3_ex(float mat[3][3], const float axis[3], const float angle_sin, const float angle_cos)
void axis_angle_to_mat3_single(float R[3][3], const char axis, const float angle)
void sub_qt_qtqt(float q[4], const float a[4], const float b[4])
void axis_angle_to_quat(float r[4], const float axis[3], const float angle)
void rotate_eulO(float beul[3], const short order, char axis, float ang)
float normalize_qt(float q[4])
void invert_qt(float q[4])
void quat_normalized_to_expmap(float expmap[3], const float q[4])
void quat_to_mat4(float m[4][4], const float q[4])
void dquat_to_mat4(float R[4][4], const DualQuat *dq)
void mat4_normalized_to_axis_angle(float axis[3], float *angle, const float mat[4][4])
void mat4_normalized_to_eulO(float eul[3], const short order, const float m[4][4])
void mul_qt_v3(const float q[4], float r[3])
void mat3_normalized_to_compatible_eulO(float eul[3], const float oldrot[3], const short order, const float mat[3][3])
void quat_to_eulO(float e[3], short const order, const float q[4])
void axis_angle_normalized_to_mat3(float R[3][3], const float axis[3], const float angle)
void eul_to_quat(float quat[4], const float eul[3])
void mat4_to_eulO(float eul[3], const short order, const float m[4][4])
float fov_to_focallength(float hfov, float sensor)
void axis_angle_normalized_to_quat(float r[4], const float axis[3], const float angle)
void pow_qt_fl_normalized(float q[4], const float fac)
void mat4_to_axis_angle(float axis[3], float *angle, const float mat[4][4])
void mat4_normalized_to_eul(float eul[3], const float m[4][4])
float angle_signed_normalized_qt(const float q[4])
void quat_to_eul(float eul[3], const float quat[4])
float normalize_qt_qt(float r[4], const float q[4])
float dot_qtqt(const float a[4], const float b[4])
void invert_qt_qt_normalized(float q1[4], const float q2[4])
static void mat3_normalized_to_eul2(const float mat[3][3], float eul1[3], float eul2[3])
bool is_zero_qt(const float q[4])
float quat_split_swing_and_twist(const float q_in[4], int axis, float r_swing[4], float r_twist[4])
void mat4_normalized_to_compatible_eulO(float eul[3], const float oldrot[3], const short order, const float m[4][4])
void mat3_normalized_to_eul(float eul[3], const float mat[3][3])
void mul_qt_qtqt(float q[4], const float a[4], const float b[4])
void axis_angle_to_quat_single(float q[4], const char axis, const float angle)
void quat_to_axis_angle(float axis[3], float *angle, const float q[4])
void mat3_to_eul(float eul[3], const float mat[3][3])
void quat_to_expmap(float expmap[3], const float q[4])
static float _axis_convert_matrix[23][3][3]
static void quat_to_mat3_no_error(float m[3][3], const float q[4])
void mat4_to_dquat(DualQuat *dq, const float basemat[4][4], const float mat[4][4])
void copy_dq_dq(DualQuat *r, const DualQuat *dq)
void mat3_to_compatible_eul(float eul[3], const float oldrot[3], float mat[3][3])
void axis_angle_to_eulO(float eul[3], const short order, const float axis[3], const float angle)
void mat4_to_quat(float q[4], const float m[4][4])
void rotation_between_vecs_to_mat3(float m[3][3], const float v1[3], const float v2[3])
bool mat3_from_axis_conversion(int src_forward, int src_up, int dst_forward, int dst_up, float r_mat[3][3])
float focallength_to_fov(float focal_length, float sensor)
static int _axis_convert_lut[23][24]
void axis_angle_to_mat3(float R[3][3], const float axis[3], const float angle)
void mul_v3m3_dq(float r[3], float R[3][3], DualQuat *dq)
void interp_qt_qtqt(float q[4], const float a[4], const float b[4], const float t)
void conjugate_qt(float q[4])
void compatible_eul(float eul[3], const float oldrot[3])
void quat_apply_track(float quat[4], short axis, short upflag)
void mat3_to_compatible_eulO(float eul[3], const float oldrot[3], const short order, const float mat[3][3])
void tri_to_quat_ex(float quat[4], const float v1[3], const float v2[3], const float v3[3], const float no_orig[3])
void eulO_to_mat4(float mat[4][4], const float e[3], const short order)
void axis_angle_to_mat4(float R[4][4], const float axis[3], const float angle)
void mat4_to_eul(float eul[3], const float m[4][4])
void quat_to_compatible_eul(float eul[3], const float oldrot[3], const float quat[4])
void mat4_normalized_to_quat(float q[4], const float m[4][4])
void axis_angle_to_mat4_single(float R[4][4], const char axis, const float angle)
float angle_wrap_deg(float angle)
void unit_axis_angle(float axis[3], float *angle)
void mat3_to_axis_angle(float axis[3], float *angle, const float mat[3][3])
struct RotOrderInfo RotOrderInfo
float angle_qt(const float q[4])
void copy_qt_qt(float q[4], const float a[4])
float angle_wrap_rad(float angle)
void normalize_dq(DualQuat *dq, float totweight)
void eulO_to_mat3(float M[3][3], const float e[3], const short order)
void quat_to_compatible_quat(float q[4], const float a[4], const float old[4])
void expmap_to_quat(float r[4], const float expmap[3])
BLI_INLINE int _axis_signed(const int axis)
void mat3_normalized_to_quat(float q[4], const float mat[3][3])
void interp_dot_slerp(const float t, const float cosom, float r_w[2])
float angle_signed_qtqt(const float q1[4], const float q2[4])
void rotate_eul(float beul[3], const char axis, const float ang)
static const RotOrderInfo rotOrders[]
void mat3_normalized_to_axis_angle(float axis[3], float *angle, const float mat[3][3])
float angle_normalized_qtqt(const float q1[4], const float q2[4])
void vec_to_quat(float q[4], const float vec[3], short axis, const short upflag)
void eul_to_mat4(float mat[4][4], const float eul[3])
void add_qt_qtqt(float q[4], const float a[4], const float b[4], const float t)
bool mat3_from_axis_conversion_single(int src_axis, int dst_axis, float r_mat[3][3])
void eulO_to_gimbal_axis(float gmat[3][3], const float eul[3], const short order)
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
INLINE Rall1d< T, V, S > acos(const Rall1d< T, V, S > &x)
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)
ccl_device_inline float2 fabs(const float2 &a)