|
Blender V5.0
|
Functions | |
| float4x4 | calc_local_matrix (const Brush &brush, const StrokeCache &cache, const float3 &plane_normal, const float3 &plane_center, const bool flip) |
| CursorSampleResult | calc_node_mask (const Depsgraph &depsgraph, Object &ob, const Brush &brush, IndexMaskMemory &memory) |
| static bool | node_in_box (const float4x4 &mat, const Bounds< float3 > &bounds) |
| float4x4 blender::ed::sculpt_paint::brushes::clay_strips::calc_local_matrix | ( | const Brush & | brush, |
| const StrokeCache & | cache, | ||
| const float3 & | plane_normal, | ||
| const float3 & | plane_center, | ||
| const bool | flip ) |
Definition at line 443 of file clay_strips.cc.
References blender::math::cross(), blender::math::from_scale(), blender::ed::sculpt_paint::StrokeCache::grab_delta_symm, blender::MatBase< float, 4, 4 >::identity(), blender::math::invert(), blender::MatBase< T, NumCol, NumRow, Alignment >::location(), blender::math::normalize(), blender::ed::sculpt_paint::StrokeCache::radius, Brush::tip_scale_x, blender::MatBase< T, NumCol, NumRow, Alignment >::x_axis(), blender::MatBase< T, NumCol, NumRow, Alignment >::y_axis(), and blender::MatBase< T, NumCol, NumRow, Alignment >::z_axis().
Referenced by calc_node_mask(), and blender::ed::sculpt_paint::brushes::do_clay_strips_brush().
| CursorSampleResult blender::ed::sculpt_paint::brushes::clay_strips::calc_node_mask | ( | const Depsgraph & | depsgraph, |
| Object & | ob, | ||
| const Brush & | brush, | ||
| IndexMaskMemory & | memory ) |
Definition at line 471 of file clay_strips.cc.
References blender::ed::sculpt_paint::StrokeCache::accum, blender::bke::pbvh::Node::bounds(), blender::ed::sculpt_paint::brush_plane_offset_get(), blender::ed::sculpt_paint::StrokeCache::bstrength, SculptSession::cache, blender::ed::sculpt_paint::calc_brush_plane(), calc_local_matrix(), depsgraph, Brush::falloff_shape, blender::ed::sculpt_paint::gather_nodes(), blender::ed::sculpt_paint::StrokeCache::grab_delta_symm, blender::math::is_zero(), blender::ed::sculpt_paint::StrokeCache::location_symm, blender::ed::sculpt_paint::node_fully_masked_or_hidden(), node_in_box(), blender::bke::object::pbvh_get(), blender::ed::sculpt_paint::StrokeCache::radius, blender::ed::sculpt_paint::StrokeCache::scale, blender::bke::pbvh::search_nodes(), blender::math::numbers::sqrt2, blender::math::square(), blender::ed::sculpt_paint::tilt_apply_to_normal(), Brush::tilt_strength_factor, and blender::ed::sculpt_paint::StrokeCache::view_normal_symm.
Referenced by blender::ed::sculpt_paint::calc_brush_node_mask().
|
static |
Checks whether the node's bounding box overlaps with the region affected by the brush. Clay Strips affects only vertices below the brush plane. The brush-local coordinate system is oriented so that vertices below the plane have positive local z-coordinates. Therefore, we only need to check if the node intersects the [-1,1] x [-1,1] x [0,1] volume in local space.
Intersection is tested using the Separating Axis Theorem. Two boxes (not necessarily axis-aligned) intersect if and only if there does not exist an axis that separates them. In particular, it is necessary and sufficient to:
Definition at line 381 of file clay_strips.cc.
References blender::math::abs(), blender::math::cross(), blender::math::dot(), blender::math::transform_point(), blender::MatBase< T, NumCol, NumRow, Alignment >::x_axis(), blender::MatBase< T, NumCol, NumRow, Alignment >::y_axis(), and blender::MatBase< T, NumCol, NumRow, Alignment >::z_axis().
Referenced by calc_node_mask().