Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 3,094 Lines • ▼ Show 20 Lines | if (sculpt_brush_test_sq_fn(&test, orig_data.co)) { | ||||
| sqrtf(test.dist), | sqrtf(test.dist), | ||||
| orig_data.no, | orig_data.no, | ||||
| NULL, | NULL, | ||||
| vd.mask ? *vd.mask : 0.0f, | vd.mask ? *vd.mask : 0.0f, | ||||
| vd.index, | vd.index, | ||||
| thread_id); | thread_id); | ||||
| float current_disp[3]; | float current_disp[3]; | ||||
| float current_disp_norm[3]; | float current_disp_norm[3]; | ||||
| float final_disp[3]; | float final_disp[3] = {0.0f, 0.0f, 0.0f}; | ||||
| zero_v3(final_disp); | |||||
| switch (brush->slide_deform_type) { | |||||
| case BRUSH_SLIDE_DEFORM_DRAG: | |||||
| sub_v3_v3v3(current_disp, ss->cache->location, ss->cache->last_location); | sub_v3_v3v3(current_disp, ss->cache->location, ss->cache->last_location); | ||||
| break; | |||||
| case BRUSH_SLIDE_DEFORM_PINCH: | |||||
| sub_v3_v3v3(current_disp, ss->cache->location, vd.co); | |||||
| break; | |||||
| case BRUSH_SLIDE_DEFORM_EXPAND: | |||||
| sub_v3_v3v3(current_disp, vd.co, ss->cache->location); | |||||
| break; | |||||
| } | |||||
| normalize_v3_v3(current_disp_norm, current_disp); | normalize_v3_v3(current_disp_norm, current_disp); | ||||
| mul_v3_v3fl(current_disp, current_disp_norm, ss->cache->bstrength); | mul_v3_v3fl(current_disp, current_disp_norm, ss->cache->bstrength); | ||||
| SculptVertexNeighborIter ni; | SculptVertexNeighborIter ni; | ||||
| SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, vd.index, ni) { | SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, vd.index, ni) { | ||||
| float vertex_disp[3]; | float vertex_disp[3]; | ||||
| float vertex_disp_norm[3]; | float vertex_disp_norm[3]; | ||||
| sub_v3_v3v3(vertex_disp, SCULPT_vertex_co_get(ss, ni.index), vd.co); | sub_v3_v3v3(vertex_disp, SCULPT_vertex_co_get(ss, ni.index), vd.co); | ||||
| normalize_v3_v3(vertex_disp_norm, vertex_disp); | normalize_v3_v3(vertex_disp_norm, vertex_disp); | ||||
| if (dot_v3v3(current_disp_norm, vertex_disp_norm) > 0.0f) { | if (dot_v3v3(current_disp_norm, vertex_disp_norm) > 0.0f) { | ||||
| madd_v3_v3fl(final_disp, vertex_disp_norm, dot_v3v3(current_disp, vertex_disp)); | madd_v3_v3fl(final_disp, vertex_disp_norm, dot_v3v3(current_disp, vertex_disp)); | ||||
| ▲ Show 20 Lines • Show All 5,776 Lines • Show Last 20 Lines | |||||