Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_image_proj.c
| Show First 20 Lines • Show All 2,409 Lines • ▼ Show 20 Lines | |||||
| /* limit must be a fraction over 1.0f */ | /* limit must be a fraction over 1.0f */ | ||||
| static bool IsectPT2Df_limit( | static bool IsectPT2Df_limit( | ||||
| const float pt[2], const float v1[2], const float v2[2], const float v3[2], const float limit) | const float pt[2], const float v1[2], const float v2[2], const float v3[2], const float limit) | ||||
| { | { | ||||
| return ((area_tri_v2(pt, v1, v2) + area_tri_v2(pt, v2, v3) + area_tri_v2(pt, v3, v1)) / | return ((area_tri_v2(pt, v1, v2) + area_tri_v2(pt, v2, v3) + area_tri_v2(pt, v3, v1)) / | ||||
| (area_tri_v2(v1, v2, v3))) < limit; | (area_tri_v2(v1, v2, v3))) < limit; | ||||
| } | } | ||||
| /* Clip the face by a bucket and set the uv-space bucket_bounds_uv | /** | ||||
| * Clip the face by a bucket and set the uv-space bucket_bounds_uv | |||||
| * so we have the clipped UV's to do pixel intersection tests with | * so we have the clipped UV's to do pixel intersection tests with | ||||
| * */ | */ | ||||
| static int float_z_sort_flip(const void *p1, const void *p2) | static int float_z_sort_flip(const void *p1, const void *p2) | ||||
| { | { | ||||
| return (((float *)p1)[2] < ((float *)p2)[2] ? 1 : -1); | return (((float *)p1)[2] < ((float *)p2)[2] ? 1 : -1); | ||||
| } | } | ||||
| static int float_z_sort(const void *p1, const void *p2) | static int float_z_sort(const void *p1, const void *p2) | ||||
| { | { | ||||
| return (((float *)p1)[2] < ((float *)p2)[2] ? -1 : 1); | return (((float *)p1)[2] < ((float *)p2)[2] ? -1 : 1); | ||||
| ▲ Show 20 Lines • Show All 4,366 Lines • Show Last 20 Lines | |||||