Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt.c
| Show First 20 Lines • Show All 4,686 Lines • ▼ Show 20 Lines | static float sculpt_raycast_init( | ||||
| float ray_start[3], float ray_end[3], float ray_normal[3], bool original) | float ray_start[3], float ray_end[3], float ray_normal[3], bool original) | ||||
| { | { | ||||
| float obimat[4][4]; | float obimat[4][4]; | ||||
| float dist; | float dist; | ||||
| Object *ob = vc->obact; | Object *ob = vc->obact; | ||||
| RegionView3D *rv3d = vc->ar->regiondata; | RegionView3D *rv3d = vc->ar->regiondata; | ||||
| /* TODO: what if the segment is totally clipped? (return == 0) */ | /* TODO: what if the segment is totally clipped? (return == 0) */ | ||||
| ED_view3d_win_to_segment(vc->ar, vc->v3d, mouse, ray_start, ray_end, true); | ED_view3d_win_to_segment(vc->depsgraph, vc->ar, vc->v3d, mouse, ray_start, ray_end, true); | ||||
| invert_m4_m4(obimat, ob->obmat); | invert_m4_m4(obimat, ob->obmat); | ||||
| mul_m4_v3(obimat, ray_start); | mul_m4_v3(obimat, ray_start); | ||||
| mul_m4_v3(obimat, ray_end); | mul_m4_v3(obimat, ray_end); | ||||
| sub_v3_v3v3(ray_normal, ray_end, ray_start); | sub_v3_v3v3(ray_normal, ray_end, ray_start); | ||||
| dist = normalize_v3(ray_normal); | dist = normalize_v3(ray_normal); | ||||
| ▲ Show 20 Lines • Show All 1,320 Lines • Show Last 20 Lines | |||||