Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
| Show First 20 Lines • Show All 992 Lines • ▼ Show 20 Lines | |||||
| if (override_cam_is_persp) { | if (override_cam_is_persp) { | ||||
| sub_v3_v3v3_db(Cv, vd4, tri->v[0]->gloc); | sub_v3_v3v3_db(Cv, vd4, tri->v[0]->gloc); | ||||
| } | } | ||||
| dot_l = dot_v3v3_db(Lv, tri->gn); | dot_l = dot_v3v3_db(Lv, tri->gn); | ||||
| dot_r = dot_v3v3_db(Rv, tri->gn); | dot_r = dot_v3v3_db(Rv, tri->gn); | ||||
| dot_f = dot_v3v3_db(Cv, tri->gn); | dot_f = dot_v3v3_db(Cv, tri->gn); | ||||
| if (!dot_f) { | /* FIXME: If we don't use `dot_f==0` here, it's theoretically possibile that _some_ faces in | ||||
zeddb: Update the comment as discussed in blender chat. | |||||
| * perspective mode would get uncaught and produce some %inf results, but haven't encountered | |||||
| * those erroreous ones yet in my test files. */ | |||||
| if (dot_f < FLT_EPSILON && dot_f > -FLT_EPSILON) { | |||||
zeddbUnsubmitted Done Inline ActionsUse fabsf instead. zeddb: Use `fabsf` instead. | |||||
NicksBestAuthorUnsubmitted Done Inline ActionsIt's a double. I use fabs. The tolerance value needs to be FLT_EPSILON (as opposed to DBL_EPSILON) as the error introduced in the original matrix is from a float. NicksBest: It's a double. I use `fabs`. The tolerance value needs to be `FLT_EPSILON` (as opposed to… | |||||
| return false; | return false; | ||||
| } | } | ||||
| if (!a && !b && !c) { | if (!a && !b && !c) { | ||||
| if (!(st_l = lineart_point_triangle_relation(LFBC, FBC0, FBC1, FBC2)) && | if (!(st_l = lineart_point_triangle_relation(LFBC, FBC0, FBC1, FBC2)) && | ||||
| !(st_r = lineart_point_triangle_relation(RFBC, FBC0, FBC1, FBC2))) { | !(st_r = lineart_point_triangle_relation(RFBC, FBC0, FBC1, FBC2))) { | ||||
| return 0; /* Intersection point is not inside triangle. */ | return 0; /* Intersection point is not inside triangle. */ | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 992 Lines • Show Last 20 Lines | |||||
Update the comment as discussed in blender chat.