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 1,585 Lines • ▼ Show 20 Lines | void SCULPT_brush_test_init(SculptSession *ss, SculptBrushTest *test) | ||||
| test->radius_squared = ss->cache ? ss->cache->radius_squared : | test->radius_squared = ss->cache ? ss->cache->radius_squared : | ||||
| ss->cursor_radius * ss->cursor_radius; | ss->cursor_radius * ss->cursor_radius; | ||||
| test->radius = sqrtf(test->radius_squared); | test->radius = sqrtf(test->radius_squared); | ||||
| if (ss->cache) { | if (ss->cache) { | ||||
| copy_v3_v3(test->location, ss->cache->location); | copy_v3_v3(test->location, ss->cache->location); | ||||
| test->mirror_symmetry_pass = ss->cache->mirror_symmetry_pass; | test->mirror_symmetry_pass = ss->cache->mirror_symmetry_pass; | ||||
| test->radial_symmetry_pass = ss->cache->radial_symmetry_pass; | |||||
| copy_m4_m4(test->symm_rot_mat_inv, ss->cache->symm_rot_mat_inv); | |||||
| } | } | ||||
| else { | else { | ||||
| copy_v3_v3(test->location, ss->cursor_location); | copy_v3_v3(test->location, ss->cursor_location); | ||||
| test->mirror_symmetry_pass = 0; | test->mirror_symmetry_pass = 0; | ||||
| test->radial_symmetry_pass = 0; | |||||
| unit_m4(test->symm_rot_mat_inv); | |||||
| } | } | ||||
| /* Just for initialize. */ | /* Just for initialize. */ | ||||
| test->dist = 0.0f; | test->dist = 0.0f; | ||||
| /* Only for 2D projection. */ | /* Only for 2D projection. */ | ||||
| zero_v4(test->plane_view); | zero_v4(test->plane_view); | ||||
| zero_v4(test->plane_tool); | zero_v4(test->plane_tool); | ||||
| test->mirror_symmetry_pass = ss->cache ? ss->cache->mirror_symmetry_pass : 0; | test->mirror_symmetry_pass = ss->cache ? ss->cache->mirror_symmetry_pass : 0; | ||||
sergey: Please figure out why this is needed rather than adding comments in the code raising… | |||||
Done Inline Actions
Removed the comment, but looks like this assignement is just redundant. (can be removed in a separate commit) lichtwerk: >>! In D9120#225217, @pablodp606 wrote:
> I'll fix the extra line after you commit this. | |||||
| if (RV3D_CLIPPING_ENABLED(v3d, rv3d)) { | if (RV3D_CLIPPING_ENABLED(v3d, rv3d)) { | ||||
| test->clip_rv3d = rv3d; | test->clip_rv3d = rv3d; | ||||
| } | } | ||||
| else { | else { | ||||
| test->clip_rv3d = NULL; | test->clip_rv3d = NULL; | ||||
| } | } | ||||
| } | } | ||||
| BLI_INLINE bool sculpt_brush_test_clipping(const SculptBrushTest *test, const float co[3]) | BLI_INLINE bool sculpt_brush_test_clipping(const SculptBrushTest *test, const float co[3]) | ||||
| { | { | ||||
| RegionView3D *rv3d = test->clip_rv3d; | RegionView3D *rv3d = test->clip_rv3d; | ||||
| if (!rv3d) { | if (!rv3d) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| float symm_co[3]; | float symm_co[3]; | ||||
| flip_v3_v3(symm_co, co, test->mirror_symmetry_pass); | flip_v3_v3(symm_co, co, test->mirror_symmetry_pass); | ||||
| if (test->radial_symmetry_pass) { | |||||
| mul_m4_v3(test->symm_rot_mat_inv, symm_co); | |||||
| } | |||||
| return ED_view3d_clipping_test(rv3d, symm_co, true); | return ED_view3d_clipping_test(rv3d, symm_co, true); | ||||
| } | } | ||||
| bool SCULPT_brush_test_sphere(SculptBrushTest *test, const float co[3]) | bool SCULPT_brush_test_sphere(SculptBrushTest *test, const float co[3]) | ||||
| { | { | ||||
| float distsq = len_squared_v3v3(co, test->location); | float distsq = len_squared_v3v3(co, test->location); | ||||
| if (distsq <= test->radius_squared) { | if (distsq <= test->radius_squared) { | ||||
| ▲ Show 20 Lines • Show All 7,575 Lines • Show Last 20 Lines | |||||
Please figure out why this is needed rather than adding comments in the code raising existentialist questions of the code.