|
Blender V4.3
|
Go to the source code of this file.
Classes | |
| struct | DistRayAABB_Precalc |
| struct | DistProjectedAABBPrecalc |
| struct | IsectRayPrecalc |
| struct | IsectRayAABB_Precalc |
Functions | |
Polygons | |
| float | normal_tri_v3 (float n[3], const float v1[3], const float v2[3], const float v3[3]) |
| float | normal_quad_v3 (float n[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3]) |
| float | normal_poly_v3 (float n[3], const float verts[][3], unsigned int nr) |
| MINLINE float | area_tri_v2 (const float v1[2], const float v2[2], const float v3[2]) |
| MINLINE float | area_squared_tri_v2 (const float v1[2], const float v2[2], const float v3[2]) |
| MINLINE float | area_tri_signed_v2 (const float v1[2], const float v2[2], const float v3[2]) |
| float | area_tri_v3 (const float v1[3], const float v2[3], const float v3[3]) |
| float | area_squared_tri_v3 (const float v1[3], const float v2[3], const float v3[3]) |
| float | area_tri_signed_v3 (const float v1[3], const float v2[3], const float v3[3], const float normal[3]) |
| float | area_quad_v3 (const float v1[3], const float v2[3], const float v3[3], const float v4[3]) |
| float | area_squared_quad_v3 (const float v1[3], const float v2[3], const float v3[3], const float v4[3]) |
| float | area_poly_v3 (const float verts[][3], unsigned int nr) |
| float | area_poly_v2 (const float verts[][2], unsigned int nr) |
| float | area_squared_poly_v3 (const float verts[][3], unsigned int nr) |
| float | area_squared_poly_v2 (const float verts[][2], unsigned int nr) |
| float | area_poly_signed_v2 (const float verts[][2], unsigned int nr) |
| float | cotangent_tri_weight_v3 (const float v1[3], const float v2[3], const float v3[3]) |
| void | cross_tri_v3 (float n[3], const float v1[3], const float v2[3], const float v3[3]) |
| MINLINE float | cross_tri_v2 (const float v1[2], const float v2[2], const float v3[2]) |
| void | cross_poly_v3 (float n[3], const float verts[][3], unsigned int nr) |
| float | cross_poly_v2 (const float verts[][2], unsigned int nr) |
Planes | |
| void | plane_from_point_normal_v3 (float r_plane[4], const float plane_co[3], const float plane_no[3]) |
| void | plane_to_point_vector_v3 (const float plane[4], float r_plane_co[3], float r_plane_no[3]) |
| void | plane_to_point_vector_v3_normalized (const float plane[4], float r_plane_co[3], float r_plane_no[3]) |
| MINLINE float | plane_point_side_v3 (const float plane[4], const float co[3]) |
Volume | |
| float | volume_tetrahedron_v3 (const float v1[3], const float v2[3], const float v3[3], const float v4[3]) |
| float | volume_tetrahedron_signed_v3 (const float v1[3], const float v2[3], const float v3[3], const float v4[3]) |
| float | volume_tri_tetrahedron_signed_v3_6x (const float v1[3], const float v2[3], const float v3[3]) |
| float | volume_tri_tetrahedron_signed_v3 (const float v1[3], const float v2[3], const float v3[3]) |
| bool | is_edge_convex_v3 (const float v1[3], const float v2[3], const float f1_no[3], const float f2_no[3]) |
| bool | is_quad_convex_v3 (const float v1[3], const float v2[3], const float v3[3], const float v4[3]) |
| bool | is_quad_convex_v2 (const float v1[2], const float v2[2], const float v3[2], const float v4[2]) |
| bool | is_poly_convex_v2 (const float verts[][2], unsigned int nr) |
| int | is_quad_flip_v3 (const float v1[3], const float v2[3], const float v3[3], const float v4[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]) |
Distance | |
| float | dist_squared_to_line_v2 (const float p[2], const float l1[2], const float l2[2]) |
| float | dist_to_line_v2 (const float p[2], const float l1[2], const float l2[2]) |
| float | dist_squared_to_line_segment_v2 (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]) |
| float | dist_signed_squared_to_plane_v3 (const float p[3], const float plane[4]) |
| float | dist_squared_to_plane_v3 (const float p[3], const float plane[4]) |
| float | dist_signed_to_plane_v3 (const float p[3], const float plane[4]) |
| float | dist_to_plane_v3 (const float p[3], const float plane[4]) |
| float | dist_signed_squared_to_plane3_v3 (const float p[3], const float plane[3]) |
| float | dist_squared_to_plane3_v3 (const float p[3], const float plane[3]) |
| float | dist_signed_to_plane3_v3 (const float p[3], const float plane[3]) |
| float | dist_to_plane3_v3 (const float p[3], const float plane[3]) |
| float | dist_squared_to_line_segment_v3 (const float p[3], const float l1[3], const float l2[3]) |
| float | dist_to_line_segment_v3 (const float p[3], const float l1[3], const float l2[3]) |
| float | dist_squared_to_line_v3 (const float p[3], const float l1[3], const float l2[3]) |
| float | dist_to_line_v3 (const float p[3], const float l1[3], const float l2[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]) |
| float | dist_squared_to_ray_v3_normalized (const float ray_origin[3], const float ray_direction[3], const float co[3]) |
| 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) |
| 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]) |
| struct DistRayAABB_Precalc | dist_squared_ray_to_aabb_v3_precalc (const float ray_origin[3], const float ray_direction[3]) |
| 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) |
| 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) |
| void | dist_squared_to_projected_aabb_precalc (struct DistProjectedAABBPrecalc *precalc, const float projmat[4][4], const float winsize[2], const float mval[2]) |
| float | dist_squared_to_projected_aabb (struct DistProjectedAABBPrecalc *data, const float bbmin[3], const float bbmax[3], bool r_axis_closest[3]) |
| 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]) |
| float | dist_seg_seg_v2 (const float a1[3], const float a2[3], const float b1[3], const float b2[3]) |
| float | closest_to_ray_v3 (float r_close[3], const float p[3], const float ray_orig[3], const float ray_dir[3]) |
| float | closest_to_line_v2 (float r_close[2], const float p[2], const float l1[2], const float l2[2]) |
| double | closest_to_line_v2_db (double r_close[2], const double p[2], const double l1[2], const double l2[2]) |
| float | closest_to_line_v3 (float r_close[3], const float p[3], const float l1[3], const float l2[3]) |
| float | closest_to_line_segment_v2 (float r_close[2], const float p[2], const float l1[2], const float l2[2]) |
| 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 | closest_to_line_segment_v3 (float r_close[3], const float p[3], const float l1[3], const float l2[3]) |
| float | closest_ray_to_segment_v3 (const float ray_origin[3], const float ray_direction[3], const float v0[3], const float v1[3], float r_close[3]) |
| void | closest_to_plane_normalized_v3 (float r_close[3], const float plane[4], const float pt[3]) |
| void | closest_to_plane_v3 (float r_close[3], const float plane[4], const float pt[3]) |
| void | closest_to_plane3_normalized_v3 (float r_close[3], const float plane[3], const float pt[3]) |
| void | closest_to_plane3_v3 (float r_close[3], const float plane[3], const float pt[3]) |
| 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]) |
| float | ray_point_factor_v3_ex (const float p[3], const float ray_origin[3], const float ray_direction[3], float epsilon, float fallback) |
| float | ray_point_factor_v3 (const float p[3], const float ray_origin[3], const float ray_direction[3]) |
| float | line_point_factor_v3_ex (const float p[3], const float l1[3], const float l2[3], float epsilon, float fallback) |
| float | line_point_factor_v3 (const float p[3], const float l1[3], const float l2[3]) |
| float | line_point_factor_v2_ex (const float p[2], const float l1[2], const float l2[2], float epsilon, float fallback) |
| float | line_point_factor_v2 (const float p[2], const float l1[2], const float l2[2]) |
| float | line_plane_factor_v3 (const float plane_co[3], const float plane_no[3], const float l1[3], const float l2[3]) |
| void | limit_dist_v3 (float v1[3], float v2[3], float dist) |
Interpolation | |
| 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 | 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]) |
| void | interp_weights_poly_v3 (float w[], float v[][3], int n, const float co[3]) |
| void | interp_weights_poly_v2 (float w[], float v[][2], int n, const float co[2]) |
| 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], float t) |
| int | interp_sparse_array (float *array, int list_size, float skipval) |
| 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 | 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]) |
| void | barycentric_weights_v2 (const float v1[2], const float v2[2], const float v3[2], const float co[2], float w[3]) |
| 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 | barycentric_weights_v2_persp (const float v1[4], const float v2[4], const float v3[4], const float co[2], float w[3]) |
| 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]) |
| bool | barycentric_coords_v2 (const float v1[2], const float v2[2], const float v3[2], const float co[2], float w[3]) |
| int | barycentric_inside_triangle_v2 (const float w[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]) |
| 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 | 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]) |
| 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]) |
| 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]) |
| void | interp_bilinear_quad_v3 (float data[4][3], float u, float v, float res[3]) |
| void | interp_barycentric_tri_v3 (float data[3][3], float u, float v, float res[3]) |
View & Projection | |
| void | lookat_m4 (float mat[4][4], float vx, float vy, float vz, float px, float py, float pz, float twist) |
| void | polarview_m4 (float mat[4][4], float dist, float azimuth, float incidence, float twist) |
| void | perspective_m4 (float mat[4][4], float left, float right, float bottom, float top, float nearClip, float farClip) |
| void | perspective_m4_fov (float mat[4][4], float angle_left, float angle_right, float angle_up, float angle_down, float nearClip, float farClip) |
| void | orthographic_m4 (float mat[4][4], float left, float right, float bottom, float top, float nearClip, float farClip) |
| void | window_translate_m4 (float winmat[4][4], float perspmat[4][4], float x, float y) |
| 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]) |
| 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 | 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) |
| void | projmat_from_subregion (const float projmat[4][4], const int win_size[2], int x_min, int x_max, int y_min, int y_max, float r_projmat[4][4]) |
| int | box_clip_bounds_m4 (float boundbox[2][3], const float bounds[4], float winmat[4][4]) |
| void | box_minmax_bounds_m4 (float min[3], float max[3], float boundbox[2][3], float mat[4][4]) |
Mapping | |
| bool | map_to_tube (float *r_u, float *r_v, float x, float y, float z) |
| bool | map_to_sphere (float *r_u, float *r_v, float x, float y, float z) |
| void | map_to_plane_v2_v3v3 (float r_co[2], const float co[3], const float no[3]) |
| void | map_to_plane_axis_angle_v2_v3v3fl (float r_co[2], const float co[3], const float axis[3], float angle) |
Normals | |
| 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]) |
| 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]) |
| void | accumulate_vertex_normals_poly_v3 (float **vertnos, const float polyno[3], const float **vertcos, float vdiffs[][3], int nverts) |
Tangents | |
| 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]) |
Vector Clouds | |
| void | vcloud_estimate_transform_v3 (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]) |
Others | |
| void | axis_dominant_v3_to_m3_negate (float r_mat[3][3], const float normal[3]) |
| void | axis_dominant_v3_to_m3 (float r_mat[3][3], const float normal[3]) |
| Normal to x,y matrix. | |
| MINLINE void | axis_dominant_v3 (int *r_axis_a, int *r_axis_b, const float axis[3]) |
| MINLINE float | axis_dominant_v3_max (int *r_axis_a, int *r_axis_b, const float axis[3]) ATTR_WARN_UNUSED_RESULT |
| MINLINE int | axis_dominant_v3_single (const float vec[3]) |
| MINLINE int | axis_dominant_v3_ortho_single (const float vec[3]) |
| MINLINE int | max_axis_v3 (const float vec[3]) |
| MINLINE int | min_axis_v3 (const float vec[3]) |
| MINLINE int | poly_to_tri_count (int poly_count, int corner_count) |
| MINLINE float | shell_angle_to_dist (float angle) |
| MINLINE float | shell_v3v3_normalized_to_dist (const float a[3], const float b[3]) |
| MINLINE float | shell_v2v2_normalized_to_dist (const float a[2], const float b[2]) |
| MINLINE float | shell_v3v3_mid_normalized_to_dist (const float a[3], const float b[3]) |
| MINLINE float | shell_v2v2_mid_normalized_to_dist (const float a[2], const float b[2]) |
Cubic (Bezier) | |
| float | cubic_tangent_factor_circle_v3 (const float tan_l[3], const float tan_r[3]) |
Geodesics | |
| float | geodesic_distance_propagate_across_triangle (const float v0[3], const float v1[3], const float v2[3], float dist1, float dist2) |
Intersection | |
| #define | ISECT_LINE_LINE_COLINEAR -1 |
| #define | ISECT_LINE_LINE_NONE 0 |
| #define | ISECT_LINE_LINE_EXACT 1 |
| #define | ISECT_LINE_LINE_CROSS 2 |
| #define | ISECT_AABB_PLANE_BEHIND_ANY 0 |
| #define | ISECT_AABB_PLANE_CROSS_ANY 1 |
| #define | ISECT_AABB_PLANE_IN_FRONT_ALL 2 |
| int | isect_seg_seg_v2 (const float v1[2], const float v2[2], const float v3[2], const float v4[2]) |
| 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]) |
| int | isect_seg_seg_v2_int (const int v1[2], const int v2[2], const int v3[2], const int v4[2]) |
| int | isect_seg_seg_v2_point_ex (const float v0[2], const float v1[2], const float v2[2], const float v3[2], float endpoint_bias, float r_vi[2]) |
| 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]) |
| bool | isect_seg_seg_v2_simple (const float v1[2], const float v2[2], const float v3[2], const float v4[2]) |
| 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) |
| int | isect_line_sphere_v3 (const float l1[3], const float l2[3], const float sp[3], float r, float r_p1[3], float r_p2[3]) |
| int | isect_line_sphere_v2 (const float l1[2], const float l2[2], const float sp[2], float r, float r_p1[2], float r_p2[2]) |
| 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]) |
| 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], float epsilon) |
| 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]) |
| 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) |
| 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], float epsilon, float *r_lambda_a, float *r_lambda_b) |
| 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) |
| bool | isect_ray_plane_v3_factor (const float ray_origin[3], const float ray_direction[3], const float plane_co[3], const float plane_no[3], float *r_lambda) |
| bool | isect_ray_plane_v3 (const float ray_origin[3], const float ray_direction[3], const float plane[4], float *r_lambda, bool clip) |
| bool | isect_point_planes_v3 (const float(*planes)[4], int totplane, const float p[3]) |
| bool | isect_point_planes_v3_negated (const float(*planes)[4], int totplane, const float p[3]) |
| 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]) ATTR_WARN_UNUSED_RESULT |
| 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]) ATTR_WARN_UNUSED_RESULT |
| 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]) ATTR_WARN_UNUSED_RESULT |
| bool | isect_planes_v3_fn (const float planes[][4], int planes_len, float eps_coplanar, float eps_isect, void(*callback_fn)(const float co[3], int i, int j, int k, void *user_data), void *user_data) |
| 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]) |
| 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], float epsilon) |
| bool | isect_axial_line_segment_tri_v3 (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_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]) |
| 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) |
| 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], float epsilon) |
| 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) |
| 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]) |
| 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 | isect_ray_tri_watertight_v3_precalc (struct IsectRayPrecalc *isect_precalc, const float ray_direction[3]) |
| 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]) |
| 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]) |
| 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) |
| 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) |
| bool | isect_point_poly_v2 (const float pt[2], const float verts[][2], unsigned int nr) |
| bool | isect_point_poly_v2_int (const int pt[2], const int verts[][2], unsigned int nr) |
| int | isect_point_quad_v2 (const float p[2], const float v1[2], const float v2[2], const float v3[2], const float v4[2]) |
| int | isect_point_tri_v2 (const float pt[2], const float v1[2], const float v2[2], const float v3[2]) |
| bool | isect_point_tri_v2_cw (const float pt[2], const float v1[2], const float v2[2], const float v3[2]) |
| int | isect_point_tri_v2_int (int x1, int y1, int x2, int y2, int a, int b) |
| bool | isect_point_tri_prism_v3 (const float p[3], const float v1[3], const float v2[3], const float v3[3]) |
| 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]) |
| bool | isect_aabb_aabb_v3 (const float min1[3], const float max1[3], const float min2[3], const float max2[3]) |
| void | isect_ray_aabb_v3_precalc (struct IsectRayAABB_Precalc *data, const float ray_origin[3], const float ray_direction[3]) |
| bool | isect_ray_aabb_v3 (const struct IsectRayAABB_Precalc *data, const float bb_min[3], const float bb_max[3], float *r_tmin) |
| 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) |
| int | isect_aabb_planes_v3 (const float(*planes)[4], int totplane, const float bbmin[3], const float bbmax[3]) |
| bool | isect_sweeping_sphere_tri_v3 (const float p1[3], const float p2[3], float radius, const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float ipoint[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]) |
| bool | clip_segment_v3_plane_n (const float p1[3], const float p2[3], const float plane_array[][4], int plane_num, float r_p1[3], float r_p2[3]) |
| bool | point_in_slice_seg (float p[3], float l1[3], float l2[3]) |
| #define ISECT_AABB_PLANE_BEHIND_ANY 0 |
Definition at line 896 of file BLI_math_geom.h.
Referenced by bvhtree_nearest_projected_with_clipplane_test_dfs_recursive(), isect_aabb_planes_v3(), and SnapData::snap_boundbox().
| #define ISECT_AABB_PLANE_CROSS_ANY 1 |
Definition at line 897 of file BLI_math_geom.h.
Referenced by bvhtree_nearest_projected_with_clipplane_test_dfs_recursive(), and isect_aabb_planes_v3().
| #define ISECT_AABB_PLANE_IN_FRONT_ALL 2 |
Definition at line 898 of file BLI_math_geom.h.
Referenced by isect_aabb_planes_v3().
| #define ISECT_LINE_LINE_COLINEAR -1 |
Definition at line 442 of file BLI_math_geom.h.
Referenced by isect_line_line_v2_point(), isect_seg_seg_v2(), isect_seg_seg_v2_int(), isect_seg_seg_v2_lambda_mu_db(), and transform_mesh_uv_edge_slide_data_create().
| #define ISECT_LINE_LINE_CROSS 2 |
Definition at line 445 of file BLI_math_geom.h.
Referenced by BM_face_splits_check_legal(), blender::ed::sculpt_paint::greasepencil::compute_auto_flip(), isect_line_line_v2_point(), isect_seg_seg_v2(), isect_seg_seg_v2_int(), and isect_seg_seg_v2_lambda_mu_db().
| #define ISECT_LINE_LINE_EXACT 1 |
Definition at line 444 of file BLI_math_geom.h.
Referenced by isect_seg_seg_v2(), isect_seg_seg_v2_int(), and isect_seg_seg_v2_lambda_mu_db().
| #define ISECT_LINE_LINE_NONE 0 |
Definition at line 443 of file BLI_math_geom.h.
Referenced by isect_seg_seg_v2(), isect_seg_seg_v2_int(), isect_seg_seg_v2_lambda_mu_db(), and lineart_main_discard_out_of_frame_edges().
| 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] ) |
Returns the coordinates of the nearest vertex and the farthest vertex from a plane (or normal).
Definition at line 647 of file math_geom.cc.
Referenced by dist_squared_ray_to_aabb_v3(), dist_squared_to_projected_aabb(), DRW_culling_min_max_test(), isect_aabb_planes_v3(), and tree_intersect_plane_test().
| void accumulate_vertex_normals_poly_v3 | ( | float ** | vertnos, |
| const float | polyno[3], | ||
| const float ** | vertcos, | ||
| float | vdiffs[][3], | ||
| int | nverts ) |
Add weighted face normal component into normals of the face vertices. Caller must pass pre-allocated vdiffs of nverts length.
Definition at line 5097 of file math_geom.cc.
References dot_v3v3(), madd_v3_v3fl(), normalize_v3(), blender::math::safe_acos_approx(), and sub_v3_v3v3().
| 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] ) |
Definition at line 5013 of file math_geom.cc.
References dot_v3v3(), madd_v3_v3fl(), normalize_v3(), blender::math::safe_acos_approx(), and sub_v3_v3v3().
| 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] ) |
Definition at line 5050 of file math_geom.cc.
References dot_v3v3(), madd_v3_v3fl(), normalize_v3(), blender::math::safe_acos_approx(), and sub_v3_v3v3().
Referenced by make_face().
Definition at line 185 of file math_geom.cc.
References cross_poly_v2(), and verts.
Referenced by area_squared_poly_v2().
Definition at line 180 of file math_geom.cc.
References cross_poly_v2(), fabsf, and verts.
Referenced by BKE_mesh_remap_calc_faces_from_mesh(), projected_boundary_area(), and test_polyfill_area().
Definition at line 131 of file math_geom.cc.
References cross_poly_v3(), len_v3(), and verts.
Referenced by area_quad_v3(), blender::bke::mesh::face_area_calc(), and get_dupliface_transform_from_coords().
Definition at line 83 of file math_geom.cc.
References area_poly_v3(), UNPACK3, v2, and verts.
Referenced by psys_thread_context_init_distribute().
Definition at line 190 of file math_geom.cc.
References area_poly_signed_v2(), and verts.
Definition at line 138 of file math_geom.cc.
References cross_poly_v3(), len_squared_v3(), mul_v3_fl(), and verts.
Referenced by area_squared_quad_v3().
| float area_squared_quad_v3 | ( | const float | v1[3], |
| const float | v2[3], | ||
| const float | v3[3], | ||
| const float | v4[3] ) |
Definition at line 89 of file math_geom.cc.
References area_squared_poly_v3(), UNPACK3, v2, and verts.
Definition at line 36 of file math_geom_inline.c.
References area_tri_signed_v2(), and v2.
Definition at line 105 of file math_geom.cc.
References cross_tri_v3(), len_squared_v3(), mul_v3_fl(), and v2.
Referenced by BM_face_calc_point_in_face().
Definition at line 26 of file math_geom_inline.c.
References v2.
Referenced by area_squared_tri_v2(), and area_tri_v2().
| float area_tri_signed_v3 | ( | const float | v1[3], |
| const float | v2[3], | ||
| const float | v3[3], | ||
| const float | normal[3] ) |
Definition at line 113 of file math_geom.cc.
References cross_tri_v3(), dot_v3v3(), len_v3(), and v2.
Referenced by blender::bke::mesh::face_area_centroid_calc().
Definition at line 31 of file math_geom_inline.c.
References area_tri_signed_v2(), fabsf, and v2.
Referenced by BKE_mesh_remap_calc_faces_from_mesh(), computeBindWeights(), IsectPT2Df_limit(), M_Geometry_area_tri(), project_paint_bleed_add_face_user(), blender::geometry::ReverseUVSampler::sample(), test_polyfill_area(), test_polyfill_area_tri_nonzero(), and transform_point_by_tri_v3().
Definition at line 98 of file math_geom.cc.
References cross_tri_v3(), len_v3(), and v2.
Referenced by DRW_text_edit_mesh_measure_stats(), blender::bke::mesh::face_area_calc(), init_laplacian_matrix(), init_laplacian_matrix(), laplacian_triangle_area(), M_Geometry_area_tri(), mesh_calc_center_centroid_ex(), blender::geometry::p_face_area(), blender::geometry::p_validate_corrected_coords(), blender::geometry::p_validate_corrected_coords_point(), psys_thread_context_init_distribute(), quad_calc_error(), blender::nodes::node_geo_distribute_points_on_faces_cc::sample_mesh_surface(), blender::bke::mesh_surface_sample::sample_surface_points_spherical(), Freestyle::BlenderFileLoader::testDegenerateTriangle(), transform_point_by_tri_v3(), and VoronoiVertexWeight::VoronoiVertexWeight().
Get the 2 dominant axis values, 0==X, 1==Y, 2==Z.
Definition at line 42 of file math_geom_inline.c.
References fabsf.
Referenced by barycentric_differentials_from_position(), barycentric_weights(), and uvedit_unwrap_cube_project().
Same as axis_dominant_v3 but return the max value.
Definition at line 62 of file math_geom_inline.c.
References fabsf.
The dominant axis of an orthogonal vector.
Definition at line 93 of file math_geom_inline.c.
Referenced by ED_view3d_cursor3d_position_rotation().
Get the single dominant axis value, 0==X, 1==Y, 2==Z.
Definition at line 85 of file math_geom_inline.c.
Referenced by calc_initial_placement_point_from_view(), distribute_grid(), isect_ray_tri_watertight_v3_precalc(), ortho_v3_v3(), and OVERLAY_volume_extra().
Normal to x,y matrix.
Creates a 3x3 matrix from a normal. This matrix can be applied to vectors so their 'z' axis runs along normal. In practice it means you can use x,y as 2d coords.
| r_mat | The matrix to return. |
| normal | A unit length vector. |
Definition at line 3552 of file math_geom.cc.
References BLI_assert, BLI_ASSERT_UNIT_EPSILON, BLI_ASSERT_UNIT_V3, copy_v3_v3(), dot_m3_v3_row_z(), fabsf, is_negative_m3(), is_zero_v3(), ortho_basis_v3v3_v3(), and transpose_m3().
Referenced by BKE_mesh_remap_calc_faces_from_mesh(), bm_edge_calc_rotate_beauty__area(), BM_face_interp_from_face(), BM_face_point_inside_test(), BM_face_split_edgenet(), BM_face_split_edgenet_connect_islands(), BM_face_splits_check_legal(), bm_face_subset_calc_planar(), bm_interp_face_store(), bm_loop_collapse_is_degenerate(), BM_loop_interp_from_face(), BM_vert_interp_from_face(), bmesh_calc_tessellation_for_face_beauty(), blender::bke::pbvh::clip_ray_ortho(), createTransCurveVerts(), blender::io::obj::fixup_invalid_face(), blender::bke::mesh_init_origspace(), poly_rotate_plane(), projected_boundary_area(), smart_project_exec(), transform_convert_mesh_islands_calc(), transform_point_by_tri_v3(), and blender::bke::greasepencil::update_triangle_cache().
Same as axis_dominant_v3_to_m3, but flips the normal
Definition at line 3569 of file math_geom.cc.
References BLI_assert, BLI_ASSERT_UNIT_EPSILON, BLI_ASSERT_UNIT_V3, dot_m3_v3_row_z(), is_negative_m3(), is_zero_v3(), negate_v3_v3(), ortho_basis_v3v3_v3(), and transpose_m3().
Referenced by BLI_scanfill_calc_ex(), BM_face_calc_tessellation(), BM_face_triangulate(), bmesh_calc_tessellation_for_face_beauty(), bmesh_calc_tessellation_for_face_impl(), C_BVHTree_FromPolygons(), blender::bke::mesh::mesh_calc_tessellation_for_face_impl(), mesh_tessface_calc(), and blender::geometry::p_add_ngon().
| bool barycentric_coords_v2 | ( | const float | v1[2], |
| const float | v2[2], | ||
| const float | v3[2], | ||
| const float | co[2], | ||
| float | w[3] ) |
Definition at line 3702 of file math_geom.cc.
References is_finite_v3(), v2, and w().
Referenced by blender::geometry::ReverseUVSampler::sample().
Definition at line 3688 of file math_geom.cc.
References IN_RANGE, IN_RANGE_INCL, and w().
Referenced by blender::bke::pbvh::uv_islands::add_uv_island(), and blender::bke::pbvh::pixels::extract_barycentric_pixels().
| void barycentric_weights_v2 | ( | const float | v1[2], |
| const float | v2[2], | ||
| const float | v3[2], | ||
| const float | co[2], | ||
| float | w[3] ) |
Definition at line 3726 of file math_geom.cc.
References copy_v3_fl(), cross_tri_v2(), is_finite_v3(), mul_v3_fl(), v2, and w().
Referenced by blender::bke::pbvh::uv_islands::add_uv_island(), blender::bke::pbvh::pixels::calc_barycentric_delta(), dynamic_paint_create_uv_surface_direct_cb(), dynamic_paint_create_uv_surface_neighbor_cb(), blender::bke::pbvh::pixels::extract_barycentric_pixels(), project_bucket_clip_face(), project_paint_occlude_ptv_clip(), rect_to_uvspace_ortho(), screen_px_from_ortho(), screen_px_from_persp(), transform_point_by_tri_v3(), and VecZDepthOrtho().
| void barycentric_weights_v2_clamped | ( | const float | v1[2], |
| const float | v2[2], | ||
| const float | v3[2], | ||
| const float | co[2], | ||
| float | w[3] ) |
A version of barycentric_weights_v2 that doesn't allow negative weights. Useful when negative values cause problems and points are only ever slightly outside of the triangle.
Definition at line 3749 of file math_geom.cc.
References copy_v3_fl(), cross_tri_v2(), is_finite_v3(), max_ff(), mul_v3_fl(), v2, and w().
Referenced by tri_fill_smooth().
| void barycentric_weights_v2_persp | ( | const float | v1[4], |
| const float | v2[4], | ||
| const float | v3[4], | ||
| const float | co[2], | ||
| float | w[3] ) |
still use 2D X,Y space but this works for verts transformed by a perspective matrix, using their 4th component as a weight
Definition at line 3772 of file math_geom.cc.
References copy_v3_fl(), cross_tri_v2(), is_finite_v3(), mul_v3_fl(), v2, and w().
Referenced by project_bucket_clip_face(), project_paint_occlude_ptv_clip(), rect_to_uvspace_persp(), and VecZDepthPersp().
| 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] ) |
same as barycentric_weights_v2 but works with a quad, NOTE: untested for values outside the quad's bounds this is interp_weights_poly_v2 expanded for quads only
Definition at line 3795 of file math_geom.cc.
References copy_v4_fl(), is_finite_v4(), len_v2(), MEAN_VALUE_HALF_TAN_V2, mul_v4_fl(), UNLIKELY, v2, and w().
Referenced by barycentric_weights_v2_grid_cache(), draw_circle_in_quad(), and maskrasterize_layer_z_depth_quad().
Definition at line 4851 of file math_geom.cc.
References bounds(), copy_m4_m4(), flag, and mul_m4_v4().
Definition at line 4910 of file math_geom.cc.
References copy_v3_v3(), min, minmax_v3v3_v3(), and mul_m4_v3().
| 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] ) |
Definition at line 3442 of file math_geom.cc.
References copy_v3_v3(), dot_v3v3(), madd_v3_v3v3fl(), plane_point_side_v3(), sub_v3_v3v3(), and UNPACK3.
| bool clip_segment_v3_plane_n | ( | const float | p1[3], |
| const float | p2[3], | ||
| const float | plane_array[][4], | ||
| int | plane_num, | ||
| float | r_p1[3], | ||
| float | r_p2[3] ) |
Definition at line 3489 of file math_geom.cc.
References dot_v3v3(), madd_v3_v3v3fl(), plane_point_side_v3(), sub_v3_v3v3(), and UNPACK3.
Referenced by DRW_text_edit_mesh_measure_stats(), ED_transform_snap_object_project_all_view3d_ex(), ED_transform_snap_object_project_view3d_ex(), ED_view3d_clip_segment(), mesh_foreachScreenEdge_clip_bb_segment__mapFunc(), point_is_visible(), and view3d_project_segment_to_screen_with_content_clip_planes().
| 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] ) |
Set 'r' to the point in triangle (v1, v2, v3) closest to point 'p'.
Definition at line 1013 of file math_geom.cc.
References add_v3_v3(), copy_v3_v3(), dot_v3v3(), madd_v3_v3v3fl(), mul_v3_fl(), sub_v3_v3v3(), v, v2, and w().
Referenced by BKE_mesh_remap_calc_loops_from_mesh(), bmbvh_find_face_closest_cb(), blender::ed::sculpt_paint::calc_area_normal_and_center_node_bmesh(), compute_collision_point_edge_tri(), compute_collision_point_tri_tri(), blender::bke::pbvh::edge_queue_tri_in_circle(), blender::bke::pbvh::edge_queue_tri_in_sphere(), blender::ed::curves::convert_to_particle_system::find_mface_for_root_position(), M_Geometry_closest_point_on_tri(), mesh_corner_tris_nearest_point(), mesh_corner_tris_target_project(), mesh_faces_nearest_point(), mesh_tris_nearest_point_dp(), py_bvhtree_nearest_point_cb(), and py_bvhtree_nearest_point_range_cb().
| float closest_ray_to_segment_v3 | ( | const float | ray_origin[3], |
| const float | ray_direction[3], | ||
| const float | v0[3], | ||
| const float | v1[3], | ||
| float | r_close[3] ) |
Finds the points where a ray and a segment are closest to each other.
Definition at line 407 of file math_geom.cc.
References copy_v3_v3(), interp_v3_v3v3(), and isect_ray_line_v3().
Referenced by knife_find_closest_edge_of_face(), and test_projected_edge_dist().
| 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] ) |
Finds the points where two line segments are closest to each other.
lambda_* is a value between 0 and 1 for each segment that indicates where r_closest_* is on the corresponding segment.
Definition at line 303 of file math_geom.cc.
References BLI_assert, closest_to_line_segment_v2(), closest_to_line_v2(), copy_v2_v2(), isect_line_line_v2_point(), isect_seg_seg_v2_simple(), len_squared_v2v2(), and min_ffff().
Referenced by blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_projected().
| float closest_to_line_segment_v2 | ( | float | r_close[2], |
| const float | p[2], | ||
| const float | l1[2], | ||
| const float | l2[2] ) |
Point closest to v1 on line v2-v3 in 2D.
Definition at line 363 of file math_geom.cc.
References closest_to_line_v2(), and copy_v2_v2().
Referenced by closest_seg_seg_v2(), dist_squared_to_line_segment_v2(), edbm_rip_edge_invoke(), blender::bke::pbvh::pixels::Rows::filter_pixels_for_closer_examination(), blender::ed::sculpt_paint::find_curves_brush_position(), knife_find_line_hits(), uv_find_nearest_edge(), and uvedit_uv_straighten_elements().
| float closest_to_line_segment_v3 | ( | float | r_close[3], |
| const float | p[3], | ||
| const float | l1[3], | ||
| const float | l2[3] ) |
Point closest to v1 on line v2-v3 in 3D.
Definition at line 385 of file math_geom.cc.
References closest_to_line_v3(), and copy_v3_v3().
Referenced by bev_create_ngon(), BM_face_calc_tangent_edge_diagonal(), dist_squared_to_line_segment_v3(), blender::ed::sculpt_paint::find_curves_brush_position(), heat_ray_source_visible(), heat_source_distance(), mesh_edges_nearest_point(), mesh_verts_spherecast_do(), projected_boundary_area(), snap_to_pipe_profile(), and square_out_adj_vmesh().
| float closest_to_line_v2 | ( | float | r_close[2], |
| const float | p[2], | ||
| const float | l1[2], | ||
| const float | l2[2] ) |
Definition at line 3210 of file math_geom.cc.
References dot_v2v2(), and sub_v2_v2v2().
Referenced by closest_seg_seg_v2(), closest_to_line_segment_v2(), blender::bke::pbvh::pixels::Rows::determine_mix_factor(), dist_squared_to_line_v2(), dynamic_paint_find_island_border(), gizmo_arrow_test_select(), interp_weights_uv_v2_calc(), knife_constrain_axis(), and slide_plane_marker_modal().
| double closest_to_line_v2_db | ( | double | r_close[2], |
| const double | p[2], | ||
| const double | l1[2], | ||
| const double | l2[2] ) |
Definition at line 3227 of file math_geom.cc.
References dot_v2v2_db(), and sub_v2_v2v2_db().
| float closest_to_line_v3 | ( | float | r_close[3], |
| const float | p[3], | ||
| const float | l1[3], | ||
| const float | l2[3] ) |
Find closest point to p on line through (l1, l2) and return lambda, where (0 <= lambda <= 1) when p is in the line segment (l1, l2).
Definition at line 3203 of file math_geom.cc.
References closest_to_ray_v3(), and sub_v3_v3v3().
Referenced by bezier_handle_calc_length_v3(), BKE_gpencil_stroke_trim(), closest_to_line_segment_v3(), compute_collision_point_edge_tri(), compute_collision_point_tri_tri(), dist_squared_to_line_v3(), ViewOpsData::init_navigation(), M_Geometry_intersect_line_line(), M_Geometry_intersect_point_line(), modify_mesh(), and point_in_slice().
Definition at line 454 of file math_geom.cc.
References BLI_ASSERT_UNIT_V3, dot_v3v3(), and madd_v3_v3v3fl().
Definition at line 447 of file math_geom.cc.
References dot_v3v3(), len_squared_v3(), and madd_v3_v3v3fl().
Definition at line 440 of file math_geom.cc.
References BLI_ASSERT_UNIT_V3, madd_v3_v3v3fl(), and plane_point_side_v3().
Referenced by bmo_planar_faces_exec(), blender::ed::sculpt_paint::calc_brush_distances_squared(), blender::ed::sculpt_paint::calc_brush_distances_squared(), blender::ed::sculpt_paint::calc_translations(), blender::ed::sculpt_paint::calc_translations_to_plane(), blender::ed::sculpt_paint::calc_translations_to_plane(), gizmo_bisect_prop_depth_set(), gizmo_spin_prop_depth_set(), offset_meet(), and view3d_interactive_add_modal().
Find the closest point on a plane.
| r_close | Return coordinate |
| plane | The plane to test against. |
| pt | The point to find the nearest of |
Definition at line 433 of file math_geom.cc.
References len_squared_v3(), madd_v3_v3v3fl(), and plane_point_side_v3().
Referenced by BM_mesh_bisect_plane(), blender::ed::sculpt_paint::cloth::cloth_brush_solve_collision(), ED_view3d_win_to_3d_on_plane_with_fallback(), isect_point_tri_v3(), snap_to_pipe_profile(), and blender::ed::sculpt_paint::smooth::translation_to_plane().
| float closest_to_ray_v3 | ( | float | r_close[3], |
| const float | p[3], | ||
| const float | ray_orig[3], | ||
| const float | ray_dir[3] ) |
Definition at line 3184 of file math_geom.cc.
References copy_v3_v3(), dot_v3v3(), is_zero_v3(), madd_v3_v3v3fl(), sub_v3_v3v3(), and UNLIKELY.
Referenced by closest_to_line_v3(), and UNUSED_FUNCTION().
Definition at line 196 of file math_geom.cc.
References b, cross_v3_v3v3(), dot_v3v3(), len_v3(), sub_v3_v3v3(), and v2.
Referenced by init_laplacian_matrix(), init_laplacian_matrix(), initLaplacianMatrix(), laplacian_triangle_area(), laplacian_triangle_weights(), and tri_weight_v3().
Scalar cross product of a 2D polygon.
area * 2.Definition at line 147 of file math_geom.cc.
References cross(), and verts.
Referenced by area_poly_signed_v2(), area_poly_v2(), BKE_mesh_uv_vert_map_create(), BM_face_uv_calc_cross(), blender::bke::pbvh::uv_islands::UVBorder::is_ccw(), polyfill_prepare(), TEST(), and TEST().
Definition at line 166 of file math_geom.cc.
References add_newell_cross_v3_v3v3(), verts, and zero_v3().
Referenced by area_poly_v3(), area_squared_poly_v3(), normal_poly_v3(), and TEST().
Scalar cross product of a 2D triangle.
area * 2.Definition at line 21 of file math_geom_inline.c.
References v2.
Referenced by barycentric_weights_v2(), barycentric_weights_v2_clamped(), barycentric_weights_v2_persp(), BLI_polyfill_beautify_quad_rotate_calc_ex(), bm_edge_calc_rotate_beauty__area(), bm_loop_collapse_is_degenerate(), color_sample_remove_cost(), project_face_winding_init(), TEST(), TEST(), and test_polyfill_winding().
Definition at line 24 of file math_geom.cc.
References v2.
Referenced by area_squared_tri_v3(), area_tri_signed_v3(), area_tri_v3(), bm_edge_calc_rotate_beauty__area(), bm_face_split_by_concave(), isect_point_tri_v3(), raycast_tri_backface_culling_test(), and TEST().
Return the value which the distance between points will need to be scaled by, to define a handle, given both points are on a perfect circle.
Use when we want a bezier curve to match a circle as closely as possible.
Definition at line 5477 of file math_geom.cc.
References acosf, BLI_ASSERT_UNIT_V3, cosf, dot_v3v3(), eps, and sinf.
Referenced by BKE_pchan_bbone_handles_compute().
| float dist_seg_seg_v2 | ( | const float | a1[3], |
| const float | a2[3], | ||
| const float | b1[3], | ||
| const float | b2[3] ) |
Returns the distance between two 2D line segments.
Definition at line 1001 of file math_geom.cc.
References dist_squared_to_line_segment_v2(), isect_seg_seg_v2_simple(), min_ffff(), and sqrtf.
Referenced by blender::ed::space_node::viewer_linking::position_viewer_node().
| 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] ) |
Check if p is inside the 2x planes defined by (v1, v2, v3) where the 3x points define 2x planes.
| axis_ref | used when v1,v2,v3 form a line and to check if the corner is concave/convex. |
(return < 0.0) is outside.Definition at line 544 of file math_geom.cc.
References copy_v3_v3(), cross_v3_v3v3(), dist_signed_squared_to_plane3_v3(), dist_signed_squared_to_plane_v3(), dot_v3v3(), len_squared_v3(), max_ff(), min_ff(), negate_v3(), plane_from_point_normal_v3(), sub_v3_v3v3(), and v2.
Referenced by BM_loop_point_side_of_loop_test(), and mesh_customdatacorrect_apply_vert().
Definition at line 477 of file math_geom.cc.
References copysignf, dot_v3v3(), and len_squared_v3().
Referenced by dist_signed_squared_to_corner_v3v3v3().
Definition at line 461 of file math_geom.cc.
References copysignf, len_squared_v3(), and plane_point_side_v3().
Referenced by BM_loop_point_side_of_edge_test(), dist_signed_squared_to_corner_v3v3v3(), and modify_mesh().
Definition at line 505 of file math_geom.cc.
References dot_v3v3(), len_squared_v3(), and sqrtf.
Referenced by dist_to_plane3_v3().
Return the signed distance from the point to the plane.
Definition at line 493 of file math_geom.cc.
References len_squared_v3(), plane_point_side_v3(), and sqrtf.
Referenced by blender::ed::sculpt_paint::cloth::calc_plane_pinch_forces(), blender::ed::sculpt_paint::pose::calc_scale_from_grab_delta(), blender::ed::sculpt_paint::trim::calculate_depth(), blender::ed::sculpt_paint::boundary::displacement_from_grab_delta_get(), dist_to_plane_v3(), draw_primitive_view_impl(), blender::ed::sculpt_paint::trim::generate_geometry(), M_Geometry_distance_point_to_plane(), and modify_mesh().
| 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 ) |
Returns the distance from a ray to a bound-box (projected on ray)
Referenced by blender::bke::pbvh::nearest_to_ray_aabb_dist_sq(), and blender::ed::sculpt_paint::node_in_cylinder().
| struct DistRayAABB_Precalc dist_squared_ray_to_aabb_v3_precalc | ( | const float | ray_origin[3], |
| const float | ray_direction[3] ) |
Definition at line 683 of file math_geom.cc.
References copy_v3_v3(), and FLT_MAX.
Referenced by dist_squared_ray_to_aabb_v3_simple(), blender::bke::pbvh::find_nearest_to_ray(), blender::ed::sculpt_paint::pbvh_gather_generic(), and blender::ed::sculpt_paint::vwpaint::pbvh_gather_generic().
| 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 ) |
Use when there is no advantage to pre-calculation.
Definition at line 787 of file math_geom.cc.
References dist_squared_ray_to_aabb_v3(), and dist_squared_ray_to_aabb_v3_precalc().
| 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 ) |
Find the closest point in a seg to a ray and return the distance squared.
| r_point | Is the point on segment closest to ray (or to ray_origin if the ray and the segment are parallel). |
| r_depth | the distance of r_point projection on ray to the ray_origin. |
Definition at line 611 of file math_geom.cc.
References copy_v3_v3(), dot_v3v3(), interp_v3_v3v3(), isect_ray_line_v3(), len_squared_v3(), square_f(), and sub_v3_v3v3().
Referenced by dist_squared_ray_to_aabb_v3(), blender::bke::pbvh::dist_squared_ray_to_tri_v3_fast(), and EDBM_unified_findnearest_from_raycast().
Distance p to line-piece v1-v2.
Definition at line 289 of file math_geom.cc.
References closest_to_line_segment_v2(), and len_squared_v2v2().
Referenced by BKE_curveprofile_insert(), calcEdgeSlide_mval_range(), blender::ed::sculpt_paint::CombOperationExecutor::comb_projected(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_projected(), dist_seg_seg_v2(), dist_squared_to_corner_tris_uv_edges(), dist_to_line_segment_v2(), dynamic_paint_find_island_border(), ED_curve_editfont_select_pick(), ED_mask_find_nearest_diff_point(), edbm_rip_edge_side_measure(), edbm_rip_edgedist_squared(), edge_inside_circle(), blender::ed::sculpt_paint::PuffOperationExecutor::find_curve_weights_projected(), find_nearest_tracking_segment_cb(), interp_weights_poly_v2(), knife_find_closest_vert_of_edge(), knife_find_line_hits(), knife_ray_intersect_face(), layer_bucket_isect_test(), mouse_to_closest_corners_edge_distance_squared(), blender::ed::space_node::node_insert_on_link_flags_set(), blender::ed::space_node::pick_input_link_by_link_intersect(), blender::ed::curves::select_circle(), blender::ed::curves::select_circle_mask(), ui_do_but_CURVE(), ui_do_but_CURVEPROFILE(), uv_circle_select_is_edge_inside(), uv_find_nearest_loop_from_edge(), and view3d_ruler_pick().
Distance v1 to line-piece l1-l2 in 3D.
Definition at line 517 of file math_geom.cc.
References closest_to_line_segment_v3(), and len_squared_v3v3().
Referenced by blender::ed::greasepencil::add_armature_automatic_weights(), blender::ed::sculpt_paint::CombOperationExecutor::comb_spherical(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_spherical(), dist_to_line_segment_v3(), find_closer_edge(), blender::ed::sculpt_paint::PuffOperationExecutor::find_curves_weights_spherical(), interp_weights_poly_v3(), nearestVert(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::spherical_snake_hook(), and Freestyle::BlenderFileLoader::testDegenerateTriangle().
Distance p to line v1-v2 using Hesse formula (NO LINE PIECE!)
Definition at line 276 of file math_geom.cc.
References closest_to_line_v2(), and len_squared_v2v2().
Referenced by blf_glyph_to_curves(), dist_to_line_v2(), project_bucket_clip_face(), and testvertexnearedge().
Definition at line 531 of file math_geom.cc.
References closest_to_line_v3(), and len_squared_v3v3().
Referenced by BKE_nurb_handles_autocalc(), and dist_to_line_v3().
Definition at line 484 of file math_geom.cc.
References dot_v3v3(), and len_squared_v3().
Definition at line 468 of file math_geom.cc.
References len_squared_v3(), and plane_point_side_v3().
Referenced by build_boundary_terminal_edge(), and knife_ray_intersect_face().
| float dist_squared_to_projected_aabb | ( | struct DistProjectedAABBPrecalc * | data, |
| const float | bbmin[3], | ||
| const float | bbmax[3], | ||
| bool | r_axis_closest[3] ) |
Returns the distance from a 2D coordinate to a bound-box (projected).
Definition at line 856 of file math_geom.cc.
References aabb_get_near_far_from_plane(), dot_m4_v3_row_x(), dot_m4_v3_row_y(), dot_v2v2(), fabsf, len_squared_v2(), len_squared_v2v2(), madd_v2_v2fl(), mul_project_m4_v3_zfac(), and sub_v2_v2v2().
Referenced by BLI_bvhtree_find_nearest_projected(), bvhtree_nearest_projected_dfs_recursive(), bvhtree_nearest_projected_with_clipplane_test_dfs_recursive(), dist_squared_to_projected_aabb_simple(), and SnapData::snap_boundbox().
| void dist_squared_to_projected_aabb_precalc | ( | struct DistProjectedAABBPrecalc * | precalc, |
| const float | projmat[4][4], | ||
| const float | winsize[2], | ||
| const float | mval[2] ) |
| projmat | Projection Matrix (usually perspective matrix multiplied by object matrix). |
Definition at line 804 of file math_geom.cc.
References copy_m4_m4(), cross_v3_v3v3(), FLT_MAX, isect_plane_plane_plane_v3(), isect_plane_plane_v3(), mul_v2_v2fl(), DistProjectedAABBPrecalc::mval, DistProjectedAABBPrecalc::pmat, DistProjectedAABBPrecalc::ray_direction, DistProjectedAABBPrecalc::ray_inv_dir, DistProjectedAABBPrecalc::ray_origin, sub_v2_v2v2(), transpose_m4_m4(), and zero_v3().
Referenced by BLI_bvhtree_find_nearest_projected(), dist_squared_to_projected_aabb_simple(), and SnapData::SnapData().
| 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] ) |
Definition at line 986 of file math_geom.cc.
References data, dist_squared_to_projected_aabb(), and dist_squared_to_projected_aabb_precalc().
| float dist_squared_to_ray_v3_normalized | ( | const float | ray_origin[3], |
| const float | ray_direction[3], | ||
| const float | co[3] ) |
Compute the squared distance of a point to a line (defined as ray).
| ray_origin | A point on the line. |
| ray_direction | Normalized direction of the line. |
| co | Point to which the distance is to be calculated. |
Definition at line 595 of file math_geom.cc.
References add_v3_v3v3(), len_squared_v3v3(), project_v3_v3v3_normalized(), and sub_v3_v3v3().
Referenced by EDBM_unified_findnearest_from_raycast().
Definition at line 298 of file math_geom.cc.
References dist_squared_to_line_segment_v2(), and sqrtf.
Referenced by MOD_lineart_smooth_chains(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::stroke_eraser(), and TEST().
Definition at line 526 of file math_geom.cc.
References dist_squared_to_line_segment_v3(), and sqrtf.
Definition at line 284 of file math_geom.cc.
References dist_squared_to_line_v2(), and sqrtf.
Referenced by calculate_autoscale_factor(), computeBindWeights(), MOD_lineart_smooth_chains(), and TEST().
Definition at line 539 of file math_geom.cc.
References dist_squared_to_line_v3(), and sqrtf.
Referenced by blender::ed::greasepencil::grease_pencil_stroke_simplify_exec(), blender::ed::sculpt_paint::sample_curves_3d_brush(), and blender::ed::sculpt_paint::sample_curves_surface_3d_brush().
Definition at line 512 of file math_geom.cc.
References dist_signed_to_plane3_v3(), and fabsf.
Definition at line 500 of file math_geom.cc.
References dist_signed_to_plane_v3(), and fabsf.
Referenced by blender::ed::sculpt_paint::cloth::calc_distances_to_plane().
| float geodesic_distance_propagate_across_triangle | ( | const float | v0[3], |
| const float | v1[3], | ||
| const float | v2[3], | ||
| float | dist1, | ||
| float | dist2 ) |
Utility for computing approximate geodesic distances on triangle meshes.
Given triangle with vertex coordinates v0, v1, v2, and known geodesic distances dist1 and dist2 at v1 and v2, estimate a geodesic distance at vertex v0.
From "Dart Throwing on Surfaces", EGSR 2009. Section 7, Geodesic Dart Throwing.
Definition at line 5504 of file math_geom.cc.
References cross_v3_v3v3(), dot_v3v3(), fabsf, len_v2v2(), len_v3(), len_v3v3(), min_ff(), normalize_v3(), normalize_v3_v3(), sqrtf, sub_v3_v3v3(), v, and v2.
Referenced by bmesh_test_dist_add(), and blender::ed::sculpt_paint::geodesic::sculpt_geodesic_mesh_test_dist_add().
Definition at line 4516 of file math_geom.cc.
References add_v3_v3(), copy_v3_v3(), mul_v3_fl(), and v.
Referenced by calc_point_from_barycentric_cage(), calc_point_from_barycentric_extrusion(), interp_barycentric_corner_tri(), and RE_bake_normal_world_to_tangent().
Use to find the point of a UV on a face. Reverse of resolve_* functions.
Definition at line 4499 of file math_geom.cc.
References add_v3_v3(), copy_v3_v3(), mul_v3_fl(), and v.
Referenced by interp_bilinear_grid(), interp_bilinear_mpoly(), and interp_vmesh().
| 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], | ||
| float | t ) |
(x1, v1)(t1=0)------(x2, v2)(t2=1), 0<t<1 --> (x, v)(t).
Definition at line 4271 of file math_geom.cc.
Referenced by psys_interpolate_particle().
Given an array with some invalid values this function interpolates valid values replacing the invalid ones.
Definition at line 3943 of file math_geom.cc.
References float.
Referenced by annotation_stroke_newfrombuffer().
| 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] ) |
Definition at line 3637 of file math_geom.cc.
References barycentric_weights(), cross_v3_v3v3(), equals_v3v3(), sub_v3_v3v3(), v2, w(), and zero_v4().
| void interp_weights_tri_v3 | ( | float | w[3], |
| const float | v1[3], | ||
| const float | v2[3], | ||
| const float | v3[3], | ||
| const float | co[3] ) |
Definition at line 3628 of file math_geom.cc.
References barycentric_weights(), normal_tri_v3(), v2, and w().
Referenced by bindVert(), BKE_shrinkwrap_compute_smooth_normal(), blender::bke::mesh_surface_sample::compute_bary_coord_in_triangle(), blender::ed::curves::convert_to_particle_system::compute_mface_weights_for_position(), dynamic_paint_paint_mesh_cell_point_cb_ex(), blender::ed::sculpt_paint::PuffOperationExecutor::puff(), blender::bke::mesh_surface_sample::sample_surface_points_spherical(), and target_project_solve_point_tri().
| bool is_edge_convex_v3 | ( | const float | v1[3], |
| const float | v2[3], | ||
| const float | f1_no[3], | ||
| const float | f2_no[3] ) |
Check if the edge is convex or concave (depends on face winding) Copied from BM_edge_is_convex().
Definition at line 5326 of file math_geom.cc.
References cross(), cross_v3_v3v3(), dot_v3v3(), equals_v3v3(), sub_v3_v3v3(), and v2.
Referenced by blender::draw::statvis_calc_sharp().
Definition at line 5398 of file math_geom.cc.
References copy_v2_v2(), cross(), cross_v2v2(), sub_v2_v2v2(), and verts.
Referenced by BM_face_splits_check_legal(), and isPolyValid().
| bool is_quad_convex_v2 | ( | const float | v1[2], |
| const float | v2[2], | ||
| const float | v3[2], | ||
| const float | v4[2] ) |
Definition at line 5392 of file math_geom.cc.
References isect_seg_seg_v2(), and v2.
Referenced by blender::nodes::node_composite_cornerpin_cc::CornerPinOperation::compute_homography_matrix().
| bool is_quad_convex_v3 | ( | const float | v1[3], |
| const float | v2[3], | ||
| const float | v3[3], | ||
| const float | v4[3] ) |
Evaluate if entire quad is a proper convex quad
Method projects points onto a plane and checks its convex using following method:
Definition at line 5342 of file math_geom.cc.
References CROSS_SIGN, cross_v3_v3v3(), len_squared_v3(), project_plane_v3_v3v3(), sub_v3_v3v3(), and v2.
Referenced by bm_decim_triangulate_end(), and hull_merge_triangles().
Check if either of the diagonals along this quad create flipped triangles (normals pointing away from each other).
Definition at line 5437 of file math_geom.cc.
References cross_v3_v3v3(), dot_v3v3(), ret, sub_v3_v3v3(), and v2.
Referenced by bm_edge_is_delimit(), BM_face_triangulate(), and bm_vert_connect_select_history_edge_to_vert_path().
| bool is_quad_flip_v3_first_third_fast | ( | const float | v1[3], |
| const float | v2[3], | ||
| const float | v3[3], | ||
| const float | v4[3] ) |
Definition at line 5459 of file math_geom.cc.
References cross_v3_v3v3(), dot_v3v3(), sub_v3_v3v3(), and v2.
Referenced by bmesh_calc_tessellation_for_face_impl(), and blender::bke::mesh::mesh_calc_tessellation_for_face_impl().
| bool isect_aabb_aabb_v3 | ( | const float | min1[3], |
| const float | max1[3], | ||
| const float | min2[3], | ||
| const float | max2[3] ) |
Axis-aligned bounding box.
Definition at line 3075 of file math_geom.cc.
Referenced by blender::ed::sculpt_paint::paint::image::init_uv_primitives_brush_test(), and particle_intersect_mesh().
| int isect_aabb_planes_v3 | ( | const float(*) | planes[4], |
| int | totplane, | ||
| const float | bbmin[3], | ||
| const float | bbmax[3] ) |
Checks status of an AABB in relation to a list of planes.
Definition at line 2631 of file math_geom.cc.
References aabb_get_near_far_from_plane(), ISECT_AABB_PLANE_BEHIND_ANY, ISECT_AABB_PLANE_CROSS_ANY, ISECT_AABB_PLANE_IN_FRONT_ALL, plane_point_side_v3(), and ret.
Referenced by BLI_bvhtree_find_nearest_projected(), bvhtree_nearest_projected_with_clipplane_test_dfs_recursive(), and SnapData::snap_boundbox().
| bool isect_axial_line_segment_tri_v3 | ( | 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 ) |
Definition at line 2846 of file math_geom.cc.
References sub_v3_v3v3(), v, and v2.
| 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], | ||
| float | epsilon ) |
Definition at line 2898 of file math_geom.cc.
References add_v3_v3v3(), b, copy_v3_v3(), cross_v3_v3v3(), dot_v3v3(), fabsf, mul_v3_fl(), project_v3_v3v3(), sub_v3_v3v3(), UNLIKELY, and v2.
Referenced by intersect_line_tri(), isect_line_line_v3(), and transform_mesh_edge_slide_data_create().
| 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 ) |
Intersection point strictly between the two lines
Definition at line 2973 of file math_geom.cc.
References add_v3_v3v3(), b, cross_v3_v3v3(), dot_v3v3(), fabsf, mul_v3_fl(), sub_v3_v3v3(), UNLIKELY, and v2.
| 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] ) |
Intersect Line-Line, floats - gives intersection point.
Definition at line 1118 of file math_geom.cc.
References cross_v2v2(), ISECT_LINE_LINE_COLINEAR, ISECT_LINE_LINE_CROSS, sub_v2_v2v2(), v, and v2.
Referenced by closest_seg_seg_v2(), facetag_cut_cost_edge_uv(), and transform_mesh_uv_edge_slide_data_create().
| 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] ) |
Definition at line 2962 of file math_geom.cc.
References isect_line_line_epsilon_v3(), and v2.
Referenced by BKE_gpencil_stroke_trim(), BKE_mesh_remap_calc_edges_from_mesh(), camera_frame_fit_calc_from_data(), facetag_cut_cost_edge(), knife_find_line_hits(), M_Geometry_intersect_line_line(), mesh_edges_spherecast(), blender::ed::object::object_transform_axis_target_calc_depth_init(), offset_meet(), project_to_edge(), set_profile_params(), and square_out_adj_vmesh().
| 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] ) |
Intersect line/plane.
| r_isect_co | The intersection point. |
| l1 | The first point of the line. |
| l2 | The second point of the line. |
| plane_co | A point on the plane to intersect with. |
| plane_no | The direction of the plane (does not need to be normalized). |
Definition at line 2103 of file math_geom.cc.
References dot(), dot_v3v3(), fabsf, madd_v3_v3v3fl(), and sub_v3_v3v3().
Referenced by adjust_miter_coords(), bindVert(), bm_loop_calc_opposite_co(), calculate_profile_segments(), compute_collision_point_edge_tri(), compute_collision_point_tri_tri(), knife_snap_curr(), and M_Geometry_intersect_line_plane().
| 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], | ||
| float | epsilon ) |
Like isect_line_segment_tri_v3, but allows epsilon tolerance around triangle.
Definition at line 1624 of file math_geom.cc.
References cross_v3_v3v3(), dot_v3v3(), sub_v3_v3v3(), v, and v2.
Referenced by intersect_line_tri().
| 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] ) |
Test if the line starting at p1 ending at p2 intersects the triangle v0..v2 return non zero if it does.
Definition at line 1574 of file math_geom.cc.
References cross_v3_v3v3(), dot_v3v3(), sub_v3_v3v3(), v, and v2.
Referenced by compute_collision_point_edge_tri(), particle_intersect_mesh(), sb_detect_edge_collisionCached(), and sb_detect_face_collisionCached().
| int isect_line_sphere_v2 | ( | const float | l1[2], |
| const float | l2[2], | ||
| const float | sp[2], | ||
| float | r, | ||
| float | r_p1[2], | ||
| float | r_p2[2] ) |
Definition at line 1442 of file math_geom.cc.
References b, dot_v2v2(), madd_v2_v2v2fl(), and sqrtf.
Referenced by M_Geometry_intersect_line_sphere_2d().
| int isect_line_sphere_v3 | ( | const float | l1[3], |
| const float | l2[3], | ||
| const float | sp[3], | ||
| float | r, | ||
| float | r_p1[3], | ||
| float | r_p2[3] ) |
| l1,l2 | Coordinates (point of line). |
| sp,r | Coordinate and radius (sphere). |
l2 - l1, this direction compared with the normal of each point on the sphere: r_p1 always has a >= 0.0 dot product. r_p2 always has a <= 0.0 dot product. For example, when l1 is inside the sphere and l2 is outside, r_p1 will always be between l1 and l2. Definition at line 1382 of file math_geom.cc.
References b, dot_v3v3(), len_squared_v3(), madd_v3_v3v3fl(), and sqrtf.
Referenced by M_Geometry_intersect_line_sphere().
| 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] ) |
Intersect three planes, return the point where all 3 meet. See Graphics Gems 1 pg 305
| plane_a,plane_b,plane_c | Planes. |
| r_isect_co | The resulting intersection point. |
Definition at line 2126 of file math_geom.cc.
References cross_v3_v3v3(), determinant_m3(), madd_v3_v3fl(), mul_v3_fl(), mul_v3_v3fl(), and UNPACK3.
Referenced by blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_points(), blender::nodes::node_geo_curve_primitive_circle_cc::create_point_circle_curve(), dist_squared_to_projected_aabb_precalc(), and interp_slerp_co_no_v3().
| 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] ) |
Intersect two planes, return a point on the intersection and a vector that runs on the direction of the intersection.
| plane_a,plane_b | Planes. |
| r_isect_co | The resulting intersection point. |
| r_isect_no | The resulting vector of the intersection. |
Definition at line 2159 of file math_geom.cc.
References copy_v3_v3(), cross_v3_v3v3(), len_squared_v3(), madd_v3_v3fl(), mul_v3_fl(), and mul_v3_v3fl().
Referenced by camera_frame_fit_calc_from_data(), dist_squared_to_projected_aabb_precalc(), ED_view3d_win_to_3d_on_plane_with_fallback(), M_Geometry_intersect_plane_plane(), and UNUSED_FUNCTION().
| bool isect_planes_v3_fn | ( | const float | planes[][4], |
| int | planes_len, | ||
| float | eps_coplanar, | ||
| float | eps_isect, | ||
| void(* | callback_fn )(const float co[3], int i, int j, int k, void *user_data), | ||
| void * | user_data ) |
Intersect all planes, calling callback_fn for each point that intersects 3 of the planes that isn't outside any of the other planes.
This can be thought of as calculating a convex-hull from an array of planes.
| eps_coplanar | Epsilon for testing if two planes are aligned (co-planar). |
| eps_isect | Epsilon for testing of a point is behind any of the planes. |
O(N^3), this is only suitable for small arrays.Definition at line 2193 of file math_geom.cc.
References cross_v3_v3v3(), dot_v3v3(), ELEM, fabsf, and len_squared_v3().
Referenced by ED_view3d_clipping_clamp_minmax(), and M_Geometry_points_in_planes().
Check if a point is behind all planes.
Definition at line 2079 of file math_geom.cc.
References plane_point_side_v3().
Referenced by blender::ed::sculpt_paint::gesture::is_affected().
Check if a point is in front all planes. Same as isect_point_planes_v3 but with planes facing the opposite direction.
Definition at line 2092 of file math_geom.cc.
References plane_point_side_v3().
Referenced by test_projected_vert_dist().
Definition at line 1490 of file math_geom.cc.
References verts.
Referenced by BM_face_point_inside_test(), BM_face_uv_point_inside_test(), computeBindWeights(), and edbm_mesh_knife_point_isect().
Definition at line 1507 of file math_geom.cc.
References verts.
Referenced by BLI_lasso_is_point_inside().
| int isect_point_quad_v2 | ( | const float | p[2], |
| const float | v1[2], | ||
| const float | v2[2], | ||
| const float | v3[2], | ||
| const float | v4[2] ) |
Point in quad - only convex quads.
Definition at line 1558 of file math_geom.cc.
References line_point_side_v2(), and v2.
Referenced by draw_marker_areas(), draw_marker_outline(), is_point_inside_quad(), is_quad_a_inside_b(), M_Geometry_intersect_point_quad_2d(), project_paint_face_init(), psys_particle_dm_face_lookup(), quad_co(), seq_box_select_rect_image_isect(), seq_point_image_isect(), slide_check_corners(), and TEST().
| bool isect_point_tri_prism_v3 | ( | const float | p[3], |
| const float | v1[3], | ||
| const float | v2[3], | ||
| const float | v3[3] ) |
Definition at line 3405 of file math_geom.cc.
References point_in_slice(), and v2.
Referenced by isect_point_tri_v3(), blender::bke::mesh_surface_sample::sample_surface_points_spherical(), sb_detect_face_pointCached(), and sb_detect_vertex_collisionCached().
| int isect_point_tri_v2 | ( | const float | pt[2], |
| const float | v1[2], | ||
| const float | v2[2], | ||
| const float | v3[2] ) |
Definition at line 1543 of file math_geom.cc.
References line_point_side_v2(), and v2.
Referenced by dynamic_paint_create_uv_surface_direct_cb(), isect_point_tri_v2_int(), layer_bucket_isect_test(), M_Geometry_intersect_point_tri_2d(), maskrasterize_layer_isect(), overlap_tri_tri_uv_test(), project_bucket_face_isect(), project_paint_face_init(), project_paint_occlude_ptv(), project_paint_PickFace(), psys_particle_dm_face_lookup(), TEST(), ui_mouse_motion_towards_check(), and blender::compositor::PlaneDistortMaskOperation::update_memory_buffer_partial().
| bool isect_point_tri_v2_cw | ( | const float | pt[2], |
| const float | v1[2], | ||
| const float | v2[2], | ||
| const float | v3[2] ) |
Only single direction.
Definition at line 1527 of file math_geom.cc.
References line_point_side_v2(), and v2.
Referenced by bm_loop_collapse_is_degenerate(), and maskrasterize_layer_isect().
Definition at line 3336 of file math_geom.cc.
References b, float, isect_point_tri_v2(), and v2.
| 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] ) |
| r_isect_co | The point p projected onto the triangle. |
Definition at line 3422 of file math_geom.cc.
References BLI_assert, closest_to_plane_v3(), cross_tri_v3(), isect_point_tri_prism_v3(), len_squared_v3(), plane_from_point_normal_v3(), and v2.
Referenced by bm_isect_tri_tri(), and M_Geometry_intersect_point_tri().
| bool isect_ray_aabb_v3 | ( | const struct IsectRayAABB_Precalc * | data, |
| const float | bb_min[3], | ||
| const float | bb_max[3], | ||
| float * | r_tmin ) |
Referenced by blender::bke::pbvh::clip_ray_ortho(), and blender::bke::pbvh::ray_aabb_intersect().
| void isect_ray_aabb_v3_precalc | ( | struct IsectRayAABB_Precalc * | data, |
| const float | ray_origin[3], | ||
| const float | ray_direction[3] ) |
Definition at line 3084 of file math_geom.cc.
References copy_v3_v3().
Referenced by blender::bke::pbvh::clip_ray_ortho(), and blender::bke::pbvh::raycast().
| 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 ) |
Test a bounding box (AABB) for ray intersection. Assumes the ray is already local to the boundbox space.
Definition at line 3151 of file math_geom.cc.
References double(), and float.
Referenced by raycastMesh().
| 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 ) |
Definition at line 2053 of file math_geom.cc.
References cross_v3_v3v3(), dot_v3v3(), len_squared_v3(), and sub_v3_v3v3().
Referenced by closest_ray_to_segment_v3(), dist_squared_ray_to_seg_v3(), knife_closest_constrain_to_edge(), and SnapData::snap_edge_points_impl().
| bool isect_ray_plane_v3 | ( | const float | ray_origin[3], |
| const float | ray_direction[3], | ||
| const float | plane[4], | ||
| float * | r_lambda, | ||
| bool | clip ) |
Definition at line 1742 of file math_geom.cc.
References isect_ray_plane_v3_factor(), and plane_to_point_vector_v3().
Referenced by ED_view3d_win_to_3d_on_plane(), knifetool_raycast_planes(), blender::ed::greasepencil::DrawingPlacement::reproject(), and snap_grid().
| bool isect_ray_plane_v3_factor | ( | const float | ray_origin[3], |
| const float | ray_direction[3], | ||
| const float | plane_co[3], | ||
| const float | plane_no[3], | ||
| float * | r_lambda ) |
if clip is nonzero, will only return true if lambda is >= 0.0 (i.e. intersection point is along positive ray_direction)
Definition at line 1726 of file math_geom.cc.
References dot(), dot_v3v3(), and sub_v3_v3v3().
Referenced by add_vertex_invoke(), constraint_snap_plane_to_edge(), ED_view3d_win_to_3d(), gizmo_arrow_modal(), isect_ray_plane_v3(), knife_snap_angle_relative(), planeProjection(), transform_constraint_snap_axis_to_face(), and update_location_for_2d_curve().
| 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], | ||
| float | epsilon, | ||
| float * | r_lambda_a, | ||
| float * | r_lambda_b ) |
Check if two rays are not parallel and returns a factor that indicates the distance from ray_origin_b to the closest point on ray-a to ray-b.
Definition at line 3023 of file math_geom.cc.
References BLI_assert, cross_v3_v3v3(), dot_v3v3(), len_squared_v3(), sub_v3_v3v3(), and UNLIKELY.
Referenced by bm_edgexedge_isect_cb(), and isect_ray_ray_v3().
| 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 ) |
Definition at line 3059 of file math_geom.cc.
References isect_ray_ray_epsilon_v3().
Referenced by axisProjection(), bm_vert_pair_share_splittable_face_cb(), and transform_constraint_snap_axis_to_edge().
| 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 ) |
Definition at line 2007 of file math_geom.cc.
References cross_v2v2(), dot_v2v2(), sub_v2_v2v2(), and v.
Referenced by bm_loop_uv_calc_opposite_co(), bvhtree_test_edges_isect_2d_ray_cb(), and test_edges_isect_2d_ray().
| 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], | ||
| float | epsilon ) |
Definition at line 1759 of file math_geom.cc.
References cross_v3_v3v3(), dot_v3v3(), sub_v3_v3v3(), v, and v2.
Referenced by bmbvh_ray_cast_cb(), bvhtree_ray_tri_intersection(), knife_bvh_raycast_cb(), knife_ray_intersect_face(), and raycast_callback().
| 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 ) |
| 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] ) |
Test if the ray starting at p1 going in d direction intersects the triangle v0..v2 return non zero if it does.
Definition at line 1675 of file math_geom.cc.
References cross_v3_v3v3(), dot_v3v3(), sub_v3_v3v3(), v, and v2.
Referenced by bmbvh_ray_cast_cb(), bvh_callback(), compute_collision_point_edge_tri(), compute_collision_point_tri_tri(), distribute_from_volume_exec(), isect_ray_poly(), and knife_bvh_raycast_cb().
| 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] ) |
Referenced by bmbvh_ray_cast_cb(), bvh_callback(), bvhtree_ray_tri_intersection(), blender::ed::sculpt_paint::cloth::cloth_brush_collision_cb(), distribute_grid(), harmonic_ray_callback(), knife_bvh_raycast_cb(), blender::bke::pbvh::ray_face_intersection_quad(), blender::bke::pbvh::ray_face_intersection_tri(), and raycast_callback().
| void isect_ray_tri_watertight_v3_precalc | ( | struct IsectRayPrecalc * | isect_precalc, |
| const float | ray_direction[3] ) |
Definition at line 1808 of file math_geom.cc.
References axis_dominant_v3_single(), IsectRayPrecalc::kx, IsectRayPrecalc::ky, IsectRayPrecalc::kz, IsectRayPrecalc::sx, IsectRayPrecalc::sy, and IsectRayPrecalc::sz.
Referenced by bvhtree_ray_cast_data_precalc(), blender::ed::sculpt_paint::cloth::cloth_brush_solve_collision(), distribute_grid(), isect_ray_tri_watertight_v3_simple(), blender::ed::sculpt_paint::dyntopo::sample_detail_dyntopo(), SCULPT_cursor_geometry_info_update(), SCULPT_stroke_get_location_ex(), and SCULPT_vertex_is_occluded().
| 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] ) |
Slower version which calculates IsectRayPrecalc each time.
Definition at line 1911 of file math_geom.cc.
References isect_ray_tri_watertight_v3(), isect_ray_tri_watertight_v3_precalc(), and v2.
Intersect Line-Line, floats.
Definition at line 1141 of file math_geom.cc.
References float, ISECT_LINE_LINE_COLINEAR, ISECT_LINE_LINE_CROSS, ISECT_LINE_LINE_EXACT, ISECT_LINE_LINE_NONE, and v2.
Referenced by BM_face_splits_check_legal(), blender::ed::sculpt_paint::greasepencil::compute_auto_flip(), is_quad_convex_v2(), lineart_main_discard_out_of_frame_edges(), and project_bucket_face_isect().
Intersect Line-Line, integer.
Definition at line 1096 of file math_geom.cc.
References float, ISECT_LINE_LINE_COLINEAR, ISECT_LINE_LINE_CROSS, ISECT_LINE_LINE_EXACT, ISECT_LINE_LINE_NONE, and v2.
Referenced by BLI_lasso_is_edge_inside().
| 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 ) |
If intersection == ISECT_LINE_LINE_CROSS or ISECT_LINE_LINE_NONE:
pt = v1 + lambda * (v2 - v1) = v3 + mu * (v4 - v3)
Definition at line 1348 of file math_geom.cc.
References fabs(), ISECT_LINE_LINE_COLINEAR, ISECT_LINE_LINE_CROSS, ISECT_LINE_LINE_EXACT, ISECT_LINE_LINE_NONE, and v2.
Referenced by seq_retiming_line_segments_tangent_circle().
| 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] ) |
Definition at line 1329 of file math_geom.cc.
References isect_seg_seg_v2_point_ex(), and v2.
Referenced by feather_bucket_check_intersect(), lineart_chain_create_crossing_point(), blender::ed::space_node::link_path_intersection(), M_Geometry_intersect_line_line_2d(), scanfill_preprocess_self_isect(), and uv_image_outset().
| int isect_seg_seg_v2_point_ex | ( | const float | v0[2], |
| const float | v1[2], | ||
| const float | v2[2], | ||
| const float | v3[2], | ||
| float | endpoint_bias, | ||
| float | r_vi[2] ) |
Get intersection point of two 2D segments.
| endpoint_bias | Bias to use when testing for end-point overlap. A positive value considers intersections that extend past the endpoints, negative values contract the endpoints. Note the bias is applied to a 0-1 factor, not scaled to the length of segments. |
Definition at line 1228 of file math_geom.cc.
References copy_v2_v2(), cross_v2v2(), dot_v2v2(), eps, equals_v2v2(), len_squared_v2v2(), line_point_factor_v2(), madd_v2_v2v2fl(), max_ff(), min_ff(), square_f(), sub_v2_v2v2(), v, and v2.
Referenced by edge_isect_verts_point_2d(), isect_seg_seg_v2_point(), knife_find_line_hits(), and overlap_tri_tri_uv_test().
| bool isect_seg_seg_v2_simple | ( | const float | v1[2], |
| const float | v2[2], | ||
| const float | v3[2], | ||
| const float | v4[2] ) |
Definition at line 1336 of file math_geom.cc.
Referenced by closest_seg_seg_v2(), dist_seg_seg_v2(), feather_bucket_check_intersect(), and uv_image_outset().
| 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] ) |
Returns a point on each segment that is closest to the other.
Definition at line 1163 of file math_geom.cc.
References CLAMP, cross_v3_v3v3(), dot_v3v3(), len_squared_v3(), madd_v3_v3v3fl(), and sub_v3_v3v3().
Referenced by compute_collision_point_edge_tri(), compute_collision_point_tri_tri(), and blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_spherical().
| bool isect_sweeping_sphere_tri_v3 | ( | const float | p1[3], |
| const float | p2[3], | ||
| float | radius, | ||
| const float | v0[3], | ||
| const float | v1[3], | ||
| const float | v2[3], | ||
| float * | r_lambda, | ||
| float | ipoint[3] ) |
Definition at line 2653 of file math_geom.cc.
References add_v3_v3(), b, CLAMP, copy_v3_v3(), cross_v3_v3v3(), dot_v3v3(), e, fabsf, getLowestRoot(), mul_v3_fl(), negate_v3(), nor, normalize_v3(), sub_v3_v3v3(), v2, x, y, and z().
Referenced by bvhtree_sphereray_tri_intersection(), and particle_intersect_mesh().
| 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] ) |
Definition at line 2568 of file math_geom.cc.
References isect_tri_tri_impl_ccw_v2(), and line_point_side_v2().
Referenced by M_Geometry_intersect_tri_tri_2d(), and blender::geometry::OverlapMerger::overlap().
| 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] ) |
Definition at line 2394 of file math_geom.cc.
References copy_v3_v3(), and isect_tri_tri_v3_ex().
Referenced by bmbvh_overlap_cb(), blender::draw::bvh_overlap_cb(), and py_bvhtree_overlap_cb().
| 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 ) |
Intersect two triangles.
| r_i1,r_i2 | Retrieve the overlapping edge between the 2 triangles. |
| r_tri_a_edge_isect_count | Indicates how many edges in the first triangle are intersected. |
Definition at line 2255 of file math_geom.cc.
References copy_v3_v3(), cross_v3_v3v3_db(), dot_v3db_v3fl(), float, interp_v3_v3v3(), max, min, and sub_v3db_v3fl_v3fl().
Referenced by compute_collision_point_tri_tri(), and isect_tri_tri_v3().
Ensure the distance between these points is no greater than 'dist'. If it is, scale them both into the center.
Definition at line 3319 of file math_geom.cc.
References copy_v3_v3(), interp_v3_v3v3(), len_v3v3(), and v2.
| float line_plane_factor_v3 | ( | const float | plane_co[3], |
| const float | plane_no[3], | ||
| const float | l1[3], | ||
| const float | l2[3] ) |
Definition at line 3306 of file math_geom.cc.
References dot(), dot_v3v3(), and sub_v3_v3v3().
Referenced by blender::find_plane_intersection().
Definition at line 3301 of file math_geom.cc.
References line_point_factor_v2_ex().
Referenced by bvhtree_test_edges_isect_2d_vert_cb(), facetag_cut_cost_edge_uv(), find_nearest_edge__doClosest(), gizmo_ruler_invoke(), gradientVert_update(), interp_weights_poly_v2(), isect_seg_seg_v2_point_ex(), M_Geometry_intersect_line_sphere_2d(), project_paint_face_init(), screen_px_line_point_factor_v2_persp(), and test_edges_isect_2d_vert().
| float line_point_factor_v2_ex | ( | const float | p[2], |
| const float | l1[2], | ||
| const float | l2[2], | ||
| float | epsilon, | ||
| float | fallback ) |
Definition at line 3286 of file math_geom.cc.
References dot(), dot_v2v2(), len_squared_v2(), and sub_v2_v2v2().
Referenced by line_point_factor_v2().
Definition at line 3281 of file math_geom.cc.
References line_point_factor_v3_ex().
Referenced by BKE_mesh_remap_calc_edges_from_mesh(), BKE_mesh_remap_calc_verts_from_mesh(), bm_decim_edge_collapse(), bm_face_split_edge_find(), bm_isect_tri_tri(), bm_loop_calc_opposite_co(), BM_mesh_intersect(), blender::bke::pbvh::clip_ray_ortho(), edbm_polybuild_face_at_cursor_invoke(), edbm_polybuild_split_at_cursor_invoke(), edge_slide_snap_apply(), facetag_cut_cost_edge(), hair_collision(), interp_line_v3_v3v3v3(), interp_weights_poly_v3(), intersect_line_tri(), knife_make_cuts(), M_Geometry_intersect_line_sphere(), mesh_edges_spherecast(), remap_hair_emitter(), SnapData::snap_edge_points_impl(), transdata_elem_bend(), transform_point_by_seg_v3(), and vert_slide_snap_apply().
| float line_point_factor_v3_ex | ( | const float | p[3], |
| const float | l1[3], | ||
| const float | l2[3], | ||
| float | epsilon, | ||
| float | fallback ) |
A simplified version of closest_to_line_v3 we only need to return the lambda
| epsilon | avoid approaching divide-by-zero. Passing a zero will just check for nonzero division. |
Definition at line 3266 of file math_geom.cc.
References dot(), dot_v3v3(), len_squared_v3(), and sub_v3_v3v3().
Referenced by line_point_factor_v3().
| void lookat_m4 | ( | float | mat[4][4], |
| float | vx, | ||
| float | vy, | ||
| float | vz, | ||
| float | px, | ||
| float | py, | ||
| float | pz, | ||
| float | twist ) |
Definition at line 4797 of file math_geom.cc.
References axis_angle_to_mat4_single(), i_multmatrix(), sqrtf, translate_m4(), and unit_m4().
| void map_to_plane_axis_angle_v2_v3v3fl | ( | float | r_co[2], |
| const float | co[3], | ||
| const float | axis[3], | ||
| float | angle ) |
Definition at line 4999 of file math_geom.cc.
References copy_v2_v2(), and rotate_normalized_v3_v3v3fl().
Referenced by computeBindWeights(), and map_to_plane_v2_v3v3().
Definition at line 4988 of file math_geom.cc.
References angle_normalized_v3v3(), cross_v3_v3v3(), map_to_plane_axis_angle_v2_v3v3fl(), and normalize_v3().
Definition at line 4971 of file math_geom.cc.
References atan2f, fabsf, M_PI, snap_coordinate(), sqrtf, and z().
Referenced by do_2d_mapping(), MikkMeshWrapper< is_subd >::GetTexCoord(), SGLSLEditMeshToTangent::GetTexCoord(), SGLSLMeshToTangent::GetTexCoord(), point_light_mnee_sample_update(), point_light_sample(), point_light_sample_from_intersection(), psys_interpolate_face(), svm_node_tex_image(), and uv_sphere_project().
Definition at line 4956 of file math_geom.cc.
References atan2f, M_PI, snap_coordinate(), and z().
Referenced by do_2d_mapping(), svm_node_tex_image(), and uv_cylinder_project().
Definition at line 101 of file math_geom_inline.c.
References z().
Referenced by blender::compositor::KeyingDespillOperation::update_memory_buffer_partial(), and blender::compositor::KeyingOperation::update_memory_buffer_partial().
Definition at line 109 of file math_geom_inline.c.
References z().
Referenced by view3d_ruler_pick().
Computes the normal of a planar polygon See Graphics Gems for computing newell normal.
Definition at line 77 of file math_geom.cc.
References cross_poly_v3(), normalize_v3(), and verts.
Referenced by computeBindWeights(), deformVert(), and M_Geometry_normal().
| float normal_quad_v3 | ( | float | n[3], |
| const float | v1[3], | ||
| const float | v2[3], | ||
| const float | v3[3], | ||
| const float | v4[3] ) |
Definition at line 56 of file math_geom.cc.
References normalize_v3(), and v2.
Referenced by BM_face_calc_normal(), BM_face_calc_normal_vcos(), BM_verts_calc_normal_from_cloud_ex(), bmesh_calc_tessellation_for_face_impl(), blender::bke::pbvh::calc_grids_intersect_data(), connect_frames(), end_node_frames(), blender::bke::mesh::face_normal_calc(), blender::draw::pbvh::fill_vbo_normal_grids(), SGLSLMeshToTangent::GetNormal(), make_face(), psys_interpolate_face(), quad_co(), and skin_hole_target_face().
Definition at line 39 of file math_geom.cc.
References normalize_v3(), and v2.
Referenced by bindVert(), bm_edge_calc_rotate_beauty__angle(), bm_edge_collapse_is_degenerate_flip(), BM_face_calc_normal(), BM_face_calc_normal_vcos(), bm_isect_tri_tri(), BM_verts_calc_normal_from_cloud_ex(), bmesh_calc_tessellation_for_face_impl(), bmo_edgenet_prepare_exec(), bvh_callback(), C_BVHTree_FromPolygons(), blender::bke::pbvh::calc_mesh_intersect_data(), cloth_bend_poly_dir(), blender::ed::sculpt_paint::cloth::cloth_brush_collision_cb(), compute_collision_point_edge_tri(), compute_collision_point_tri_tri(), blender::nodes::node_geo_distribute_points_on_faces_cc::compute_legacy_normal_outputs(), blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_points(), dynamic_paint_paint_mesh_cell_point_cb_ex(), ED_view3d_clipping_calc_from_boundbox(), SGLSLMeshToTangent::GetNormal(), getTransformOrientation_ex(), harmonic_ray_callback(), heat_calc_vnormals(), initLaplacianMatrix(), Freestyle::BlenderFileLoader::insertShapeNode(), interp_weights_tri_v3(), knife_ray_intersect_face(), blender::ed::sculpt_paint::gesture::line_calculate_plane_points(), blender::ed::sculpt_paint::gesture::line_plane_from_tri(), lineart_load_tri_task(), make_face(), mesh_corner_tris_nearest_point(), mesh_corner_tris_spherecast(), mesh_faces_nearest_point(), mesh_faces_spherecast(), blender::bke::pbvh::node_raycast_bmesh(), poly_norm(), project_paint_uvpixel_mask(), psys_interpolate_face(), py_bvhtree_nearest_point_cb(), py_bvhtree_nearest_point_range_cb(), py_bvhtree_raycast_cb(), quad_calc_error(), rotateDifferentialCoordinates(), blender::bke::mesh_surface_sample::sample_surface_points_spherical(), blender::draw::statvis_calc_distort(), blender::draw::statvis_calc_thickness(), transform_point_by_tri_v3(), tri_to_quat(), tri_to_quat_ex(), triatomat(), view3d_boxview_clip(), and blender::ed::object::voxel_size_edit_invoke().
| void orthographic_m4 | ( | float | mat[4][4], |
| float | left, | ||
| float | right, | ||
| float | bottom, | ||
| float | top, | ||
| float | nearClip, | ||
| float | farClip ) |
Matches glOrtho result.
Definition at line 4532 of file math_geom.cc.
References left, and unit_m4().
Referenced by blender::draw::image_engine::ImageEngine< DrawingMode >::begin_sync(), BKE_camera_params_compute_matrix(), blender::ed::greasepencil::image_render::compute_view_matrices(), ED_view3d_draw_offscreen_imbuf(), blender::draw::test_draw_resource_id_gen(), blender::draw::test_draw_visibility(), and wmGetProjectionMatrix().
| void perspective_m4 | ( | float | mat[4][4], |
| float | left, | ||
| float | right, | ||
| float | bottom, | ||
| float | top, | ||
| float | nearClip, | ||
| float | farClip ) |
Matches glFrustum result.
Definition at line 4557 of file math_geom.cc.
References left.
Referenced by BKE_camera_params_compute_matrix(), BKE_tracking_get_projection_matrix(), blender::ed::greasepencil::image_render::compute_view_matrices(), blender::eevee::cubeface_winmat_get(), ED_view3d_draw_offscreen_imbuf(), and perspective_m4_fov().
| void perspective_m4_fov | ( | float | mat[4][4], |
| float | angle_left, | ||
| float | angle_right, | ||
| float | angle_up, | ||
| float | angle_down, | ||
| float | nearClip, | ||
| float | farClip ) |
Definition at line 4583 of file math_geom.cc.
References perspective_m4(), and tanf.
Referenced by wm_xr_draw_matrices_create().
| void plane_from_point_normal_v3 | ( | float | r_plane[4], |
| const float | plane_co[3], | ||
| const float | plane_no[3] ) |
Calculate a plane from a point and a direction,
Definition at line 215 of file math_geom.cc.
References copy_v3_v3(), and dot_v3v3().
Referenced by BKE_mesh_mirror_bisect_on_mirror_plane_for_modifier(), bmo_bisect_plane_exec(), bmo_planar_faces_exec(), build_boundary_terminal_edge(), blender::ed::sculpt_paint::calc_brush_distances_squared(), blender::ed::sculpt_paint::calc_brush_distances_squared(), calc_initial_placement_point_from_view(), blender::ed::sculpt_paint::pose::calc_scale_from_grab_delta(), blender::ed::sculpt_paint::trim::calculate_depth(), camera_frame_fit_calc_from_data(), blender::ed::sculpt_paint::cloth::cloth_brush_apply_brush_foces(), blender::ed::sculpt_paint::cloth::cloth_brush_solve_collision(), blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_points(), blender::nodes::node_geo_curve_primitive_circle_cc::create_point_circle_curve(), dial_ghostarc_get_angles(), blender::ed::sculpt_paint::boundary::displacement_from_grab_delta_get(), dist_signed_squared_to_corner_v3v3v3(), blender::ed::sculpt_paint::do_clay_brush(), blender::ed::sculpt_paint::do_clay_strips_brush(), blender::ed::sculpt_paint::do_clay_thumb_brush(), blender::ed::sculpt_paint::do_multiplane_scrape_brush(), draw_primitive_view_impl(), blender::ed::greasepencil::DrawingPlacement::DrawingPlacement(), blender::ed::greasepencil::DrawingPlacement::DrawingPlacement(), face_to_plane(), font_cursor_text_index_from_event(), blender::ed::sculpt_paint::trim::generate_geometry(), gizmo_3d_dial_matrixbasis_calc(), gizmo_mesh_spin_redo_setup(), gizmo_window_project_2d(), gpencil_depth_plane(), interp_slerp_co_no_v3(), isect_point_tri_v3(), knife_find_line_hits(), knife_ray_intersect_face(), blender::ed::sculpt_paint::gesture::line_plane_from_tri(), M_Geometry_distance_point_to_plane(), M_Geometry_intersect_plane_plane(), modify_mesh(), occlusion_plane_create(), offset_meet(), blender::ed::greasepencil::DrawingPlacement::set_origin_to_nearest_stroke(), snap_object_context_runtime_init(), snap_to_pipe_profile(), blender::ed::sculpt_paint::smooth::translation_to_plane(), UNUSED_FUNCTION(), v3d_cursor_snap_update(), view3d_interactive_add_begin(), and view3d_interactive_add_modal().
Definition at line 123 of file math_geom_inline.c.
References dot_v3v3().
Referenced by BKE_mesh_mirror_bisect_on_mirror_plane_for_modifier(), bmo_bisect_plane_exec(), camera_to_frame_view_cb(), clip_segment_v3_plane(), clip_segment_v3_plane_n(), closest_to_plane_normalized_v3(), closest_to_plane_v3(), dist_signed_squared_to_plane_v3(), dist_signed_to_plane_v3(), dist_squared_to_plane_v3(), draw_culling_box_test(), draw_culling_plane_test(), draw_culling_sphere_test(), DRW_culling_min_max_test(), blender::ed::sculpt_paint::filter_above_plane_factors(), blender::ed::sculpt_paint::filter_above_plane_factors(), blender::ed::sculpt_paint::filter_below_plane_factors(), blender::ed::sculpt_paint::filter_below_plane_factors(), blender::ed::sculpt_paint::filter_plane_side_factors(), blender::ed::sculpt_paint::gesture::is_affected(), isect_aabb_planes_v3(), isect_point_planes_v3(), isect_point_planes_v3_negated(), plane_point_test_v3(), tree_intersect_plane_test(), and view3d_clipping_test().
Get a point and a direction from a plane.
Definition at line 221 of file math_geom.cc.
References copy_v3_v3(), len_squared_v3(), and mul_v3_v3fl().
Referenced by isect_ray_plane_v3().
| void plane_to_point_vector_v3_normalized | ( | const float | plane[4], |
| float | r_plane_co[3], | ||
| float | r_plane_no[3] ) |
Version of plane_to_point_vector_v3 that gets a unit length vector.
Definition at line 227 of file math_geom.cc.
References mul_v3_v3fl(), and normalize_v3_v3().
| 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] ) |
Frustum planes extraction from a projection matrix (homogeneous 4d vector representations of planes).
plane parameters can be NULL if you do not need them.
Definition at line 4630 of file math_geom.cc.
Referenced by BLI_bvhtree_find_nearest_projected(), camera_frame_fit_data_init(), content_planes_from_clip_flag(), draw_frustum_culling_planes_calc(), blender::draw::View::frustum_culling_planes_calc(), knifetool_raycast_planes(), and snap_object_context_runtime_init().
Definition at line 3396 of file math_geom.cc.
References point_in_slice_as(), and sub_v3_v3v3().
Referenced by compute_collision_point_edge_tri(), and compute_collision_point_tri_tri().
Definition at line 4787 of file math_geom.cc.
References rotate_m4(), translate_m4(), and unit_m4().
Simple function to either:
| poly_count | The number of polygons or polygon-index (3+ sided faces, 1-2 sided give incorrect results). |
| corner_count | The number of corners (also called loop-index). |
Definition at line 117 of file math_geom_inline.c.
References BLI_assert.
Referenced by blender::draw::accumululate_material_counts_mesh(), blender::ed::sculpt_paint::trim::apply_trim(), blender::ed::object::bake_targets_populate_pixels_color_attributes(), BKE_editmesh_looptris_calc_ex(), BKE_editmesh_looptris_calc_with_partial_ex(), BKE_mesh_runtime_corner_tris_len(), bm_mesh_calc_tessellation__single_threaded(), BM_mesh_calc_tessellation_beauty(), BMD_mesh_intersection(), bpy_bmesh_calc_loop_triangles(), C_BVHTree_FromBMesh(), blender::draw::pbvh::create_tri_index_mesh(), createTransEditVerts(), blender::render::texturemargin::generate_margin(), heat_bone_weighting(), Freestyle::BlenderFileLoader::insertShapeNode(), blender::geometry::boolean::mesh_bm_concat(), mesh_calc_tri_tessface(), mesh_faces_to_scratch(), blender::draw::mesh_render_data_create(), mesh_tessface_calc(), RE_bake_pixels_populate(), and stats_mesheval().
| 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 ) |
Definition at line 4683 of file math_geom.cc.
Referenced by draw_frustum_boundbox_calc(), blender::eevee::VolumeModule::draw_prepass(), and blender::draw::View::frustum_boundbox_calc().
| 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 ) |
Definition at line 4711 of file math_geom.cc.
References copy_m4d_m4().
| void projmat_from_subregion | ( | const float | projmat[4][4], |
| const int | win_size[2], | ||
| int | x_min, | ||
| int | x_max, | ||
| int | y_min, | ||
| int | y_max, | ||
| float | r_projmat[4][4] ) |
Creates a projection matrix for a small region of the viewport.
| projmat | Projection Matrix. |
| win_size | Viewport Size. |
| x_min,x_max,y_min,y_max | Coordinates of the subregion. |
Definition at line 4742 of file math_geom.cc.
References copy_m4_m4(), float, rect_height(), and rect_width().
| float ray_point_factor_v3 | ( | const float | p[3], |
| const float | ray_origin[3], | ||
| const float | ray_direction[3] ) |
Definition at line 3259 of file math_geom.cc.
References ray_point_factor_v3_ex().
Referenced by ED_view3d_win_to_3d().
| float ray_point_factor_v3_ex | ( | const float | p[3], |
| const float | ray_origin[3], | ||
| const float | ray_direction[3], | ||
| float | epsilon, | ||
| float | fallback ) |
Definition at line 3247 of file math_geom.cc.
References dot(), dot_v3v3(), len_squared_v3(), and sub_v3_v3v3().
Referenced by bm_edgexvert_isect_cb(), and ray_point_factor_v3().
| 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] ) |
A version of resolve_quad_uv_v2 that only calculates the 'u'.
Definition at line 4457 of file math_geom.cc.
References b, double(), float, IS_ZERO, and sqrt().
Referenced by project_paint_face_init().
| 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] ) |
Bilinear reverse.
Definition at line 4359 of file math_geom.cc.
References resolve_quad_uv_v2_deriv().
Referenced by apply_heights_callback(), apply_tangmat_callback(), and quad_co().
| 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] ) |
Bilinear reverse with derivatives.
Definition at line 4369 of file math_geom.cc.
References b, double(), fabs(), float, interp_v2_v2v2(), IS_ZERO, sqrt(), sub_v2_v2v2(), and zero_v2().
Referenced by resolve_quad_uv_v2().
| 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] ) |
Barycentric reverse
Compute coordinates (u, v) for point st with respect to triangle (st0, st1, st2)
Definition at line 4306 of file math_geom.cc.
References b, float, IS_ZERO, and zero_v2().
Referenced by apply_heights_callback(), apply_tangmat_callback(), and flush_pixel().
| 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] ) |
Barycentric reverse 3d
Compute coordinates (u, v) for point st with respect to triangle (st0, st1, st2)
Definition at line 4328 of file math_geom.cc.
References dot_v3v3(), float, IS_ZERO, sub_v3_v3v3(), v2, w(), and zero_v2().
Useful to calculate an even width shell, by taking the angle between 2 planes. The return value is a scale on the offset. no angle between planes is 1.0, as the angle between the 2 planes approaches 180d the distance gets very high, 180d would be inf, but this case isn't valid.
Definition at line 128 of file math_geom_inline.c.
References cosf, fabsf, SMALL_NUMBER, and UNLIKELY.
Referenced by Bend(), and BM_mesh_wireframe().
Equivalent to shell_angle_to_dist(angle_normalized_v2v2(a, b) / 2).
Definition at line 158 of file math_geom_inline.c.
References add_v2_v2v2(), b, BLI_ASSERT_UNIT_V2, dot_v2v2(), fabsf, normalize_v2(), SMALL_NUMBER, and UNLIKELY.
Equivalent to shell_angle_to_dist(angle_normalized_v2v2(a, b)).
Definition at line 139 of file math_geom_inline.c.
References b, BLI_ASSERT_UNIT_V2, dot_v2v2(), fabsf, SMALL_NUMBER, and UNLIKELY.
Equivalent to shell_angle_to_dist(angle_normalized_v3v3(a, b) / 2).
Definition at line 147 of file math_geom_inline.c.
References add_v3_v3v3(), b, BLI_ASSERT_UNIT_V3, dot_v3v3(), fabsf, normalize_v3(), SMALL_NUMBER, and UNLIKELY.
Referenced by alter_co(), bmo_face_inset_individual(), and bmo_inset_region_exec().
Equivalent to shell_angle_to_dist(angle_normalized_v3v3(a, b)).
Definition at line 132 of file math_geom_inline.c.
References b, BLI_ASSERT_UNIT_V3, dot_v3v3(), fabsf, SMALL_NUMBER, and UNLIKELY.
Referenced by BM_vert_calc_shell_factor(), BM_vert_calc_shell_factor_ex(), bmo_inset_region_exec(), MOD_solidify_extrude_modifyMesh(), and solidify_add_thickness().
| 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] ) |
Definition at line 5131 of file math_geom.cc.
References cross_v3_v3v3(), dot_v3v3(), negate_v3(), sub_v3_v3v3(), and zero_v3().
| 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] ) |
Simply re-interpolates, assumes p_src is between l_src_p1-l_src_p2
Definition at line 3932 of file math_geom.cc.
References interp_v3_v3v3(), and line_point_factor_v3().
Referenced by knife_linehit_set().
| 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] ) |
Given 2 triangles in 3D space, and a point in relation to the first triangle. calculate the location of a point in relation to the second triangle. Useful for finding relative positions with geometry.
Definition at line 3888 of file math_geom.cc.
References area_tri_v2(), area_tri_v3(), axis_dominant_v3_to_m3(), barycentric_weights_v2(), interp_v3_v3v3v3(), madd_v3_v3v3fl(), mul_v3_m3v3(), normal_tri_v3(), and sqrtf.
Referenced by BKE_mesh_calc_relative_deform(), bm_edgering_pair_interpolate(), bm_grid_fill_array(), and M_Geometry_barycentric_transform().
| void vcloud_estimate_transform_v3 | ( | 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] ) |
Input:
| list_size | 4 lists as pointer to array[list_size] |
| pos | current pos array of 'new' positions |
| weight | current weight array of 'new'weights (may be NULL pointer if you have no weights) |
| rpos | Reference rpos array of 'old' positions |
| rweight | Reference rweight array of 'old'weights (may be NULL pointer if you have no weights). |
Output:
| lloc | Center of mass pos. |
| rloc | Center of mass rpos. |
| lrot | Rotation matrix. |
| lscale | Scale matrix. |
pointers may be NULL if not needed
Definition at line 5177 of file math_geom.cc.
References add_m3_m3m3(), add_v3_v3(), copy_m3_m3(), copy_v3_v3(), determinant_m3_array(), eps, float, invert_m3_m3(), len_v3(), mul_m3_fl(), mul_m3_m3m3(), mul_v3_fl(), pos, sub_v3_v3v3(), transpose_m3(), unit_m3(), v, zero_m3(), and zero_v3().
Referenced by SB_estimate_transform().
| float volume_tetrahedron_signed_v3 | ( | const float | v1[3], |
| const float | v2[3], | ||
| const float | v3[3], | ||
| const float | v4[3] ) |
The volume from a tetrahedron, normal pointing inside gives negative volume
Definition at line 249 of file math_geom.cc.
References determinant_m3_array(), sub_v3_v3v3(), and v2.
Referenced by BKE_mesh_calc_volume(), and compute_volume().
| float volume_tetrahedron_v3 | ( | const float | v1[3], |
| const float | v2[3], | ||
| const float | v3[3], | ||
| const float | v4[3] ) |
The volume from a tetrahedron, points can be in any order
Definition at line 237 of file math_geom.cc.
References determinant_m3_array(), fabsf, sub_v3_v3v3(), and v2.
Referenced by M_Geometry_volume_tetrahedron().
Definition at line 269 of file math_geom.cc.
References v2, and volume_tri_tetrahedron_signed_v3_6x().
| float volume_tri_tetrahedron_signed_v3_6x | ( | const float | v1[3], |
| const float | v2[3], | ||
| const float | v3[3] ) |
The volume from a triangle that is made into a tetrahedron. This uses a simplified formula where the tip of the tetrahedron is in the world origin. Using this method, the total volume of a closed triangle mesh can be calculated. Note that you need to divide the result by 6 to get the actual volume.
Definition at line 261 of file math_geom.cc.
References cross_v3_v3v3(), dot_v3v3(), and v2.
Referenced by cloth_calc_rest_volume(), mesh_calc_face_volume_centroid(), blender::bke::mesh::mesh_calc_face_volume_centroid_with_reference_center(), SIM_tri_tetra_volume_signed_6x(), and volume_tri_tetrahedron_signed_v3().
Translate a matrix created by orthographic_m4 or perspective_m4 in XY coords (used to jitter the view).
Definition at line 4602 of file math_geom.cc.
References len_v3(), v2, x, and y.
Referenced by blender::workbench::AntiAliasingPass::setup_view().