Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/node_add.c
| Show First 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | static bool add_reroute_intersect_check(bNodeLink *link, | ||||
| int tot, | int tot, | ||||
| float result[2]) | float result[2]) | ||||
| { | { | ||||
| float coord_array[NODE_LINK_RESOL + 1][2]; | float coord_array[NODE_LINK_RESOL + 1][2]; | ||||
| if (node_link_bezier_points(NULL, NULL, link, coord_array, NODE_LINK_RESOL)) { | if (node_link_bezier_points(NULL, NULL, link, coord_array, NODE_LINK_RESOL)) { | ||||
| for (int i = 0; i < tot - 1; i++) { | for (int i = 0; i < tot - 1; i++) { | ||||
| for (int b = 0; b < NODE_LINK_RESOL; b++) { | for (int b = 0; b < NODE_LINK_RESOL; b++) { | ||||
| if (isect_seg_seg_v2(mcoords[i], mcoords[i + 1], coord_array[b], coord_array[b + 1]) > 0) { | if (isect_seg_seg_v2_point( | ||||
| result[0] = (mcoords[i][0] + mcoords[i + 1][0]) / 2.0f; | mcoords[i], mcoords[i + 1], coord_array[b], coord_array[b + 1], result) > 0) { | ||||
| result[1] = (mcoords[i][1] + mcoords[i + 1][1]) / 2.0f; | |||||
| return true; | return true; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 452 Lines • Show Last 20 Lines | |||||