22 n1[0] =
v1[0] -
v2[0];
23 n2[0] =
v2[0] - v3[0];
24 n1[1] =
v1[1] -
v2[1];
25 n2[1] =
v2[1] - v3[1];
26 n1[2] =
v1[2] -
v2[2];
27 n2[2] =
v2[2] - v3[2];
28 n[0] = n1[1] * n2[2] - n1[2] * n2[1];
29 n[1] = n1[2] * n2[0] - n1[0] * n2[2];
30 n[2] = n1[0] * n2[1] - n1[1] * n2[0];
37 n1[0] =
v1[0] -
v2[0];
38 n2[0] =
v2[0] - v3[0];
39 n1[1] =
v1[1] -
v2[1];
40 n2[1] =
v2[1] - v3[1];
41 n1[2] =
v1[2] -
v2[2];
42 n2[2] =
v2[2] - v3[2];
43 n[0] = n1[1] * n2[2] - n1[2] * n2[1];
44 n[1] = n1[2] * n2[0] - n1[0] * n2[2];
45 n[2] = n1[0] * n2[1] - n1[1] * n2[0];
51 float n[3],
const float v1[3],
const float v2[3],
const float v3[3],
const float v4[3])
56 n1[0] =
v1[0] - v3[0];
57 n1[1] =
v1[1] - v3[1];
58 n1[2] =
v1[2] - v3[2];
60 n2[0] =
v2[0] - v4[0];
61 n2[1] =
v2[1] - v4[1];
62 n2[2] =
v2[2] - v4[2];
64 n[0] = n1[1] * n2[2] - n1[2] * n2[1];
65 n[1] = n1[2] * n2[0] - n1[0] * n2[2];
66 n[2] = n1[0] * n2[1] - n1[1] * n2[0];
77 float area_quad_v3(
const float v1[3],
const float v2[3],
const float v3[3],
const float v4[3])
145 const float *co_curr, *co_prev;
148 co_prev =
verts[nr - 1];
151 for (
a = 0;
a < nr;
a++) {
152 cross += (co_curr[0] - co_prev[0]) * (co_curr[1] + co_prev[1]);
162 const float *v_prev =
verts[nr - 1];
163 const float *v_curr =
verts[0];
169 for (i = 0; i < nr; v_prev = v_curr, v_curr =
verts[++i]) {
192 float a[3],
b[3],
c[3], c_len;
200 if (c_len > FLT_EPSILON) {
212 r_plane[3] = -
dot_v3v3(r_plane, plane_co);
259 float tetra_volume =
dot_v3v3(v_cross, v3);
298 float r_closest_b[2],
318 float p1[2], p2[2], p3[2], p4[2];
328 const float min_dist_sq =
min_ffff(dist_sq1, dist_sq2, dist_sq3, dist_sq4);
329 if (min_dist_sq == dist_sq1) {
333 *r_lambda_b = lambda1;
335 else if (min_dist_sq == dist_sq2) {
339 *r_lambda_b = lambda2;
341 else if (min_dist_sq == dist_sq3) {
344 *r_lambda_a = lambda3;
351 *r_lambda_a = lambda4;
367 if (lambda <= 0.0f) {
371 if (lambda >= 1.0f) {
389 if (lambda <= 0.0f) {
393 if (lambda >= 1.0f) {
418 const float side =
dot_v3v3(plane, pt);
424 const float side =
dot_v3v3(plane, pt);
433 const float fac = side / len_sq;
434 return copysignf(len_sq * (fac * fac), side);
440 const float fac = side / len_sq;
442 return len_sq * (fac * fac);
448 const float side =
dot_v3v3(plane, pt);
449 const float fac = side / len_sq;
450 return copysignf(len_sq * (fac * fac), side);
455 const float side =
dot_v3v3(plane, pt);
456 const float fac = side / len_sq;
458 return len_sq * (fac * fac);
465 const float fac = side / len_sq;
466 return sqrtf(len_sq) * fac;
476 const float side =
dot_v3v3(plane, pt);
477 const float fac = side / len_sq;
478 return sqrtf(len_sq) * fac;
516 const float axis_ref[3])
518 float dir_a[3], dir_b[3];
519 float plane_a[3], plane_b[3];
520 float dist_a, dist_b;
533 else if (
dot_v3v3(axis, axis_ref) < 0.0f) {
557 return min_ff(dist_a, dist_b);
560 return max_ff(dist_a, dist_b);
564 const float ray_direction[3],
567 float origin_to_co[3];
570 float origin_to_proj[3];
573 float co_projected_on_ray[3];
574 add_v3_v3v3(co_projected_on_ray, ray_origin, origin_to_proj);
580 const float ray_direction[3],
588 if (lambda <= 0.0f) {
591 else if (lambda >= 1.0f) {
606 depth =
dot_v3v3(dvec, ray_direction);
616 const float bbmin[3],
617 const float bbmax[3],
621 if (plane_no[0] < 0.0f) {
622 bb_near[0] = bbmax[0];
623 bb_afar[0] = bbmin[0];
626 bb_near[0] = bbmin[0];
627 bb_afar[0] = bbmax[0];
629 if (plane_no[1] < 0.0f) {
630 bb_near[1] = bbmax[1];
631 bb_afar[1] = bbmin[1];
634 bb_near[1] = bbmin[1];
635 bb_afar[1] = bbmax[1];
637 if (plane_no[2] < 0.0f) {
638 bb_near[2] = bbmax[2];
639 bb_afar[2] = bbmin[2];
642 bb_near[2] = bbmin[2];
643 bb_afar[2] = bbmax[2];
652 const float ray_origin[3],
653 const float ray_direction[3])
658 for (
int i = 0; i < 3; i++) {
666 const float bb_min[3],
667 const float bb_max[3],
672 float local_bvmin[3], local_bvmax[3];
675 const float tmin[3] = {
676 (local_bvmin[0] -
data->ray_origin[0]) *
data->ray_inv_dir[0],
677 (local_bvmin[1] -
data->ray_origin[1]) *
data->ray_inv_dir[1],
678 (local_bvmin[2] -
data->ray_origin[2]) *
data->ray_inv_dir[2],
680 const float tmax[3] = {
681 (local_bvmax[0] -
data->ray_origin[0]) *
data->ray_inv_dir[0],
682 (local_bvmax[1] -
data->ray_origin[1]) *
data->ray_inv_dir[1],
683 (local_bvmax[2] -
data->ray_origin[2]) *
data->ray_inv_dir[2],
691 if ((tmax[0] <= tmax[1]) && (tmax[0] <= tmax[2])) {
693 va[0] = vb[0] = local_bvmax[0];
697 else if ((tmax[1] <= tmax[0]) && (tmax[1] <= tmax[2])) {
699 va[1] = vb[1] = local_bvmax[1];
705 va[2] = vb[2] = local_bvmax[2];
710 if ((tmin[0] >= tmin[1]) && (tmin[0] >= tmin[2])) {
712 va[0] = vb[0] = local_bvmin[0];
716 else if ((tmin[1] >= tmin[0]) && (tmin[1] >= tmin[2])) {
718 va[1] = vb[1] = local_bvmin[1];
724 va[2] = vb[2] = local_bvmin[2];
733 if (rtmin <= rtmax) {
741 if (
data->ray_direction[main_axis] >= 0.0f) {
742 va[main_axis] = local_bvmin[main_axis];
743 vb[main_axis] = local_bvmax[main_axis];
746 va[main_axis] = local_bvmax[main_axis];
747 vb[main_axis] = local_bvmin[main_axis];
751 data->ray_origin,
data->ray_direction, va, vb, r_point, r_depth);
755 const float ray_direction[3],
756 const float bb_min[3],
757 const float bb_max[3],
773 const float projmat[4][4],
774 const float winsize[2],
777 float win_half[2], relative_mval[2], px[4], py[4];
782 relative_mval[0] = precalc->
mval[0] / win_half[0];
783 relative_mval[1] = precalc->
mval[1] / win_half[1];
786 for (
int i = 0; i < 4; i++) {
787 px[i] = precalc->
pmat[i][0] - precalc->
pmat[i][3] * relative_mval[0];
788 py[i] = precalc->
pmat[i][1] - precalc->
pmat[i][3] * relative_mval[1];
790 precalc->
pmat[i][0] *= win_half[0];
791 precalc->
pmat[i][1] *= win_half[1];
794 float projmat_trans[4][4];
797 projmat_trans[0], projmat_trans[1], projmat_trans[3], precalc->
ray_origin)) {
816 for (
int i = 0; i < 3; i++) {
824 const float bbmin[3],
825 const float bbmax[3],
826 bool r_axis_closest[3])
828 float local_bvmin[3], local_bvmax[3];
831 const float tmin[3] = {
832 (local_bvmin[0] -
data->ray_origin[0]) *
data->ray_inv_dir[0],
833 (local_bvmin[1] -
data->ray_origin[1]) *
data->ray_inv_dir[1],
834 (local_bvmin[2] -
data->ray_origin[2]) *
data->ray_inv_dir[2],
836 const float tmax[3] = {
837 (local_bvmax[0] -
data->ray_origin[0]) *
data->ray_inv_dir[0],
838 (local_bvmax[1] -
data->ray_origin[1]) *
data->ray_inv_dir[1],
839 (local_bvmax[2] -
data->ray_origin[2]) *
data->ray_inv_dir[2],
847 r_axis_closest[0] =
false;
848 r_axis_closest[1] =
false;
849 r_axis_closest[2] =
false;
851 if ((tmax[0] <= tmax[1]) && (tmax[0] <= tmax[2])) {
853 va[0] = vb[0] = local_bvmax[0];
855 r_axis_closest[0] =
data->ray_direction[0] < 0.0f;
857 else if ((tmax[1] <= tmax[0]) && (tmax[1] <= tmax[2])) {
859 va[1] = vb[1] = local_bvmax[1];
861 r_axis_closest[1] =
data->ray_direction[1] < 0.0f;
865 va[2] = vb[2] = local_bvmax[2];
867 r_axis_closest[2] =
data->ray_direction[2] < 0.0f;
870 if ((tmin[0] >= tmin[1]) && (tmin[0] >= tmin[2])) {
872 va[0] = vb[0] = local_bvmin[0];
874 r_axis_closest[0] =
data->ray_direction[0] >= 0.0f;
876 else if ((tmin[1] >= tmin[0]) && (tmin[1] >= tmin[2])) {
878 va[1] = vb[1] = local_bvmin[1];
880 r_axis_closest[1] =
data->ray_direction[1] >= 0.0f;
884 va[2] = vb[2] = local_bvmin[2];
886 r_axis_closest[2] =
data->ray_direction[2] >= 0.0f;
893 if (rtmin <= rtmax) {
897 if (
data->ray_direction[main_axis] >= 0.0f) {
898 va[main_axis] = local_bvmin[main_axis];
899 vb[main_axis] = local_bvmax[main_axis];
902 va[main_axis] = local_bvmax[main_axis];
903 vb[main_axis] = local_bvmin[main_axis];
905 float scale =
fabsf(local_bvmax[main_axis] - local_bvmin[main_axis]);
912 (va2d[0] +
data->pmat[main_axis][0] * scale),
913 (va2d[1] +
data->pmat[main_axis][1] * scale),
919 float w_b = w_a +
data->pmat[main_axis][3] * scale;
926 float dvec[2], edge[2], lambda, rdist_sq;
930 if (lambda != 0.0f) {
932 if (lambda <= 0.0f) {
934 r_axis_closest[main_axis] =
true;
936 else if (lambda >= 1.0f) {
938 r_axis_closest[main_axis] =
false;
943 r_axis_closest[main_axis] = lambda < 0.5f;
954 const float winsize[2],
956 const float bbmin[3],
957 const float bbmax[3])
962 bool dummy[3] = {
true,
true,
true};
968 float dist_seg_seg_v2(
const float a1[3],
const float a2[3],
const float b1[3],
const float b2[3])
981 float r[3],
const float p[3],
const float v1[3],
const float v2[3],
const float v3[3])
986 float ab[3], ac[3], ap[3], d1, d2;
987 float bp[3], d3, d4, vc, cp[3], d5, d6, vb, va;
996 if (d1 <= 0.0f && d2 <= 0.0f) {
1006 if (d3 >= 0.0f && d4 <= d3) {
1012 vc = d1 * d4 - d3 * d2;
1013 if (vc <= 0.0f && d1 >= 0.0f && d3 <= 0.0f) {
1023 if (d6 >= 0.0f && d5 <= d6) {
1029 vb = d5 * d2 - d1 * d6;
1030 if (vb <= 0.0f && d2 >= 0.0f && d6 <= 0.0f) {
1037 va = d3 * d6 - d5 * d4;
1038 if (va <= 0.0f && (d4 - d3) >= 0.0f && (d5 - d6) >= 0.0f) {
1039 w = (d4 - d3) / ((d4 - d3) + (d5 - d6));
1048 denom = 1.0f / (va + vb + vc);
1065 float div, lambda, mu;
1067 div = (
float)((
v2[0] -
v1[0]) * (v4[1] - v3[1]) - (
v2[1] -
v1[1]) * (v4[0] - v3[0]));
1072 lambda = (
float)((
v1[1] - v3[1]) * (v4[0] - v3[0]) - (
v1[0] - v3[0]) * (v4[1] - v3[1])) / div;
1074 mu = (
float)((
v1[1] - v3[1]) * (
v2[0] -
v1[0]) - (
v1[0] - v3[0]) * (
v2[1] -
v1[1])) / div;
1076 if (lambda >= 0.0f && lambda <= 1.0f && mu >= 0.0f && mu <= 1.0f) {
1077 if (lambda == 0.0f || lambda == 1.0f || mu == 0.0f || mu == 1.0f) {
1086 const float v0[2],
const float v1[2],
const float v2[2],
const float v3[2],
float r_vi[2])
1088 float s10[2], s32[2];
1099 r_vi[0] = ((s32[0] * u) - (s10[0] *
v)) / div;
1100 r_vi[1] = ((s32[1] * u) - (s10[1] *
v)) / div;
1110 float div, lambda, mu;
1112 div = (
v2[0] -
v1[0]) * (v4[1] - v3[1]) - (
v2[1] -
v1[1]) * (v4[0] - v3[0]);
1117 lambda = ((
float)(
v1[1] - v3[1]) * (v4[0] - v3[0]) - (
v1[0] - v3[0]) * (v4[1] - v3[1])) / div;
1119 mu = ((
float)(
v1[1] - v3[1]) * (
v2[0] -
v1[0]) - (
v1[0] - v3[0]) * (
v2[1] -
v1[1])) / div;
1121 if (lambda >= 0.0f && lambda <= 1.0f && mu >= 0.0f && mu <= 1.0f) {
1122 if (lambda == 0.0f || lambda == 1.0f || mu == 0.0f || mu == 1.0f) {
1138 float a_dir[3], b_dir[3], a0b0[3], crs_ab[3];
1149 float a0b1[3], a1b0[3], len_a, len_b, fac1, fac2;
1158 CLAMP(fac1, 0.0f, len_a);
1159 CLAMP(fac2, 0.0f, len_a);
1160 fac_a = (fac1 + fac2) / (2 * len_a);
1169 CLAMP(fac1, 0.0f, len_b);
1170 CLAMP(fac2, 0.0f, len_b);
1171 fac_b = (fac1 + fac2) / (2 * len_b);
1178 float c[3], cray[3];
1182 fac_a =
dot_v3v3(cray, crs_ab) / nlen;
1185 fac_b =
dot_v3v3(cray, crs_ab) / nlen;
1187 CLAMP(fac_a, 0.0f, 1.0f);
1188 CLAMP(fac_b, 0.0f, 1.0f);
1199 const float endpoint_bias,
1202 float s10[2], s32[2], s30[2], d;
1203 const float eps = 1e-6f;
1204 const float endpoint_min = -endpoint_bias;
1205 const float endpoint_max = endpoint_bias + 1.0f;
1219 if ((u >= endpoint_min && u <= endpoint_max) && (
v >= endpoint_min &&
v <= endpoint_max)) {
1237 if (
v >= endpoint_min &&
v <= endpoint_max) {
1255 SWAP(
const float *, v0,
v2);
1256 SWAP(
const float *,
v1, v3);
1278 SWAP(
float, u_a, u_b);
1281 if (u_a > endpoint_max || u_b < endpoint_min) {
1297 const float v0[2],
const float v1[2],
const float v2[2],
const float v3[2],
float r_vi[2])
1299 const float endpoint_bias = 1e-6f;
1308 #define CCW(A, B, C) ((C[1] - A[1]) * (B[0] - A[0]) > (B[1] - A[1]) * (C[0] - A[0]))
1322 double div, lambda, mu;
1324 div = (
v2[0] -
v1[0]) * (v4[1] - v3[1]) - (
v2[1] -
v1[1]) * (v4[0] - v3[0]);
1325 if (
fabs(div) < DBL_EPSILON) {
1329 lambda = ((
v1[1] - v3[1]) * (v4[0] - v3[0]) - (
v1[0] - v3[0]) * (v4[1] - v3[1])) / div;
1331 mu = ((
v1[1] - v3[1]) * (
v2[0] -
v1[0]) - (
v1[0] - v3[0]) * (
v2[1] -
v1[1])) / div;
1340 if (lambda >= 0.0 && lambda <= 1.0 && mu >= 0.0 && mu <= 1.0) {
1341 if (lambda == 0.0 || lambda == 1.0 || mu == 0.0 || mu == 1.0) {
1367 const float ldir[3] = {
1375 const float b = 2.0f * (ldir[0] * (l1[0] - sp[0]) + ldir[1] * (l1[1] - sp[1]) +
1376 ldir[2] * (l1[2] - sp[2]));
1380 const float i =
b *
b - 4.0f *
a *
c;
1390 mu = -
b / (2.0f *
a);
1395 const float i_sqrt =
sqrtf(i);
1398 mu = (-
b + i_sqrt) / (2.0f *
a);
1402 mu = (-
b - i_sqrt) / (2.0f *
a);
1420 const float ldir[2] = {l2[0] - l1[0], l2[1] - l1[1]};
1424 const float b = 2.0f * (ldir[0] * (l1[0] - sp[0]) + ldir[1] * (l1[1] - sp[1]));
1428 const float i =
b *
b - 4.0f *
a *
c;
1438 mu = -
b / (2.0f *
a);
1443 const float i_sqrt =
sqrtf(i);
1446 mu = (-
b + i_sqrt) / (2.0f *
a);
1450 mu = (-
b - i_sqrt) / (2.0f *
a);
1460 const float verts[][2],
1461 const unsigned int nr,
1462 const bool UNUSED(use_holes))
1468 for (i = 0, j = nr - 1; i < nr; j = i++) {
1469 if (((
verts[i][1] > pt[1]) != (
verts[j][1] > pt[1])) &&
1479 const int verts[][2],
1480 const unsigned int nr,
1481 const bool UNUSED(use_holes))
1487 for (i = 0, j = nr - 1; i < nr; j = i++) {
1488 if (((
verts[i][1] > pt[1]) != (
verts[j][1] > pt[1])) &&
1537 const float pt[2],
const float v1[2],
const float v2[2],
const float v3[2],
const float v4[2])
1570 float p[3], s[3], d[3], e1[3], e2[3], q[3];
1587 if ((u < 0.0f) || (u > 1.0f)) {
1594 if ((
v < 0.0f) || ((u +
v) > 1.0f)) {
1599 if ((*r_lambda < 0.0f) || (*r_lambda > 1.0f)) {
1621 float p[3], s[3], d[3], e1[3], e2[3], q[3];
1650 if ((*r_lambda < 0.0f) || (*r_lambda > 1.0f)) {
1672 const float epsilon = 0.00000001f;
1673 float p[3], s[3], e1[3], e2[3], q[3];
1689 if ((u < 0.0f) || (u > 1.0f)) {
1696 if ((
v < 0.0f) || ((u +
v) > 1.0f)) {
1701 if (*r_lambda < 0.0f) {
1715 const float plane[4],
1719 float h[3], plane_co[3];
1729 if (clip && (*r_lambda < 0.0f)) {
1744 float p[3], s[3], e1[3], e2[3], q[3];
1772 if (*r_lambda < 0.0f) {
1791 int kx = (kz != 2) ? (kz + 1) : 0;
1792 int ky = (kx != 2) ? (kx + 1) : 0;
1803 isect_precalc->
sz = inv_dir_z;
1806 isect_precalc->
kx = kx;
1807 isect_precalc->
ky = ky;
1808 isect_precalc->
kz = kz;
1819 const int kx = isect_precalc->
kx;
1820 const int ky = isect_precalc->
ky;
1821 const int kz = isect_precalc->
kz;
1822 const float sx = isect_precalc->
sx;
1823 const float sy = isect_precalc->
sy;
1824 const float sz = isect_precalc->
sz;
1831 const float a_kx =
a[kx], a_ky =
a[ky], a_kz =
a[kz];
1832 const float b_kx =
b[kx], b_ky =
b[ky], b_kz =
b[kz];
1833 const float c_kx =
c[kx], c_ky =
c[ky], c_kz =
c[kz];
1836 const float ax = a_kx -
sx * a_kz;
1837 const float ay = a_ky -
sy * a_kz;
1838 const float bx = b_kx -
sx * b_kz;
1839 const float by = b_ky -
sy * b_kz;
1840 const float cx = c_kx -
sx * c_kz;
1841 const float cy = c_ky -
sy * c_kz;
1844 const float u = cx * by - cy * bx;
1845 const float v = ax * cy - ay * cx;
1846 const float w = bx * ay - by * ax;
1849 if ((u < 0.0f ||
v < 0.0f ||
w < 0.0f) && (u > 0.0f ||
v > 0.0f ||
w > 0.0f)) {
1862 const int sign_det = (
float_as_int(det) & (int)0x80000000);
1863 const float t = (u * a_kz +
v * b_kz +
w * c_kz) * sz;
1864 const float sign_t =
xor_fl(
t, sign_det);
1877 const float inv_det = 1.0f / det;
1879 r_uv[0] = u * inv_det;
1880 r_uv[1] =
v * inv_det;
1882 *r_lambda =
t * inv_det;
1905 const float ray_direction[3],
1913 const float epsilon = 0.00000001f;
1914 float p[3], s[3], e1[3], e2[3], q[3];
1932 if (*r_lambda < 0.0f) {
1939 if (u > 0 &&
v > 0 && u +
v > 1) {
1940 float t = (u +
v - 1) / 2;
1983 const float ray_direction[2],
1989 float v0_local[2], v1_local[2];
2001 const float p[2] = {(ray_direction[0] *
v) / det, (ray_direction[1] *
v) / det};
2003 const float t = (
dot_v2v2(p, ray_direction) /
dot_v2v2(ray_direction, ray_direction));
2004 if ((
t >= 0.0f) == 0) {
2011 if ((u >= 0.0f && u <= 1.0f) == 0) {
2029 const float ray_direction[3],
2034 float a[3],
t[3], n[3];
2045 float c[3], cray[3];
2049 *r_lambda =
dot_v3v3(cray, n) / nlen;
2058 for (i = 0; i < totplane; i++) {
2069 for (
int i = 0; i < totplane; i++) {
2081 const float plane_co[3],
2082 const float plane_no[3])
2102 const float plane_b[4],
2103 const float plane_c[4],
2104 float r_isect_co[3])
2135 const float plane_b[4],
2136 float r_isect_co[3],
2137 float r_isect_no[3])
2139 float det, plane_c[3];
2169 const float planes[][4],
2170 const int planes_len,
2171 const float eps_coplanar,
2172 const float eps_isect,
2173 void (*callback_fn)(
const float co[3],
int i,
int j,
int k,
void *
user_data),
2178 float n1n2[3], n2n3[3], n3n1[3];
2180 for (
int i = 0; i < planes_len; i++) {
2181 const float *n1 = planes[i];
2182 for (
int j = i + 1; j < planes_len; j++) {
2183 const float *n2 = planes[j];
2188 for (
int k = j + 1; k < planes_len; k++) {
2189 const float *n3 = planes[k];
2199 const float quotient = -
dot_v3v3(n1, n2n3);
2200 if (
fabsf(quotient) < eps_coplanar) {
2203 const float co_test[3] = {
2204 ((n2n3[0] * n1[3]) + (n3n1[0] * n2[3]) + (n1n2[0] * n3[3])) / quotient,
2205 ((n2n3[1] * n1[3]) + (n3n1[1] * n2[3]) + (n1n2[1] * n3[3])) / quotient,
2206 ((n2n3[2] * n1[3]) + (n3n1[2] * n2[3]) + (n1n2[2] * n3[3])) / quotient,
2209 for (i_test = 0; i_test < planes_len; i_test++) {
2210 const float *np_test = planes[i_test];
2211 if (((
dot_v3v3(np_test, co_test) + np_test[3]) > eps_isect)) {
2213 if (!
ELEM(i_test, i, j, k)) {
2219 if (i_test == planes_len) {
2220 callback_fn(co_test, i, j, k,
user_data);
2231 const float tri_b[3][3],
2234 int *r_tri_a_edge_isect_count)
2245 double ba[3], bc[3], plane_a[4], plane_b[4];
2246 *r_tri_a_edge_isect_count = 0;
2256 if (!side[1][0] && !side[1][1] && !side[1][2]) {
2261 if ((side[1][0] && side[1][1] && side[1][2]) && (side[1][0] < 0.0f) == (side[1][1] < 0.0f) &&
2262 (side[1][0] < 0.0f) == (side[1][2] < 0.0f)) {
2276 if ((side[0][0] && side[0][1] && side[0][2]) && (side[0][0] < 0.0f) == (side[0][1] < 0.0f) &&
2277 (side[0][0] < 0.0f) == (side[0][2] < 0.0f)) {
2284 double isect_dir[3];
2286 for (
int i = 0; i < 2; i++) {
2287 const float(*tri)[3] = i == 0 ? tri_a : tri_b;
2291 if ((side[i][0] && side[i][1]) && (side[i][0] < 0.0f) == (side[i][1] < 0.0f)) {
2296 else if ((side[i][1] && side[i][2]) && (side[i][1] < 0.0f) == (side[i][2] < 0.0f)) {
2308 float sidec = side[i][tri_i[1]];
2312 float fac0 = sidec / (sidec - side[i][tri_i[0]]);
2313 float fac1 = sidec / (sidec - side[i][tri_i[2]]);
2314 double offset0 = fac0 * (dot_a - dot_b);
2315 double offset1 = fac1 * (dot_c - dot_b);
2316 if (offset0 > offset1) {
2318 SWAP(
double, offset0, offset1);
2319 SWAP(
float, fac0, fac1);
2320 SWAP(
int, tri_i[0], tri_i[2]);
2323 range[i].min = (
float)(dot_b + offset0);
2324 range[i].max = (
float)(dot_b + offset1);
2325 interp_v3_v3v3(range[i].loc[0], tri[tri_i[1]], tri[tri_i[0]], fac0);
2326 interp_v3_v3v3(range[i].loc[1], tri[tri_i[1]], tri[tri_i[2]], fac1);
2329 range[i].min = range[i].max = (
float)dot_b;
2335 if ((range[0].
max > range[1].
min) && (range[0].
min < range[1].
max)) {
2339 if (range[0].
min >= range[1].
min) {
2341 if (range[0].
max <= range[1].
max) {
2343 *r_tri_a_edge_isect_count = 2;
2347 *r_tri_a_edge_isect_count = 1;
2351 if (range[0].
max <= range[1].
max) {
2354 *r_tri_a_edge_isect_count = 1;
2368 const float t_a1[3],
2369 const float t_a2[3],
2370 const float t_b0[3],
2371 const float t_b1[3],
2372 const float t_b2[3],
2376 float tri_a[3][3], tri_b[3][3];
2397 const float t_a1[2],
2398 const float t_a2[2],
2399 const float t_b0[2],
2400 const float t_b1[2],
2401 const float t_b2[2])
2460 const float t_a1[2],
2461 const float t_a2[2],
2462 const float t_b0[2],
2463 const float t_b1[2],
2464 const float t_b2[2])
2508 const float t_a1[2],
2509 const float t_a2[2],
2510 const float t_b0[2],
2511 const float t_b1[2],
2512 const float t_b2[2])
2542 const float t_a1[2],
2543 const float t_a2[2],
2544 const float t_b0[2],
2545 const float t_b1[2],
2546 const float t_b2[2])
2569 const float a,
const float b,
const float c,
const float maxR,
float *root)
2579 float r1 = (-
b - sqrtD) / (2.0f *
a);
2580 float r2 = (-
b + sqrtD) / (2.0f *
a);
2584 SWAP(
float, r1, r2);
2588 if (r1 > 0.0f && r1 < maxR) {
2595 if (r2 > 0.0f && r2 < maxR) {
2606 const float bbmin[3],
2607 const float bbmax[3])
2611 float bb_near[3], bb_far[3];
2612 for (
int i = 0; i < totplane; i++) {
2635 float e1[3], e2[3], e3[3],
point[3], vel[3],
nor[3], temp[3], bv[3];
2636 float a,
b,
c, d,
e,
x,
y,
z, radius2 = radius * radius;
2637 float elen2, edotv, edotbv, nordotv;
2639 bool found_by_sweep =
false;
2657 if (
fabsf(nordotv) < 0.000001f) {
2658 if (
fabsf(
a) >= radius) {
2663 float t0 = (-
a + radius) / nordotv;
2664 float t1 = (-
a - radius) / nordotv;
2667 SWAP(
float, t0, t1);
2670 if (t0 > 1.0f || t1 < 0.0f) {
2675 CLAMP(t0, 0.0f, 1.0f);
2676 CLAMP(t1, 0.0f, 1.0f);
2681 point[0] = p1[0] + vel[0] * t0 -
nor[0] * radius;
2682 point[1] = p1[1] + vel[1] * t0 -
nor[1] * radius;
2683 point[2] = p1[2] + vel[2] * t0 -
nor[2] * radius;
2698 if (
z <= 0.0f && (
x >= 0.0f &&
y >= 0.0f)) {
2718 found_by_sweep =
true;
2728 found_by_sweep =
true;
2738 found_by_sweep =
true;
2751 a = elen2 * (-
dot_v3v3(vel, vel)) + edotv * edotv;
2752 b = 2.0f * (elen2 *
dot_v3v3(vel, bv) - edotv * edotbv);
2753 c = elen2 * (radius2 -
dot_v3v3(bv, bv)) + edotbv * edotbv;
2756 e = (edotv * newLambda - edotbv) / elen2;
2758 if (
e >= 0.0f &&
e <= 1.0f) {
2759 *r_lambda = newLambda;
2763 found_by_sweep =
true;
2773 a = elen2 * (-
dot_v3v3(vel, vel)) + edotv * edotv;
2774 b = 2.0f * (elen2 *
dot_v3v3(vel, bv) - edotv * edotbv);
2775 c = elen2 * (radius2 -
dot_v3v3(bv, bv)) + edotbv * edotbv;
2778 e = (edotv * newLambda - edotbv) / elen2;
2780 if (
e >= 0.0f &&
e <= 1.0f) {
2781 *r_lambda = newLambda;
2785 found_by_sweep =
true;
2800 a = elen2 * (-
dot_v3v3(vel, vel)) + edotv * edotv;
2801 b = 2.0f * (elen2 *
dot_v3v3(vel, bv) - edotv * edotbv);
2802 c = elen2 * (radius2 -
dot_v3v3(bv, bv)) + edotbv * edotbv;
2805 e = (edotv * newLambda - edotbv) / elen2;
2807 if (
e >= 0.0f &&
e <= 1.0f) {
2808 *r_lambda = newLambda;
2812 found_by_sweep =
true;
2816 return found_by_sweep;
2827 const float epsilon = 0.000001f;
2828 float p[3], e1[3], e2[3];
2830 int a0 = axis, a1 = (axis + 1) % 3, a2 = (axis + 2) % 3;
2836 f = (e2[a1] * e1[a2] - e2[a2] * e1[a1]);
2841 v = (p[a2] * e1[a1] - p[a1] * e1[a2]) / f;
2842 if ((
v < 0.0f) || (
v > 1.0f)) {
2852 u = (-p[a2] -
v * e2[a2]) / f;
2855 u = (-p[a1] -
v * e2[a1]) / f;
2858 if ((u < 0.0f) || ((u +
v) > 1.0f)) {
2862 *r_lambda = (p[a0] + u * e1[a0] +
v * e2[a0]) / (p2[a0] - p1[a0]);
2864 if ((*r_lambda < 0.0f) || (*r_lambda > 1.0f)) {
2879 float a[3],
b[3],
c[3], ab[3], cb[3];
2908 float v3t[3], v4t[3];
2942 const float epsilon = 0.000001f;
2953 const float epsilon = 0.000001f;
2954 float a[3],
b[3],
c[3], ab[3], cb[3], ca[3];
2982 if (f1 >= 0 && f1 <= 1 && f2 >= 0 && f2 <= 1) {
2997 const float ray_direction_a[3],
2998 const float ray_origin_b[3],
2999 const float ray_direction_b[3],
3015 float t[3],
c[3], cray[3];
3019 if (r_lambda_a !=
NULL) {
3021 *r_lambda_a =
dot_v3v3(cray, n) / nlen;
3024 if (r_lambda_b !=
NULL) {
3026 *r_lambda_b =
dot_v3v3(cray, n) / nlen;
3033 const float ray_direction_a[3],
3034 const float ray_origin_b[3],
3035 const float ray_direction_b[3],
3049 const float max1[3],
3050 const float min2[3],
3051 const float max2[3])
3053 return (min1[0] < max2[0] && min1[1] < max2[1] && min1[2] < max2[2] && min2[0] < max1[0] &&
3054 min2[1] < max1[1] && min2[2] < max1[2]);
3058 const float ray_origin[3],
3059 const float ray_direction[3])
3063 data->ray_inv_dir[0] = 1.0f / ray_direction[0];
3064 data->ray_inv_dir[1] = 1.0f / ray_direction[1];
3065 data->ray_inv_dir[2] = 1.0f / ray_direction[2];
3067 data->sign[0] =
data->ray_inv_dir[0] < 0.0f;
3068 data->sign[1] =
data->ray_inv_dir[1] < 0.0f;
3069 data->sign[2] =
data->ray_inv_dir[2] < 0.0f;
3073 const float bb_min[3],
3074 const float bb_max[3],
3084 float tmin = (bbox[
data->sign[0]][0] -
data->ray_origin[0]) *
data->ray_inv_dir[0];
3085 float tmax = (bbox[1 -
data->sign[0]][0] -
data->ray_origin[0]) *
data->ray_inv_dir[0];
3087 const float tymin = (bbox[
data->sign[1]][1] -
data->ray_origin[1]) *
data->ray_inv_dir[1];
3088 const float tymax = (bbox[1 -
data->sign[1]][1] -
data->ray_origin[1]) *
data->ray_inv_dir[1];
3090 if ((tmin > tymax) || (tymin > tmax)) {
3102 const float tzmin = (bbox[
data->sign[2]][2] -
data->ray_origin[2]) *
data->ray_inv_dir[2];
3103 const float tzmax = (bbox[1 -
data->sign[2]][2] -
data->ray_origin[2]) *
data->ray_inv_dir[2];
3105 if ((tmin > tzmax) || (tzmin > tmax)) {
3126 const float bb_min[3],
3127 const float bb_max[3],
3133 const double invdirx = (dir[0] > 1e-35f || dir[0] < -1e-35f) ? 1.0 / (
double)dir[0] : DBL_MAX;
3134 const double invdiry = (dir[1] > 1e-35f || dir[1] < -1e-35f) ? 1.0 / (
double)dir[1] : DBL_MAX;
3135 const double invdirz = (dir[2] > 1e-35f || dir[2] < -1e-35f) ? 1.0 / (
double)dir[2] : DBL_MAX;
3136 t[0] = (
double)(bb_min[0] - orig[0]) * invdirx;
3137 t[1] = (
double)(bb_max[0] - orig[0]) * invdirx;
3138 t[2] = (
double)(bb_min[1] - orig[1]) * invdiry;
3139 t[3] = (
double)(bb_max[1] - orig[1]) * invdiry;
3140 t[4] = (
double)(bb_min[2] - orig[2]) * invdirz;
3141 t[5] = (
double)(bb_max[2] - orig[2]) * invdirz;
3142 hit_dist[0] = (
float)fmax(fmax(fmin(
t[0],
t[1]), fmin(
t[2],
t[3])), fmin(
t[4],
t[5]));
3143 hit_dist[1] = (
float)fmin(fmin(fmax(
t[0],
t[1]), fmax(
t[2],
t[3])), fmax(
t[4],
t[5]));
3144 if ((hit_dist[1] < 0.0f) || (hit_dist[0] > hit_dist[1])) {
3149 *tmin = hit_dist[0];
3152 *tmax = hit_dist[1];
3159 const float ray_orig[3],
3160 const float ray_dir[3])
3185 float h[2], u[2], lambda, denom;
3189 if (denom == 0.0f) {
3195 r_close[0] = l1[0] + u[0] * lambda;
3196 r_close[1] = l1[1] + u[1] * lambda;
3205 double h[2], u[2], lambda, denom;
3215 r_close[0] = l1[0] + u[0] * lambda;
3216 r_close[1] = l1[1] + u[1] * lambda;
3221 const float ray_origin[3],
3222 const float ray_direction[3],
3224 const float fallback)
3226 float p_relative[3];
3233 const float ray_origin[3],
3234 const float ray_direction[3])
3243 const float fallback)
3263 const float fallback)
3280 const float plane_no[3],
3296 if (dist_old > dist) {
3299 float fac = (dist / dist_old) * 0.5f;
3310 const int x1,
const int y1,
const int x2,
const int y2,
const int a,
const int b)
3312 float v1[2],
v2[2], v3[2], p[2];
3346 float h, rp[3], cp[3], q[3];
3355 return (h >= 0.0f && h <= 1.0f);
3365 if (h < 0.0f || h > 1.0f) {
3398 const float p[3],
const float v1[3],
const float v2[3],
const float v3[3],
float r_isect_co[3])
3418 const float p1[3],
const float p2[3],
const float plane[4],
float r_p1[3],
float r_p2[3])
3438 const float p1_copy[3] = {
UNPACK3(p1)};
3450 const float p1_copy[3] = {
UNPACK3(p1)};
3458 const float p1_copy[3] = {
UNPACK3(p1)};
3466 const float plane_array[][4],
3467 const int plane_num,
3472 float p1_fac = 0.0f, p2_fac = 1.0f;
3477 for (
int i = 0; i < plane_num; i++) {
3478 const float *plane = plane_array[i];
3479 const float div =
dot_v3v3(dp, plane);
3492 if (p1_fac > p2_fac) {
3498 else if (div < 0.0f) {
3507 if (p1_fac > p2_fac) {
3517 const float p1_copy[3] = {
UNPACK3(p1)};
3563 const float v1[3],
const float v2[3],
const float v3[3],
const int i,
const int j)
3565 return 0.5f * ((
v1[i] -
v2[i]) * (
v2[j] - v3[j]) + (
v1[j] -
v2[j]) * (v3[i] -
v2[i]));
3587 wtot =
w[0] +
w[1] +
w[2];
3604 float w[3],
const float v1[3],
const float v2[3],
const float v3[3],
const float co[3])
3638 float n1[3], n2[3], n[3];
3648 if (!ok || (
w[0] < 0.0f)) {
3677 const float v1[2],
const float v2[2],
const float v3[2],
const float co[2],
float w[3])
3679 const float x = co[0],
y = co[1];
3680 const float x1 =
v1[0],
y1 =
v1[1];
3681 const float x2 =
v2[0], y2 =
v2[1];
3682 const float x3 = v3[0], y3 = v3[1];
3683 const float det = (y2 - y3) * (x1 - x3) + (x3 -
x2) * (
y1 - y3);
3689 w[0] = ((y2 - y3) * (
x - x3) + (x3 -
x2) * (
y - y3)) / det;
3690 w[1] = ((y3 -
y1) * (
x - x3) + (x1 - x3) * (
y - y3)) / det;
3691 w[2] = 1.0f -
w[0] -
w[1];
3701 const float v1[2],
const float v2[2],
const float v3[2],
const float co[2],
float w[3])
3708 wtot =
w[0] +
w[1] +
w[2];
3724 const float v1[2],
const float v2[2],
const float v3[2],
const float co[2],
float w[3])
3731 wtot =
w[0] +
w[1] +
w[2];
3747 const float v1[4],
const float v2[4],
const float v3[4],
const float co[2],
float w[3])
3754 wtot =
w[0] +
w[1] +
w[2];
3781 #define MEAN_VALUE_HALF_TAN_V2(_area, i1, i2) \
3782 ((_area = cross_v2v2(dirs[i1], dirs[i2])) != 0.0f ? \
3783 fabsf(((lens[i1] * lens[i2]) - dot_v2v2(dirs[i1], dirs[i2])) / _area) : \
3786 const float dirs[4][2] = {
3787 {
v1[0] - co[0],
v1[1] - co[1]},
3788 {
v2[0] - co[0],
v2[1] - co[1]},
3789 {v3[0] - co[0], v3[1] - co[1]},
3790 {v4[0] - co[0], v4[1] - co[1]},
3793 const float lens[4] = {
3801 if (
UNLIKELY(lens[0] < FLT_EPSILON)) {
3803 w[1] =
w[2] =
w[3] = 0.0f;
3805 else if (
UNLIKELY(lens[1] < FLT_EPSILON)) {
3807 w[0] =
w[2] =
w[3] = 0.0f;
3809 else if (
UNLIKELY(lens[2] < FLT_EPSILON)) {
3811 w[0] =
w[1] =
w[3] = 0.0f;
3813 else if (
UNLIKELY(lens[3] < FLT_EPSILON)) {
3815 w[0] =
w[1] =
w[2] = 0.0f;
3823 # pragma clang diagnostic push
3824 # pragma clang diagnostic ignored "-Wunsequenced"
3828 const float t[4] = {
3836 # pragma clang diagnostic pop
3839 #undef MEAN_VALUE_HALF_TAN_V2
3841 w[0] = (
t[3] +
t[0]) / lens[0];
3842 w[1] = (
t[0] +
t[1]) / lens[1];
3843 w[2] = (
t[1] +
t[2]) / lens[2];
3844 w[3] = (
t[2] +
t[3]) / lens[3];
3846 wtot =
w[0] +
w[1] +
w[2] +
w[3];
3863 float const pt_src[3],
3864 const float tri_tar_p1[3],
3865 const float tri_tar_p2[3],
3866 const float tri_tar_p3[3],
3867 const float tri_src_p1[3],
3868 const float tri_src_p2[3],
3869 const float tri_src_p3[3])
3877 float no_tar[3], no_src[3];
3878 float mat_src[3][3];
3880 float tri_xy_src[3][3];
3882 float area_tar, area_src;
3900 area_src =
sqrtf(
area_tri_v2(tri_xy_src[0], tri_xy_src[1], tri_xy_src[2]));
3902 z_ofs_src = pt_src_xy[2] - tri_xy_src[0][2];
3903 madd_v3_v3v3fl(pt_tar, pt_tar, no_tar, (z_ofs_src / area_src) * area_tar);
3907 const float p_src[3],
3908 const float l_dst_p1[3],
3909 const float l_dst_p2[3],
3910 const float l_src_p1[3],
3911 const float l_src_p2[3])
3919 int found_invalid = 0;
3920 int found_valid = 0;
3923 for (i = 0; i < list_size; i++) {
3924 if (
array[i] == skipval) {
3932 if (found_valid == 0) {
3935 if (found_invalid == 0) {
3940 float valid_last = skipval;
3943 float *array_up =
MEM_callocN(
sizeof(
float) * (
size_t)list_size,
"interp_sparse_array up");
3944 float *array_down =
MEM_callocN(
sizeof(
float) * (
size_t)list_size,
"interp_sparse_array up");
3946 int *ofs_tot_up =
MEM_callocN(
sizeof(
int) * (
size_t)list_size,
"interp_sparse_array tup");
3947 int *ofs_tot_down =
MEM_callocN(
sizeof(
int) * (
size_t)list_size,
"interp_sparse_array tdown");
3949 for (i = 0; i < list_size; i++) {
3950 if (
array[i] == skipval) {
3951 array_up[i] = valid_last;
3952 ofs_tot_up[i] = ++valid_ofs;
3955 valid_last =
array[i];
3960 valid_last = skipval;
3963 for (i = list_size - 1; i >= 0; i--) {
3964 if (
array[i] == skipval) {
3965 array_down[i] = valid_last;
3966 ofs_tot_down[i] = ++valid_ofs;
3969 valid_last =
array[i];
3975 for (i = 0; i < list_size; i++) {
3976 if (
array[i] == skipval) {
3977 if (array_up[i] != skipval && array_down[i] != skipval) {
3978 array[i] = ((array_up[i] * (
float)ofs_tot_down[i]) +
3979 (array_down[i] * (
float)ofs_tot_up[i])) /
3980 (
float)(ofs_tot_down[i] + ofs_tot_up[i]);
3982 else if (array_up[i] != skipval) {
3983 array[i] = array_up[i];
3985 else if (array_down[i] != skipval) {
3986 array[i] = array_down[i];
4004 #define IS_POINT_IX (1 << 0)
4005 #define IS_SEGMENT_IX (1 << 1)
4007 #define DIR_V3_SET(d_len, va, vb) \
4009 sub_v3_v3v3((d_len)->dir, va, vb); \
4010 (d_len)->len = len_v3((d_len)->dir); \
4014 #define DIR_V2_SET(d_len, va, vb) \
4016 sub_v2db_v2fl_v2fl((d_len)->dir, va, vb); \
4017 (d_len)->len = len_v2_db((d_len)->dir); \
4040 const float len = d_curr->
len * d_next->
len;
4066 const double len = d_curr->
len * d_next->
len;
4079 float max_value = 0;
4081 for (
int i = 0; i < n; i++) {
4089 const float eps = 16.0f * FLT_EPSILON * max_value;
4090 const float eps_sq =
eps *
eps;
4091 const float *v_curr, *v_next;
4093 float totweight = 0.0f;
4109 while (i_next < n) {
4127 w[i_curr] = (ht_prev + ht) / d_curr.
len;
4128 totweight +=
w[i_curr];
4139 memset(
w, 0,
sizeof(*
w) * (
size_t)n);
4146 CLAMP(fac, 0.0f, 1.0f);
4147 w[i_curr] = 1.0f - fac;
4152 if (totweight != 0.0f) {
4153 for (i_curr = 0; i_curr < n; i_curr++) {
4154 w[i_curr] /= totweight;
4164 float max_value = 0;
4166 for (
int i = 0; i < n; i++) {
4173 const float eps = 16.0f * FLT_EPSILON * max_value;
4174 const float eps_sq =
eps *
eps;
4176 const float *v_curr, *v_next;
4178 float totweight = 0.0f;
4194 while (i_next < n) {
4212 w[i_curr] = (d_curr.
len == 0.0) ? 0.0f : (
float)((ht_prev + ht) / d_curr.
len);
4213 totweight +=
w[i_curr];
4224 memset(
w, 0,
sizeof(*
w) * (
size_t)n);
4231 CLAMP(fac, 0.0f, 1.0f);
4232 w[i_curr] = 1.0f - fac;
4237 if (totweight != 0.0f) {
4238 for (i_curr = 0; i_curr < n; i_curr++) {
4239 w[i_curr] /= totweight;
4246 #undef IS_SEGMENT_IX
4262 const float t2 =
t *
t;
4263 const float t3 = t2 *
t;
4266 a[0] =
v1[0] +
v2[0] + 2 * (x1[0] -
x2[0]);
4267 a[1] =
v1[1] +
v2[1] + 2 * (x1[1] -
x2[1]);
4268 a[2] =
v1[2] +
v2[2] + 2 * (x1[2] -
x2[2]);
4270 b[0] = -2 *
v1[0] -
v2[0] - 3 * (x1[0] -
x2[0]);
4271 b[1] = -2 *
v1[1] -
v2[1] - 3 * (x1[1] -
x2[1]);
4272 b[2] = -2 *
v1[2] -
v2[2] - 3 * (x1[2] -
x2[2]);
4274 x[0] =
a[0] * t3 +
b[0] * t2 +
v1[0] *
t + x1[0];
4275 x[1] =
a[1] * t3 +
b[1] * t2 +
v1[1] *
t + x1[1];
4276 x[2] =
a[2] * t3 +
b[2] * t2 +
v1[2] *
t + x1[2];
4278 v[0] = 3 *
a[0] * t2 + 2 *
b[0] *
t +
v1[0];
4279 v[1] = 3 *
a[1] * t2 + 2 *
b[1] *
t +
v1[1];
4280 v[2] = 3 *
a[2] * t2 + 2 *
b[2] *
t +
v1[2];
4286 #define IS_ZERO(x) ((x > (-DBL_EPSILON) && x < DBL_EPSILON) ? 1 : 0)
4289 float r_uv[2],
const float st[2],
const float st0[2],
const float st1[2],
const float st2[2])
4294 const double a = st0[0] - st2[0],
b = st1[0] - st2[0];
4295 const double c = st0[1] - st2[1], d = st1[1] - st2[1];
4296 const double det =
a * d -
c *
b;
4300 const double x[2] = {
st[0] - st2[0],
st[1] - st2[1]};
4302 r_uv[0] = (
float)((d *
x[0] -
b *
x[1]) / det);
4303 r_uv[1] = (
float)(((-
c) *
x[0] +
a *
x[1]) / det);
4311 float r_uv[2],
const float st[3],
const float st0[3],
const float st1[3],
const float st2[3])
4313 float v0[3],
v1[3],
v2[3];
4314 double d00, d01, d11, d20, d21, det;
4326 det = d00 * d11 - d01 * d01;
4332 w = (
float)((d00 * d21 - d01 * d20) / det);
4333 r_uv[1] = (
float)((d11 * d20 - d01 * d21) / det);
4334 r_uv[0] = 1.0f - r_uv[1] -
w;
4352 float r_deriv[2][2],
4359 const double signed_area = (st0[0] * st1[1] - st0[1] * st1[0]) +
4360 (st1[0] * st2[1] - st1[1] * st2[0]) +
4361 (st2[0] * st3[1] - st2[1] * st3[0]) +
4362 (st3[0] * st0[1] - st3[1] * st0[0]);
4366 const double a = (st0[0] -
st[0]) * (st0[1] - st3[1]) - (st0[1] -
st[1]) * (st0[0] - st3[0]);
4369 const double b = 0.5 * (
double)(((st0[0] -
st[0]) * (st1[1] - st2[1]) -
4370 (st0[1] -
st[1]) * (st1[0] - st2[0])) +
4371 ((st1[0] -
st[0]) * (st0[1] - st3[1]) -
4372 (st1[1] -
st[1]) * (st0[0] - st3[0])));
4375 const double fC = (st1[0] -
st[0]) * (st1[1] - st2[1]) - (st1[1] -
st[1]) * (st1[0] - st2[0]);
4376 double denom =
a - 2 *
b + fC;
4382 const double fDen =
a - fC;
4384 r_uv[0] = (
float)(
a / fDen);
4388 const double desc_sq =
b *
b -
a * fC;
4389 const double desc =
sqrt(desc_sq < 0.0 ? 0.0 : desc_sq);
4390 const double s = signed_area > 0 ? (-1.0) : 1.0;
4392 r_uv[0] = (
float)(((
a -
b) + s * desc) / denom);
4398 const double denom_s = (1 - r_uv[0]) * (st0[0] - st3[0]) + r_uv[0] * (st1[0] - st2[0]);
4399 const double denom_t = (1 - r_uv[0]) * (st0[1] - st3[1]) + r_uv[0] * (st1[1] - st2[1]);
4403 if (
fabs(denom_s) <
fabs(denom_t)) {
4409 r_uv[1] = (
float)((
double)((1.0f - r_uv[0]) * (st0[i] -
st[i]) +
4410 r_uv[0] * (st1[i] -
st[i])) /
4416 float tmp1[2], tmp2[2], s[2],
t[2];
4429 denom =
t[0] * s[1] -
t[1] * s[0];
4432 double inv_denom = 1.0 / denom;
4433 r_deriv[0][0] = (
float)((
double)-
t[1] * inv_denom);
4434 r_deriv[0][1] = (
float)((
double)
t[0] * inv_denom);
4435 r_deriv[1][0] = (
float)((
double)s[1] * inv_denom);
4436 r_deriv[1][1] = (
float)((
double)-s[0] * inv_denom);
4447 const double signed_area = (st0[0] * st1[1] - st0[1] * st1[0]) +
4448 (st1[0] * st2[1] - st1[1] * st2[0]) +
4449 (st2[0] * st3[1] - st2[1] * st3[0]) +
4450 (st3[0] * st0[1] - st3[1] * st0[0]);
4454 const double a = (st0[0] -
st[0]) * (st0[1] - st3[1]) - (st0[1] -
st[1]) * (st0[0] - st3[0]);
4457 const double b = 0.5 * (
double)(((st0[0] -
st[0]) * (st1[1] - st2[1]) -
4458 (st0[1] -
st[1]) * (st1[0] - st2[0])) +
4459 ((st1[0] -
st[0]) * (st0[1] - st3[1]) -
4460 (st1[1] -
st[1]) * (st0[0] - st3[0])));
4463 const double fC = (st1[0] -
st[0]) * (st1[1] - st2[1]) - (st1[1] -
st[1]) * (st1[0] - st2[0]);
4464 double denom =
a - 2 *
b + fC;
4467 const double fDen =
a - fC;
4469 return (
float)(
a / fDen);
4475 const double desc_sq =
b *
b -
a * fC;
4476 const double desc =
sqrt(desc_sq < 0.0 ? 0.0 : desc_sq);
4477 const double s = signed_area > 0 ? (-1.0) : 1.0;
4479 return (
float)(((
a -
b) + s * desc) / denom);
4522 const float nearClip,
4523 const float farClip)
4525 float Xdelta, Ydelta, Zdelta;
4529 Zdelta = farClip - nearClip;
4530 if (Xdelta == 0.0f || Ydelta == 0.0f || Zdelta == 0.0f) {
4534 matrix[0][0] = 2.0f / Xdelta;
4535 matrix[3][0] = -(
right +
left) / Xdelta;
4536 matrix[1][1] = 2.0f / Ydelta;
4537 matrix[3][1] = -(
top +
bottom) / Ydelta;
4538 matrix[2][2] = -2.0f / Zdelta;
4539 matrix[3][2] = -(farClip + nearClip) / Zdelta;
4547 const float nearClip,
4548 const float farClip)
4552 const float Zdelta = farClip - nearClip;
4554 if (Xdelta == 0.0f || Ydelta == 0.0f || Zdelta == 0.0f) {
4557 mat[0][0] = nearClip * 2.0f / Xdelta;
4558 mat[1][1] = nearClip * 2.0f / Ydelta;
4561 mat[2][2] = -(farClip + nearClip) / Zdelta;
4563 mat[3][2] = (-2.0f * nearClip * farClip) / Zdelta;
4564 mat[0][1] = mat[0][2] = mat[0][3] = mat[1][0] = mat[1][2] = mat[1][3] = mat[3][0] = mat[3][1] =
4569 const float angle_left,
4570 const float angle_right,
4571 const float angle_up,
4572 const float angle_down,
4573 const float nearClip,
4574 const float farClip)
4576 const float tan_angle_left =
tanf(angle_left);
4577 const float tan_angle_right =
tanf(angle_right);
4578 const float tan_angle_bottom =
tanf(angle_up);
4579 const float tan_angle_top =
tanf(angle_down);
4582 mat, tan_angle_left, tan_angle_right, tan_angle_top, tan_angle_bottom, nearClip, farClip);
4583 mat[0][0] /= nearClip;
4584 mat[1][1] /= nearClip;
4589 if (winmat[2][3] == -1.0f) {
4595 v1[0] = perspmat[0][0];
4596 v1[1] = perspmat[1][0];
4597 v1[2] = perspmat[2][0];
4599 v2[0] = perspmat[0][1];
4600 v2[1] = perspmat[1][1];
4601 v2[2] = perspmat[2][1];
4606 winmat[2][0] -= len1 * winmat[0][0] *
x;
4607 winmat[2][1] -= len2 * winmat[1][1] *
y;
4633 left[i] = mat[i][3] + mat[i][0];
4639 right[i] = mat[i][3] - mat[i][0];
4645 bottom[i] = mat[i][3] + mat[i][1];
4651 top[i] = mat[i][3] - mat[i][1];
4657 near[i] = mat[i][3] + mat[i][2];
4663 far[i] = mat[i][3] - mat[i][2];
4676 const bool is_persp = winmat[3][3] == 0.0f;
4678 const float near = winmat[3][2] / (winmat[2][2] - 1.0f);
4679 *r_left = near * ((winmat[2][0] - 1.0f) / winmat[0][0]);
4680 *r_right = near * ((winmat[2][0] + 1.0f) / winmat[0][0]);
4681 *r_bottom = near * ((winmat[2][1] - 1.0f) / winmat[1][1]);
4682 *r_top = near * ((winmat[2][1] + 1.0f) / winmat[1][1]);
4684 *r_far = winmat[3][2] / (winmat[2][2] + 1.0f);
4687 *r_left = (-winmat[3][0] - 1.0f) / winmat[0][0];
4688 *r_right = (-winmat[3][0] + 1.0f) / winmat[0][0];
4689 *r_bottom = (-winmat[3][1] - 1.0f) / winmat[1][1];
4690 *r_top = (-winmat[3][1] + 1.0f) / winmat[1][1];
4691 *r_near = (winmat[3][2] + 1.0f) / winmat[2][2];
4692 *r_far = (winmat[3][2] - 1.0f) / winmat[2][2];
4704 double winmat[4][4];
4707 const bool is_persp = winmat[3][3] == 0.0f;
4709 const double near = winmat[3][2] / (winmat[2][2] - 1.0);
4710 *r_left = near * ((winmat[2][0] - 1.0) / winmat[0][0]);
4711 *r_right = near * ((winmat[2][0] + 1.0) / winmat[0][0]);
4712 *r_bottom = near * ((winmat[2][1] - 1.0) / winmat[1][1]);
4713 *r_top = near * ((winmat[2][1] + 1.0) / winmat[1][1]);
4715 *r_far = winmat[3][2] / (winmat[2][2] + 1.0);
4718 *r_left = (-winmat[3][0] - 1.0) / winmat[0][0];
4719 *r_right = (-winmat[3][0] + 1.0) / winmat[0][0];
4720 *r_bottom = (-winmat[3][1] - 1.0) / winmat[1][1];
4721 *r_top = (-winmat[3][1] + 1.0) / winmat[1][1];
4722 *r_near = (winmat[3][2] + 1.0) / winmat[2][2];
4723 *r_far = (winmat[3][2] - 1.0) / winmat[2][2];
4728 const int win_size[2],
4733 float r_projmat[4][4])
4745 r_projmat[0][0] *= x_sca;
4746 r_projmat[1][1] *= y_sca;
4748 if (projmat[3][3] == 0.0f) {
4749 r_projmat[2][0] = r_projmat[2][0] * x_sca + x_fac;
4750 r_projmat[2][1] = r_projmat[2][1] * y_sca + y_fac;
4753 r_projmat[3][0] = r_projmat[3][0] * x_sca - x_fac;
4754 r_projmat[3][1] = r_projmat[3][1] * y_sca - y_fac;
4763 for (row = 0; row < 4; row++) {
4765 temp[row][
col] = (icand[row][0] * mat[0][
col] + icand[row][1] * mat[1][
col] +
4766 icand[row][2] * mat[2][
col] + icand[row][3] * mat[3][
col]);
4772 void polarview_m4(
float mat[4][4],
float dist,
float azimuth,
float incidence,
float twist)
4783 float mat[4][4],
float vx,
float vy,
float vz,
float px,
float py,
float pz,
float twist)
4785 float sine, cosine, hyp, hyp1, dx, dy, dz;
4795 hyp = dx * dx + dz * dz;
4796 hyp1 =
sqrtf(dy * dy + hyp);
4801 cosine = hyp / hyp1;
4807 mat1[1][1] = cosine;
4810 mat1[2][2] = cosine;
4814 mat1[1][1] = mat1[2][2] = 1.0f;
4815 mat1[1][2] = mat1[2][1] = 0.0f;
4826 mat1[0][0] = cosine;
4829 mat1[2][2] = cosine;
4837 float mat[4][4], vec[4];
4838 int a, fl, flag = -1;
4842 for (
a = 0;
a < 8;
a++) {
4843 vec[0] = (
a & 1) ? boundbox[0][0] : boundbox[1][0];
4844 vec[1] = (
a & 2) ? boundbox[0][1] : boundbox[1][1];
4845 vec[2] = (
a & 4) ? boundbox[0][2] : boundbox[1][2];
4851 if (vec[0] >
bounds[1] * vec[3]) {
4854 if (vec[0] <
bounds[0] * vec[3]) {
4857 if (vec[1] >
bounds[3] * vec[3]) {
4860 if (vec[1] <
bounds[2] * vec[3]) {
4865 if (vec[0] < -vec[3]) {
4868 if (vec[0] > vec[3]) {
4871 if (vec[1] < -vec[3]) {
4874 if (vec[1] > vec[3]) {
4878 if (vec[2] < -vec[3]) {
4881 if (vec[2] > vec[3]) {
4896 float mn[3], mx[3], vec[3];
4902 for (
a = 0;
a < 8;
a++) {
4903 vec[0] = (
a & 1) ? boundbox[0][0] : boundbox[1][0];
4904 vec[1] = (
a & 2) ? boundbox[0][1] : boundbox[1][1];
4905 vec[2] = (
a & 4) ? boundbox[0][2] : boundbox[1][2];
4917 void map_to_tube(
float *r_u,
float *r_v,
const float x,
const float y,
const float z)
4921 *r_v = (
z + 1.0f) / 2.0f;
4954 const float target[3] = {0.0f, 0.0f, 1.0f};
4965 const float axis[3],
4980 const float f_no[3],
4986 const int nverts = 3;
4999 float *
vn[] = {n1, n2, n3};
5000 const float *prev_edge = vdiffs[nverts - 1];
5003 for (i = 0; i < nverts; i++) {
5004 const float *cur_edge = vdiffs[i];
5009 prev_edge = cur_edge;
5018 const float f_no[3],
5025 const int nverts = (n4 !=
NULL && co4 !=
NULL) ? 4 : 3;
5046 float *
vn[] = {n1, n2, n3, n4};
5047 const float *prev_edge = vdiffs[nverts - 1];
5050 for (i = 0; i < nverts; i++) {
5051 const float *cur_edge = vdiffs[i];
5056 prev_edge = cur_edge;
5062 const float polyno[3],
5063 const float **vertcos,
5070 for (i = 0; i < nverts; i++) {
5071 sub_v3_v3v3(vdiffs[i], vertcos[(i + 1) % nverts], vertcos[i]);
5077 const float *prev_edge = vdiffs[nverts - 1];
5079 for (i = 0; i < nverts; i++) {
5080 const float *cur_edge = vdiffs[i];
5088 prev_edge = cur_edge;
5104 const float s1 = uv2[0] - uv1[0];
5105 const float s2 = uv3[0] - uv1[0];
5106 const float t1 = uv2[1] - uv1[1];
5107 const float t2 = uv3[1] - uv1[1];
5108 float det = (s1 * t2 - s2 * t1);
5112 float tangv[3], ct[3], e1[3], e2[3];
5119 r_tang[0] = (t2 * e1[0] - t1 * e2[0]) * det;
5120 r_tang[1] = (t2 * e1[1] - t1 * e2[1]) * det;
5121 r_tang[2] = (t2 * e1[2] - t1 * e2[2]) * det;
5122 tangv[0] = (s1 * e2[0] - s2 * e1[0]) * det;
5123 tangv[1] = (s1 * e2[1] - s2 * e1[1]) * det;
5124 tangv[2] = (s1 * e2[2] - s2 * e1[2]) * det;
5142 const float (*
pos)[3],
5143 const float *weight,
5144 const float (*rpos)[3],
5145 const float *rweight,
5151 float accu_com[3] = {0.0f, 0.0f, 0.0f}, accu_rcom[3] = {0.0f, 0.0f, 0.0f};
5152 float accu_weight = 0.0f, accu_rweight = 0.0f;
5153 const float eps = 1e-6f;
5170 if (
pos && rpos && (list_size > 0)) {
5172 for (
a = 0;
a < list_size;
a++) {
5178 accu_weight += weight[
a];
5189 accu_rweight += rweight[
a];
5195 if (!weight || !rweight) {
5196 accu_weight = accu_rweight = (
float)list_size;
5199 mul_v3_fl(accu_com, 1.0f / accu_weight);
5200 mul_v3_fl(accu_rcom, 1.0f / accu_rweight);
5207 if (lrot || lscale) {
5211 float m[3][3], mr[3][3], q[3][3], qi[3][3];
5212 float va[3], vb[3], stunt[3];
5214 int i = 0, imax = 15;
5219 for (
a = 0;
a < list_size;
a++) {
5224 m[0][0] += va[0] * vb[0];
5225 m[0][1] += va[0] * vb[1];
5226 m[0][2] += va[0] * vb[2];
5228 m[1][0] += va[1] * vb[0];
5229 m[1][1] += va[1] * vb[1];
5230 m[1][2] += va[1] * vb[2];
5232 m[2][0] += va[2] * vb[0];
5233 m[2][1] += va[2] * vb[1];
5234 m[2][2] += va[2] * vb[2];
5239 mr[0][0] += va[0] * va[0];
5240 mr[0][1] += va[0] * va[1];
5241 mr[0][2] += va[0] * va[2];
5243 mr[1][0] += va[1] * va[0];
5244 mr[1][1] += va[1] * va[1];
5245 mr[1][2] += va[1] * va[2];
5247 mr[2][0] += va[2] * va[0];
5248 mr[2][1] += va[2] * va[1];
5249 mr[2][2] += va[2] * va[2];
5262 while ((odet - ndet) * (odet - ndet) >
eps && i < imax) {
5294 r[0] =
v1[0] + fac * (
v2[0] -
v1[0]);
5295 r[1] =
v1[1] + fac * (
v2[1] -
v1[1]);
5296 r[2] =
v1[2] + fac * (
v2[2] -
v1[2]);
5309 static const float epsilon = 1e-6f;
5337 else if (sd[2] < 0.0f) {
5352 else if (sd[1] < 0.0f) {
5360 else if (sd[2] < 0.0f) {
5383 else if (sd[2] < 0.0f) {
5399 else if (sd[0] < 0.0f) {
5408 else if (sd[2] < 0.0f) {
5423 else if (sd[1] < 0.0f) {
5431 else if (sd[2] < 0.0f) {
5448 else if (sd[2] < 0.0f) {
5467 else if (sd[2] < 0.0f) {
5482 else if (sd[1] < 0.0f) {
5490 else if (sd[2] < 0.0f) {
5507 else if (sd[2] < 0.0f) {
5524 # include <Accelerate/Accelerate.h>
5531 static vFloat vec_splat_float(
float val)
5533 return (vFloat){val, val, val, val};
5536 static float ff_quad_form_factor(
float *p,
float *n,
float *q0,
float *
q1,
float *q2,
float *q3)
5538 vFloat vcos, rlen, vrx, vry, vrz, vsrx, vsry, vsrz, gx, gy, gz, vangle;
5539 vUInt8
rotate = (vUInt8){4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3};
5540 vFloatResult vresult;
5544 vrx = (vFloat){q0[0],
q1[0], q2[0], q3[0]} - vec_splat_float(p[0]);
5545 vry = (vFloat){q0[1],
q1[1], q2[1], q3[1]} - vec_splat_float(p[1]);
5546 vrz = (vFloat){q0[2],
q1[2], q2[2], q3[2]} - vec_splat_float(p[2]);
5549 rlen = vec_rsqrte(vrx * vrx + vry * vry + vrz * vrz + vec_splat_float(1e-16f));
5555 vsrx = vec_perm(vrx, vrx,
rotate);
5556 vsry = vec_perm(vry, vry,
rotate);
5557 vsrz = vec_perm(vrz, vrz,
rotate);
5560 gx = vsry * vrz - vsrz * vry;
5561 gy = vsrz * vrx - vsrx * vrz;
5562 gz = vsrx * vry - vsry * vrx;
5565 rlen = vec_rsqrte(gx * gx + gy * gy + gz * gz + vec_splat_float(1e-16f));
5571 vcos = vrx * vsrx + vry * vsry + vrz * vsrz;
5572 vcos = vec_max(vec_min(vcos, vec_splat_float(1.0f)), vec_splat_float(-1.0f));
5573 vangle = vacosf(vcos);
5576 vresult.v = (vec_splat_float(n[0]) * gx + vec_splat_float(n[1]) * gy +
5577 vec_splat_float(n[2]) * gz) *
5580 result = (vresult.f[0] + vresult.f[1] + vresult.f[2] + vresult.f[3]) * (0.5f / (
float)
M_PI);
5594 static __m128 sse_approx_acos(__m128
x)
5600 return _mm_set_ps1(1.0f);
5603 static float ff_quad_form_factor(
float *p,
float *n,
float *q0,
float *
q1,
float *q2,
float *q3)
5605 float r0[3], r1[3], r2[3], r3[3], g0[3], g1[3], g2[3], g3[3];
5606 float a1, a2, a3, a4, dot1, dot2,
dot3, dot4,
result;
5608 __m128 qx, qy, qz, rx, ry, rz, rlen, srx, sry, srz, gx, gy, gz, glen, rcos,
angle, aresult;
5611 qx = _mm_set_ps(q3[0], q2[0],
q1[0], q0[0]);
5612 qy = _mm_set_ps(q3[1], q2[1],
q1[1], q0[1]);
5613 qz = _mm_set_ps(q3[2], q2[2],
q1[2], q0[2]);
5615 rx = qx - _mm_set_ps1(p[0]);
5616 ry = qy - _mm_set_ps1(p[1]);
5617 rz = qz - _mm_set_ps1(p[2]);
5620 rlen = _mm_rsqrt_ps(rx * rx + ry * ry + rz * rz + _mm_set_ps1(1e-16f));
5626 srx = _mm_shuffle_ps(rx, rx, _MM_SHUFFLE(0, 3, 2, 1));
5627 sry = _mm_shuffle_ps(ry, ry, _MM_SHUFFLE(0, 3, 2, 1));
5628 srz = _mm_shuffle_ps(rz, rz, _MM_SHUFFLE(0, 3, 2, 1));
5630 gx = sry * rz - srz * ry;
5631 gy = srz * rx - srx * rz;
5632 gz = srx * ry - sry * rx;
5635 glen = _mm_rsqrt_ps(gx * gx + gy * gy + gz * gz + _mm_set_ps1(1e-16f));
5641 rcos = rx * srx + ry * sry + rz * srz;
5642 rcos = _mm_max_ps(_mm_min_ps(rcos, _mm_set_ps1(1.0f)), _mm_set_ps1(-1.0f));
5644 angle = sse_approx_cos(rcos);
5645 aresult = (_mm_set_ps1(n[0]) * gx + _mm_set_ps1(n[1]) * gy + _mm_set_ps1(n[2]) * gz) *
angle;
5648 result = (fresult[0] + fresult[1] + fresult[2] + fresult[3]) * (0.5f / (
float)
M_PI);
5663 d = 1.0f /
sqrtf(d);
5678 float r0[3], r1[3], r2[3], r3[3], g0[3], g1[3], g2[3], g3[3];
5679 float a1, a2, a3, a4, dot1, dot2,
dot3, dot4,
result;
5710 result = (a1 * dot1 + a2 * dot2 + a3 *
dot3 + a4 * dot4) * 0.5f / (
float)
M_PI;
5717 float p[3],
float n[3],
float v1[3],
float v2[3],
float v3[3],
float v4[3])
5721 float q0[3],
q1[3], q2[3], q3[3], contrib = 0.0f;
5736 const float f1_no[3],
5737 const float f2_no[3])
5765 float v13[3], v24[3];
5777 const float *quad_coords[4] = {
v1,
v2, v3, v4};
5778 float quad_proj[4][3];
5780 for (
int i = 0; i < 4; i++) {
5784 float quad_dirs[4][3];
5785 for (
int i = 0, j = 3; i < 4; j = i++) {
5786 sub_v3_v3v3(quad_dirs[i], quad_proj[i], quad_proj[j]);
5791 #define CROSS_SIGN(dir_a, dir_b) \
5792 ((void)cross_v3_v3v3(test_dir, dir_a, dir_b), (dot_v3v3(plane, test_dir) > 0.0f))
5808 unsigned int sign_flag = 0;
5810 const float *co_curr, *co_prev;
5811 float dir_curr[2], dir_prev[2];
5813 co_prev =
verts[nr - 1];
5818 for (
a = 0;
a < nr;
a++) {
5828 else if (
cross > 0.0f) {
5832 if (sign_flag == (1 | 2)) {
5847 float d_12[3], d_23[3], d_34[3], d_41[3];
5848 float cross_a[3], cross_b[3];
5858 ret |= ((
dot_v3v3(cross_a, cross_b) < 0.0f) << 0);
5862 ret |= ((
dot_v3v3(cross_a, cross_b) < 0.0f) << 1);
5872 float d_12[3], d_13[3], d_14[3];
5873 float cross_a[3], cross_b[3];
5879 return dot_v3v3(cross_a, cross_b) > 0.0f;
5888 float dir_v3v1[3], tangent[3];
5901 const float eps = 1e-5f;
5903 const float tan_dot =
dot_v3v3(tan_l, tan_r);
5904 if (tan_dot > 1.0f -
eps) {
5906 return (1.0f / 3.0f) * 0.75f;
5908 if (tan_dot < -1.0f +
eps) {
5910 return (1.0f / 2.0f);
5919 return ((1.0f - angle_cos) / (angle_sin * 2.0f)) / angle_sin;
5923 const float v0[3],
const float v1[3],
const float v2[3],
const float dist1,
const float dist2)
5926 float v10[3], v12[3];
5930 if (dist1 != 0.0f && dist2 != 0.0f) {
5932 float u[3],
v[3], n[3];
5935 if (d12 * d12 > 0.0f) {
5945 const float a = 0.5f * (1.0f + (dist1 * dist1 - dist2 * dist2) / (d12 * d12));
5946 const float hh = dist1 * dist1 -
a *
a * d12 * d12;
5949 const float h =
sqrtf(hh);
5950 const float S_[2] = {
a * d12, -h};
5954 const float x_intercept = S_[0] + h * (v0_[0] - S_[0]) / (v0_[1] + h);
5955 if (x_intercept >= 0.0f && x_intercept <= d12) {
typedef float(TangentPoint)[2]
MINLINE float saacos(float fac)
MINLINE float max_ff(float a, float b)
MINLINE float min_ffff(float a, float b, float c, float d)
#define BLI_ASSERT_UNIT_EPSILON
MINLINE float min_ff(float a, float b)
MINLINE float saacosf(float f)
MINLINE float square_f(float a)
#define BLI_ASSERT_UNIT_V3(v)
MINLINE int float_as_int(float f)
MINLINE float xor_fl(float x, int y)
bool isect_ray_tri_threshold_v3(const float ray_origin[3], const float ray_direction[3], const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2], float threshold)
MINLINE float area_tri_v2(const float v1[2], const float v2[2], const float v3[2])
#define ISECT_AABB_PLANE_IN_FRONT_ALL
MINLINE int axis_dominant_v3_single(const float vec[3])
MINLINE float cross_tri_v2(const float v1[2], const float v2[2], const float v3[2])
#define ISECT_LINE_LINE_NONE
MINLINE float plane_point_side_v3(const float plane[4], const float co[3])
#define ISECT_AABB_PLANE_CROSS_ANY
#define ISECT_AABB_PLANE_BEHIND_ANY
#define ISECT_LINE_LINE_COLINEAR
#define ISECT_LINE_LINE_EXACT
MINLINE void axis_dominant_v3(int *r_axis_a, int *r_axis_b, const float axis[3])
#define ISECT_LINE_LINE_CROSS
bool is_negative_m3(const float mat[3][3])
void mul_m4_v4(const float M[4][4], float r[4])
void copy_m3_m3(float m1[3][3], const float m2[3][3])
void unit_m3(float m[3][3])
void transpose_m4_m4(float R[4][4], const float M[4][4])
void mul_m3_fl(float R[3][3], float f)
void unit_m4(float m[4][4])
void add_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
void translate_m4(float mat[4][4], float tx, float ty, float tz)
void zero_m3(float m[3][3])
void copy_m4d_m4(double m1[4][4], const float m2[4][4])
void mul_m4_v3(const float M[4][4], float r[3])
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])
float determinant_m3_array(const float m[3][3])
void rotate_m4(float mat[4][4], char axis, float angle)
void mul_v3_m3v3(float r[3], const float M[3][3], const float a[3])
void transpose_m3(float R[3][3])
float determinant_m3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3)
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
void axis_angle_to_mat4_single(float R[4][4], char axis, float angle)
MINLINE void sub_v3db_v3fl_v3fl(double r[3], const float a[3], const float b[3])
MINLINE void mul_v4_fl(float r[4], float f)
MINLINE float len_squared_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_squared_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3])
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE float len_squared_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE double dot_v2v2_db(const double a[2], const double b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void madd_v2_v2fl(float r[2], const float a[2], float f)
MINLINE void madd_v2_v2v2fl(float r[2], const float a[2], const float b[2], float f)
MINLINE float normalize_v3(float r[3])
void interp_v3_v3v3v3(float p[3], const float v1[3], const float v2[3], const float v3[3], const float w[3])
MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE double dot_v3db_v3fl(const double a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_newell_cross_v3_v3v3(float n[3], const float v_prev[3], const float v_curr[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
void interp_v2_v2v2(float r[2], const float a[2], const float b[2], float t)
MINLINE void copy_v2_v2(float r[2], const float a[2])
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])
void project_v3_v3v3_normalized(float out[3], const float p[3], const float v_proj[3])
MINLINE bool is_zero_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
void project_v3_v3v3(float out[3], const float p[3], const float v_proj[3])
void project_plane_v3_v3v3(float out[3], const float p[3], const float v_plane[3])
bool is_finite_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
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
void rotate_normalized_v3_v3v3fl(float out[3], const float p[3], const float axis[3], float angle)
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE bool equals_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void negate_v3(float r[3])
MINLINE float dot_m3_v3_row_z(const float M[3][3], const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float cross_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v4(float r[4])
MINLINE float normalize_v3_v3(float r[3], const float a[3])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE float line_point_side_v2(const float l1[2], const float l2[2], const float pt[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v2(float r[2])
bool is_finite_v4(const float a[4]) ATTR_WARN_UNUSED_RESULT
MINLINE float mul_project_m4_v3_zfac(const float mat[4][4], const float co[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void cross_v3_v3v3_db(double r[3], const double a[3], const double b[3])
MINLINE float dot_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE bool equals_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void ortho_basis_v3v3_v3(float r_n1[3], float r_n2[3], const float n[3])
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
MINLINE float len_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_v2(const float a[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v3(float r[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void mul_v2_v2fl(float r[2], const float a[2], float f)
float angle_normalized_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float dot_m4_v3_row_x(const float M[4][4], const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE void copy_v4_fl(float r[4], float f)
MINLINE float dot_m4_v3_row_y(const float M[4][4], const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE double cross_v2v2_db(const double a[2], const double b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v2_v2v2_db(double r[2], const double a[2], const double b[2])
Strict compiler flags for areas of code we want to ensure don't do conversions without us knowing abo...
#define IN_RANGE(a, b, c)
#define IN_RANGE_INCL(a, b, c)
int rect_width(int rect[2][2])
int rect_height(int rect[2][2])
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 y1
_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 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 vn
_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 x2
_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 right
_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 top
_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 const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
_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 bottom
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
struct AtomicSpinLock __attribute__((aligned(32))) AtomicSpinLock
__forceinline void dot3(const avxf &a, const avxf &b, float &den, float &den2)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
btScalar determinant() const
Return the determinant of the matrix.
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.
SIMD_FORCE_INLINE btVector3 rotate(const btVector3 &wAxis, const btScalar angle) const
Return a rotated version of this vector.
bool closest(btVector3 &v)
IconTextureDrawCall normal
ccl_gpu_kernel_postfix ccl_global float int int int int float threshold
ccl_gpu_kernel_postfix ccl_global float int int sy
ccl_gpu_kernel_postfix ccl_global float int sx
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
ccl_device_inline float2 fabs(const float2 &a)
void map_to_sphere(float *r_u, float *r_v, const float x, const float y, const float z)
bool isect_point_poly_v2_int(const int pt[2], const int verts[][2], const unsigned int nr, const bool UNUSED(use_holes))
int isect_seg_seg_v2(const float v1[2], const float v2[2], const float v3[2], const float v4[2])
static void ff_normalize(float n[3])
float dist_signed_squared_to_plane3_v3(const float pt[3], const float plane[3])
void plane_from_point_normal_v3(float r_plane[4], const float plane_co[3], const float plane_no[3])
bool isect_ray_ray_v3(const float ray_origin_a[3], const float ray_direction_a[3], const float ray_origin_b[3], const float ray_direction_b[3], float *r_lambda_a, float *r_lambda_b)
float closest_to_ray_v3(float r_close[3], const float p[3], const float ray_orig[3], const float ray_dir[3])
void isect_ray_tri_watertight_v3_precalc(struct IsectRayPrecalc *isect_precalc, const float ray_direction[3])
void window_translate_m4(float winmat[4][4], float perspmat[4][4], const float x, const float y)
float closest_seg_seg_v2(float r_closest_a[2], float r_closest_b[2], float *r_lambda_a, float *r_lambda_b, const float a1[2], const float a2[2], const float b1[2], const float b2[2])
float dist_squared_to_line_v3(const float p[3], const float l1[3], const float l2[3])
float dist_squared_to_line_segment_v3(const float p[3], const float l1[3], const float l2[3])
float area_squared_poly_v2(const float verts[][2], unsigned int nr)
float dist_squared_to_projected_aabb(struct DistProjectedAABBPrecalc *data, const float bbmin[3], const float bbmax[3], bool r_axis_closest[3])
float normal_quad_v3(float n[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3])
int isect_line_line_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3], float r_i1[3], float r_i2[3])
float line_point_factor_v2_ex(const float p[2], const float l1[2], const float l2[2], const float epsilon, const float fallback)
void orthographic_m4(float matrix[4][4], const float left, const float right, const float bottom, const float top, const float nearClip, const float farClip)
static bool getLowestRoot(const float a, const float b, const float c, const float maxR, float *root)
bool isect_ray_line_v3(const float ray_origin[3], const float ray_direction[3], const float v0[3], const float v1[3], float *r_lambda)
int barycentric_inside_triangle_v2(const float w[3])
int is_quad_flip_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3])
static double mean_value_half_tan_v2_db(const struct Double2_Len *d_curr, const struct Double2_Len *d_next)
void transform_point_by_seg_v3(float p_dst[3], const float p_src[3], const float l_dst_p1[3], const float l_dst_p2[3], const float l_src_p1[3], const float l_src_p2[3])
bool isect_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], const float radius, const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float ipoint[3])
bool isect_ray_tri_v3(const float ray_origin[3], const float ray_direction[3], const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2])
float area_poly_v3(const float verts[][3], unsigned int nr)
void barycentric_weights_v2(const float v1[2], const float v2[2], const float v3[2], const float co[2], float w[3])
void accumulate_vertex_normals_tri_v3(float n1[3], float n2[3], float n3[3], const float f_no[3], const float co1[3], const float co2[3], const float co3[3])
float closest_to_line_segment_v3(float r_close[3], const float p[3], const float l1[3], const float l2[3])
float ray_point_factor_v3(const float p[3], const float ray_origin[3], const float ray_direction[3])
float dist_to_plane_v3(const float pt[3], const float plane[4])
void barycentric_weights_v2_clamped(const float v1[2], const float v2[2], const float v3[2], const float co[2], float w[3])
void isect_seg_seg_v3(const float a0[3], const float a1[3], const float b0[3], const float b1[3], float r_a[3], float r_b[3])
float form_factor_quad(const float p[3], const float n[3], const float q0[3], const float q1[3], const float q2[3], const float q3[3])
double closest_to_line_v2_db(double r_close[2], const double p[2], const double l1[2], const double l2[2])
bool isect_line_segment_tri_epsilon_v3(const float p1[3], const float p2[3], const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2], const float epsilon)
void cross_tri_v3(float n[3], const float v1[3], const float v2[3], const float v3[3])
bool point_in_slice_seg(float p[3], float l1[3], float l2[3])
bool isect_tri_tri_v2(const float t_a0[2], const float t_a1[2], const float t_a2[2], const float t_b0[2], const float t_b1[2], const float t_b2[2])
void transform_point_by_tri_v3(float pt_tar[3], float const pt_src[3], const float tri_tar_p1[3], const float tri_tar_p2[3], const float tri_tar_p3[3], const float tri_src_p1[3], const float tri_src_p2[3], const float tri_src_p3[3])
void polarview_m4(float mat[4][4], float dist, float azimuth, float incidence, float twist)
int isect_seg_seg_v2_lambda_mu_db(const double v1[2], const double v2[2], const double v3[2], const double v4[2], double *r_lambda, double *r_mu)
void interp_weights_quad_v3(float w[4], const float v1[3], const float v2[3], const float v3[3], const float v4[3], const float co[3])
float area_tri_signed_v3(const float v1[3], const float v2[3], const float v3[3], const float normal[3])
float volume_tri_tetrahedron_signed_v3_6x(const float v1[3], const float v2[3], const float v3[3])
void closest_to_plane3_normalized_v3(float r_close[3], const float plane[3], const float pt[3])
bool isect_seg_seg_v2_simple(const float v1[2], const float v2[2], const float v3[2], const float v4[2])
float dist_to_plane3_v3(const float pt[3], const float plane[3])
#define DIR_V3_SET(d_len, va, vb)
void closest_to_plane_normalized_v3(float r_close[3], const float plane[4], const float pt[3])
int isect_point_tri_v2_int(const int x1, const int y1, const int x2, const int y2, const int a, const int b)
bool isect_point_tri_v3(const float p[3], const float v1[3], const float v2[3], const float v3[3], float r_isect_co[3])
void interp_weights_tri_v3(float w[3], const float v1[3], const float v2[3], const float v3[3], const float co[3])
void resolve_tri_uv_v2(float r_uv[2], const float st[2], const float st0[2], const float st1[2], const float st2[2])
float line_point_factor_v3_ex(const float p[3], const float l1[3], const float l2[3], const float epsilon, const float fallback)
float dist_signed_to_plane_v3(const float pt[3], const float plane[4])
bool isect_ray_aabb_v3(const struct IsectRayAABB_Precalc *data, const float bb_min[3], const float bb_max[3], float *tmin_out)
bool isect_ray_aabb_v3_simple(const float orig[3], const float dir[3], const float bb_min[3], const float bb_max[3], float *tmin, float *tmax)
float dist_to_line_segment_v3(const float p[3], const float l1[3], const float l2[3])
static float mean_value_half_tan_v3(const struct Float3_Len *d_curr, const struct Float3_Len *d_next)
bool isect_aabb_aabb_v3(const float min1[3], const float max1[3], const float min2[3], const float max2[3])
float area_squared_poly_v3(const float verts[][3], unsigned int nr)
void vcloud_estimate_transform_v3(const int list_size, const float(*pos)[3], const float *weight, const float(*rpos)[3], const float *rweight, float lloc[3], float rloc[3], float lrot[3][3], float lscale[3][3])
static void i_multmatrix(const float icand[4][4], float mat[4][4])
void dist_squared_ray_to_aabb_v3_precalc(struct DistRayAABB_Precalc *neasrest_precalc, const float ray_origin[3], const float ray_direction[3])
void projmat_from_subregion(const float projmat[4][4], const int win_size[2], const int x_min, const int x_max, const int y_min, const int y_max, float r_projmat[4][4])
bool isect_point_poly_v2(const float pt[2], const float verts[][2], const unsigned int nr, const bool UNUSED(use_holes))
float volume_tri_tetrahedron_signed_v3(const float v1[3], const float v2[3], const float v3[3])
float dist_signed_to_plane3_v3(const float pt[3], const float plane[3])
void cross_poly_v3(float n[3], const float verts[][3], unsigned int nr)
bool isect_line_plane_v3(float r_isect_co[3], const float l1[3], const float l2[3], const float plane_co[3], const float plane_no[3])
bool isect_ray_seg_v2(const float ray_origin[2], const float ray_direction[2], const float v0[2], const float v1[2], float *r_lambda, float *r_u)
float dist_squared_to_projected_aabb_simple(const float projmat[4][4], const float winsize[2], const float mval[2], const float bbmin[3], const float bbmax[3])
void accumulate_vertex_normals_poly_v3(float **vertnos, const float polyno[3], const float **vertcos, float vdiffs[][3], const int nverts)
bool is_quad_flip_v3_first_third_fast_with_normal(const float v1[3], const float v2[3], const float v3[3], const float v4[3], const float normal[3])
int isect_point_quad_v2(const float pt[2], const float v1[2], const float v2[2], const float v3[2], const float v4[2])
float dist_squared_ray_to_aabb_v3_simple(const float ray_origin[3], const float ray_direction[3], const float bb_min[3], const float bb_max[3], float r_point[3], float *r_depth)
static bool point_in_slice(const float p[3], const float v1[3], const float l1[3], const float l2[3])
bool is_quad_flip_v3_first_third_fast(const float v1[3], const float v2[3], const float v3[3], const float v4[3])
#define DIR_V2_SET(d_len, va, vb)
#define MEAN_VALUE_HALF_TAN_V2(_area, i1, i2)
float form_factor_hemi_poly(float p[3], float n[3], float v1[3], float v2[3], float v3[3], float v4[3])
bool clip_segment_v3_plane(const float p1[3], const float p2[3], const float plane[4], float r_p1[3], float r_p2[3])
void closest_to_plane3_v3(float r_close[3], const float plane[3], const float pt[3])
bool isect_plane_plane_plane_v3(const float plane_a[4], const float plane_b[4], const float plane_c[4], float r_isect_co[3])
void interp_weights_poly_v2(float *w, float v[][2], const int n, const float co[2])
void resolve_quad_uv_v2(float r_uv[2], const float st[2], const float st0[2], const float st1[2], const float st2[2], const float st3[2])
float line_point_factor_v2(const float p[2], const float l1[2], const float l2[2])
void projmat_dimensions_db(const float winmat_fl[4][4], double *r_left, double *r_right, double *r_bottom, double *r_top, double *r_near, double *r_far)
bool isect_ray_tri_watertight_v3_simple(const float ray_origin[3], const float ray_direction[3], const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2])
void closest_on_tri_to_point_v3(float r[3], const float p[3], const float v1[3], const float v2[3], const float v3[3])
void tangent_from_uv_v3(const float uv1[2], const float uv2[2], const float uv3[2], const float co1[3], const float co2[3], const float co3[3], const float n[3], float r_tang[3])
static void vec_add_dir(float r[3], const float v1[3], const float v2[3], const float fac)
void perspective_m4(float mat[4][4], const float left, const float right, const float bottom, const float top, const float nearClip, const float farClip)
static bool isect_tri_tri_v2_impl_vert(const float t_a0[2], const float t_a1[2], const float t_a2[2], const float t_b0[2], const float t_b1[2], const float t_b2[2])
void lookat_m4(float mat[4][4], float vx, float vy, float vz, float px, float py, float pz, float twist)
void axis_dominant_v3_to_m3_negate(float r_mat[3][3], const float normal[3])
static bool barycentric_weights(const float v1[3], const float v2[3], const float v3[3], const float co[3], const float n[3], float w[3])
void accumulate_vertex_normals_v3(float n1[3], float n2[3], float n3[3], float n4[3], const float f_no[3], const float co1[3], const float co2[3], const float co3[3], const float co4[3])
bool isect_tri_tri_v3(const float t_a0[3], const float t_a1[3], const float t_a2[3], const float t_b0[3], const float t_b1[3], const float t_b2[3], float r_i1[3], float r_i2[3])
float line_plane_factor_v3(const float plane_co[3], const float plane_no[3], const float l1[3], const float l2[3])
static int isect_tri_tri_impl_ccw_v2(const float t_a0[2], const float t_a1[2], const float t_a2[2], const float t_b0[2], const float t_b1[2], const float t_b2[2])
void dist_squared_to_projected_aabb_precalc(struct DistProjectedAABBPrecalc *precalc, const float projmat[4][4], const float winsize[2], const float mval[2])
void aabb_get_near_far_from_plane(const float plane_no[3], const float bbmin[3], const float bbmax[3], float bb_near[3], float bb_afar[3])
float dist_seg_seg_v2(const float a1[3], const float a2[3], const float b1[3], const float b2[3])
float dist_squared_to_plane_v3(const float pt[3], const float plane[4])
void resolve_tri_uv_v3(float r_uv[2], const float st[3], const float st0[3], const float st1[3], const float st2[3])
void isect_ray_aabb_v3_precalc(struct IsectRayAABB_Precalc *data, const float ray_origin[3], const float ray_direction[3])
bool isect_plane_plane_v3(const float plane_a[4], const float plane_b[4], float r_isect_co[3], float r_isect_no[3])
float area_tri_v3(const float v1[3], const float v2[3], const float v3[3])
bool isect_point_tri_v2_cw(const float pt[2], const float v1[2], const float v2[2], const float v3[2])
float area_poly_signed_v2(const float verts[][2], unsigned int nr)
bool isect_ray_tri_watertight_v3(const float ray_origin[3], const struct IsectRayPrecalc *isect_precalc, const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2])
int isect_line_sphere_v3(const float l1[3], const float l2[3], const float sp[3], const float r, float r_p1[3], float r_p2[3])
bool is_quad_convex_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3])
bool is_edge_convex_v3(const float v1[3], const float v2[3], const float f1_no[3], const float f2_no[3])
float resolve_quad_u_v2(const float st[2], const float st0[2], const float st1[2], const float st2[2], const float st3[2])
float dist_signed_squared_to_plane_v3(const float pt[3], const float plane[4])
void axis_dominant_v3_to_m3(float r_mat[3][3], const float normal[3])
Normal to x,y matrix.
void interp_barycentric_tri_v3(float data[3][3], float u, float v, float res[3])
float volume_tetrahedron_signed_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3])
void perspective_m4_fov(float mat[4][4], const float angle_left, const float angle_right, const float angle_up, const float angle_down, const float nearClip, const float farClip)
float closest_to_line_segment_v2(float r_close[2], const float p[2], const float l1[2], const float l2[2])
static bool point_in_slice_as(const float p[3], const float origin[3], const float normal[3])
bool isect_line_line_strict_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3], float vi[3], float *r_lambda)
void interp_cubic_v3(float x[3], float v[3], const float x1[3], const float v1[3], const float x2[3], const float v2[3], const float t)
static bool isect_tri_tri_v2_impl_edge(const float t_a0[2], const float t_a1[2], const float t_a2[2], const float t_b0[2], const float t_b1[2], const float t_b2[2])
float area_squared_tri_v3(const float v1[3], const float v2[3], const float v3[3])
bool isect_tri_tri_v3_ex(const float tri_a[3][3], const float tri_b[3][3], float r_i1[3], float r_i2[3], int *r_tri_a_edge_isect_count)
float dist_squared_ray_to_seg_v3(const float ray_origin[3], const float ray_direction[3], const float v0[3], const float v1[3], float r_point[3], float *r_depth)
float dist_squared_ray_to_aabb_v3(const struct DistRayAABB_Precalc *data, const float bb_min[3], const float bb_max[3], float r_point[3], float *r_depth)
void barycentric_weights_v2_quad(const float v1[2], const float v2[2], const float v3[2], const float v4[2], const float co[2], float w[4])
int isect_line_sphere_v2(const float l1[2], const float l2[2], const float sp[2], const float r, float r_p1[2], float r_p2[2])
float geodesic_distance_propagate_across_triangle(const float v0[3], const float v1[3], const float v2[3], const float dist1, const float dist2)
int box_clip_bounds_m4(float boundbox[2][3], const float bounds[4], float winmat[4][4])
bool isect_planes_v3_fn(const float planes[][4], const int planes_len, const float eps_coplanar, const float eps_isect, void(*callback_fn)(const float co[3], int i, int j, int k, void *user_data), void *user_data)
float cubic_tangent_factor_circle_v3(const float tan_l[3], const float tan_r[3])
float line_point_factor_v3(const float p[3], const float l1[3], const float l2[3])
float dist_squared_to_ray_v3_normalized(const float ray_origin[3], const float ray_direction[3], const float co[3])
float area_squared_quad_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3])
void limit_dist_v3(float v1[3], float v2[3], const float dist)
bool barycentric_coords_v2(const float v1[2], const float v2[2], const float v3[2], const float co[2], float w[3])
bool clip_segment_v3_plane_n(const float p1[3], const float p2[3], const float plane_array[][4], const int plane_num, float r_p1[3], float r_p2[3])
int isect_line_line_v2_point(const float v0[2], const float v1[2], const float v2[2], const float v3[2], float r_vi[2])
void closest_to_plane_v3(float r_close[3], const float plane[4], const float pt[3])
void plane_to_point_vector_v3(const float plane[4], float r_plane_co[3], float r_plane_no[3])
int isect_seg_seg_v2_point_ex(const float v0[2], const float v1[2], const float v2[2], const float v3[2], const float endpoint_bias, float r_vi[2])
float cross_poly_v2(const float verts[][2], unsigned int nr)
float closest_to_line_v2(float r_close[2], const float p[2], const float l1[2], const float l2[2])
float dist_to_line_segment_v2(const float p[2], const float l1[2], const float l2[2])
#define CROSS_SIGN(dir_a, dir_b)
void map_to_tube(float *r_u, float *r_v, const float x, const float y, const float z)
float closest_to_line_v3(float r_close[3], const float p[3], const float l1[3], const float l2[3])
void projmat_dimensions(const float winmat[4][4], float *r_left, float *r_right, float *r_bottom, float *r_top, float *r_near, float *r_far)
void map_to_plane_v2_v3v3(float r_co[2], const float co[3], const float no[3])
bool is_quad_convex_v2(const float v1[2], const float v2[2], const float v3[2], const float v4[2])
float cotangent_tri_weight_v3(const float v1[3], const float v2[3], const float v3[3])
void resolve_quad_uv_v2_deriv(float r_uv[2], float r_deriv[2][2], const float st[2], const float st0[2], const float st1[2], const float st2[2], const float st3[2])
bool isect_ray_ray_epsilon_v3(const float ray_origin_a[3], const float ray_direction_a[3], const float ray_origin_b[3], const float ray_direction_b[3], const float epsilon, float *r_lambda_a, float *r_lambda_b)
void barycentric_weights_v2_persp(const float v1[4], const float v2[4], const float v3[4], const float co[2], float w[3])
float dist_to_line_v3(const float p[3], const float l1[3], const float l2[3])
float ray_point_factor_v3_ex(const float p[3], const float ray_origin[3], const float ray_direction[3], const float epsilon, const float fallback)
static float tri_signed_area(const float v1[3], const float v2[3], const float v3[3], const int i, const int j)
int interp_sparse_array(float *array, const int list_size, const float skipval)
bool isect_ray_tri_epsilon_v3(const float ray_origin[3], const float ray_direction[3], const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2], const float epsilon)
float dist_squared_to_line_v2(const float p[2], const float l1[2], const float l2[2])
int isect_line_line_epsilon_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3], float r_i1[3], float r_i2[3], const float epsilon)
bool form_factor_visible_quad(const float p[3], const float n[3], const float v0[3], const float v1[3], const float v2[3], float q0[3], float q1[3], float q2[3], float q3[3])
int isect_seg_seg_v2_int(const int v1[2], const int v2[2], const int v3[2], const int v4[2])
float normal_poly_v3(float n[3], const float verts[][3], unsigned int nr)
int isect_point_tri_v2(const float pt[2], const float v1[2], const float v2[2], const float v3[2])
bool is_poly_convex_v2(const float verts[][2], unsigned int nr)
int isect_seg_seg_v2_point(const float v0[2], const float v1[2], const float v2[2], const float v3[2], float r_vi[2])
float normal_tri_v3(float n[3], const float v1[3], const float v2[3], const float v3[3])
bool isect_axial_line_segment_tri_v3(const int axis, const float p1[3], const float p2[3], const float v0[3], const float v1[3], const float v2[3], float *r_lambda)
bool isect_line_segment_tri_v3(const float p1[3], const float p2[3], const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2])
float area_quad_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3])
float area_poly_v2(const float verts[][2], unsigned int nr)
void interp_weights_poly_v3(float *w, float v[][3], const int n, const float co[3])
float dist_to_line_v2(const float p[2], const float l1[2], const float l2[2])
void plane_to_point_vector_v3_normalized(const float plane[4], float r_plane_co[3], float r_plane_no[3])
int isect_aabb_planes_v3(const float(*planes)[4], const int totplane, const float bbmin[3], const float bbmax[3])
float dist_squared_to_plane3_v3(const float pt[3], const float plane[3])
void interp_bilinear_quad_v3(float data[4][3], float u, float v, float res[3])
bool isect_point_planes_v3_negated(const float(*planes)[4], const int totplane, const float p[3])
void planes_from_projmat(const float mat[4][4], float left[4], float right[4], float bottom[4], float top[4], float near[4], float far[4])
bool isect_point_tri_prism_v3(const float p[3], const float v1[3], const float v2[3], const float v3[3])
void map_to_plane_axis_angle_v2_v3v3fl(float r_co[2], const float co[3], const float axis[3], const float angle)
bool isect_ray_plane_v3(const float ray_origin[3], const float ray_direction[3], const float plane[4], float *r_lambda, const bool clip)
float volume_tetrahedron_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3])
float dist_squared_to_line_segment_v2(const float p[2], const float l1[2], const float l2[2])
void box_minmax_bounds_m4(float min[3], float max[3], float boundbox[2][3], float mat[4][4])
bool isect_point_planes_v3(float(*planes)[4], int totplane, const float p[3])
float dist_signed_squared_to_corner_v3v3v3(const float p[3], const float v1[3], const float v2[3], const float v3[3], const float axis_ref[3])
Intersection< segment > intersection
static void area(int d1, int d2, int e1, int e2, float weights[2])
T dot(const vec_base< T, Size > &a, const vec_base< T, Size > &b)
vec_base< T, 3 > cross(const vec_base< T, 3 > &a, const vec_base< T, 3 > &b)
T length(const vec_base< T, Size > &a)
static const pxr::TfToken st("st", pxr::TfToken::Immortal)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
ccl_device_inline float xor_signmask(float x, int y)