Cleanup: deduplicate generating transform matrices in curves brushes
This commit is contained in:
@@ -97,14 +97,7 @@ struct AddOperationExecutor {
|
||||
float brush_radius_re_;
|
||||
float2 brush_pos_re_;
|
||||
|
||||
/** Various matrices to convert between coordinate spaces. */
|
||||
float4x4 curves_to_world_mat_;
|
||||
float4x4 curves_to_surface_mat_;
|
||||
float4x4 world_to_curves_mat_;
|
||||
float4x4 world_to_surface_mat_;
|
||||
float4x4 surface_to_world_mat_;
|
||||
float4x4 surface_to_curves_mat_;
|
||||
float4x4 surface_to_curves_normal_mat_;
|
||||
CurvesSculptTransforms transforms_;
|
||||
|
||||
BVHTreeFromMesh surface_bvh_;
|
||||
|
||||
@@ -130,16 +123,10 @@ struct AddOperationExecutor {
|
||||
return;
|
||||
}
|
||||
|
||||
curves_to_world_mat_ = object_->obmat;
|
||||
world_to_curves_mat_ = curves_to_world_mat_.inverted();
|
||||
transforms_ = CurvesSculptTransforms(*object_, curves_id_->surface);
|
||||
|
||||
surface_ob_ = curves_id_->surface;
|
||||
surface_ = static_cast<Mesh *>(surface_ob_->data);
|
||||
surface_to_world_mat_ = surface_ob_->obmat;
|
||||
world_to_surface_mat_ = surface_to_world_mat_.inverted();
|
||||
surface_to_curves_mat_ = world_to_curves_mat_ * surface_to_world_mat_;
|
||||
surface_to_curves_normal_mat_ = surface_to_curves_mat_.inverted().transposed();
|
||||
curves_to_surface_mat_ = world_to_surface_mat_ * curves_to_world_mat_;
|
||||
|
||||
curves_sculpt_ = ctx_.scene->toolsettings->curves_sculpt;
|
||||
brush_ = BKE_paint_brush_for_read(&curves_sculpt_->paint);
|
||||
@@ -222,8 +209,8 @@ struct AddOperationExecutor {
|
||||
add_inputs.surface_looptris = surface_looptris_;
|
||||
add_inputs.surface_uv_map = surface_uv_map;
|
||||
add_inputs.corner_normals_su = corner_normals_su;
|
||||
add_inputs.curves_to_surface_mat = curves_to_surface_mat_;
|
||||
add_inputs.surface_to_curves_normal_mat = surface_to_curves_normal_mat_;
|
||||
add_inputs.curves_to_surface_mat = transforms_.curves_to_surface;
|
||||
add_inputs.surface_to_curves_normal_mat = transforms_.surface_to_curves_normal;
|
||||
|
||||
if (add_inputs.interpolate_length || add_inputs.interpolate_shape ||
|
||||
add_inputs.interpolate_point_count) {
|
||||
@@ -246,14 +233,14 @@ struct AddOperationExecutor {
|
||||
float3 ray_start_wo, ray_end_wo;
|
||||
ED_view3d_win_to_segment_clipped(
|
||||
ctx_.depsgraph, ctx_.region, ctx_.v3d, brush_pos_re_, ray_start_wo, ray_end_wo, true);
|
||||
const float3 ray_start_cu = world_to_curves_mat_ * ray_start_wo;
|
||||
const float3 ray_end_cu = world_to_curves_mat_ * ray_end_wo;
|
||||
const float3 ray_start_cu = transforms_.world_to_curves * ray_start_wo;
|
||||
const float3 ray_end_cu = transforms_.world_to_curves * ray_end_wo;
|
||||
|
||||
const Vector<float4x4> symmetry_brush_transforms = get_symmetry_brush_transforms(
|
||||
eCurvesSymmetryType(curves_id_->symmetry));
|
||||
|
||||
for (const float4x4 &brush_transform : symmetry_brush_transforms) {
|
||||
const float4x4 transform = curves_to_surface_mat_ * brush_transform;
|
||||
const float4x4 transform = transforms_.curves_to_surface * brush_transform;
|
||||
this->sample_in_center(r_added_points, transform * ray_start_cu, transform * ray_end_cu);
|
||||
}
|
||||
}
|
||||
@@ -284,7 +271,7 @@ struct AddOperationExecutor {
|
||||
const float3 bary_coords = bke::mesh_surface_sample::compute_bary_coord_in_triangle(
|
||||
*surface_, surface_looptris_[looptri_index], brush_pos_su);
|
||||
|
||||
const float3 brush_pos_cu = surface_to_curves_mat_ * brush_pos_su;
|
||||
const float3 brush_pos_cu = transforms_.surface_to_curves * brush_pos_su;
|
||||
|
||||
r_added_points.positions_cu.append(brush_pos_cu);
|
||||
r_added_points.bary_coords.append(bary_coords);
|
||||
@@ -325,10 +312,10 @@ struct AddOperationExecutor {
|
||||
float3 start_wo, end_wo;
|
||||
ED_view3d_win_to_segment_clipped(
|
||||
ctx_.depsgraph, ctx_.region, ctx_.v3d, pos_re, start_wo, end_wo, true);
|
||||
const float3 start_cu = brush_transform * (world_to_curves_mat_ * start_wo);
|
||||
const float3 end_cu = brush_transform * (world_to_curves_mat_ * end_wo);
|
||||
r_start_su = curves_to_surface_mat_ * start_cu;
|
||||
r_end_su = curves_to_surface_mat_ * end_cu;
|
||||
const float3 start_cu = brush_transform * (transforms_.world_to_curves * start_wo);
|
||||
const float3 end_cu = brush_transform * (transforms_.world_to_curves * end_wo);
|
||||
r_start_su = transforms_.curves_to_surface * start_cu;
|
||||
r_end_su = transforms_.curves_to_surface * end_cu;
|
||||
},
|
||||
use_front_face_,
|
||||
add_amount_,
|
||||
@@ -337,7 +324,7 @@ struct AddOperationExecutor {
|
||||
r_added_points.looptri_indices,
|
||||
r_added_points.positions_cu);
|
||||
for (float3 &pos : r_added_points.positions_cu.as_mutable_span().take_back(new_points)) {
|
||||
pos = surface_to_curves_mat_ * pos;
|
||||
pos = transforms_.surface_to_curves * pos;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -356,8 +343,8 @@ struct AddOperationExecutor {
|
||||
brush_ray_start_wo,
|
||||
brush_ray_end_wo,
|
||||
true);
|
||||
const float3 brush_ray_start_cu = world_to_curves_mat_ * brush_ray_start_wo;
|
||||
const float3 brush_ray_end_cu = world_to_curves_mat_ * brush_ray_end_wo;
|
||||
const float3 brush_ray_start_cu = transforms_.world_to_curves * brush_ray_start_wo;
|
||||
const float3 brush_ray_end_cu = transforms_.world_to_curves * brush_ray_end_wo;
|
||||
|
||||
/* Find ray that starts on the boundary of the brush. That is used to compute the brush radius
|
||||
* in 3D. */
|
||||
@@ -369,13 +356,14 @@ struct AddOperationExecutor {
|
||||
brush_radius_ray_start_wo,
|
||||
brush_radius_ray_end_wo,
|
||||
true);
|
||||
const float3 brush_radius_ray_start_cu = world_to_curves_mat_ * brush_radius_ray_start_wo;
|
||||
const float3 brush_radius_ray_end_cu = world_to_curves_mat_ * brush_radius_ray_end_wo;
|
||||
const float3 brush_radius_ray_start_cu = transforms_.world_to_curves *
|
||||
brush_radius_ray_start_wo;
|
||||
const float3 brush_radius_ray_end_cu = transforms_.world_to_curves * brush_radius_ray_end_wo;
|
||||
|
||||
const Vector<float4x4> symmetry_brush_transforms = get_symmetry_brush_transforms(
|
||||
eCurvesSymmetryType(curves_id_->symmetry));
|
||||
for (const float4x4 &brush_transform : symmetry_brush_transforms) {
|
||||
const float4x4 transform = curves_to_surface_mat_ * brush_transform;
|
||||
const float4x4 transform = transforms_.curves_to_surface * brush_transform;
|
||||
this->sample_spherical(rng,
|
||||
r_added_points,
|
||||
transform * brush_ray_start_cu,
|
||||
@@ -471,7 +459,7 @@ struct AddOperationExecutor {
|
||||
r_added_points.looptri_indices,
|
||||
r_added_points.positions_cu);
|
||||
for (float3 &pos : r_added_points.positions_cu.as_mutable_span().take_back(new_points)) {
|
||||
pos = surface_to_curves_mat_ * pos;
|
||||
pos = transforms_.surface_to_curves * pos;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -324,4 +324,18 @@ CurvesSculptCommonContext::CurvesSculptCommonContext(const bContext &C)
|
||||
this->rv3d = CTX_wm_region_view3d(&C);
|
||||
}
|
||||
|
||||
CurvesSculptTransforms::CurvesSculptTransforms(const Object &curves_ob, const Object *surface_ob)
|
||||
{
|
||||
this->curves_to_world = curves_ob.obmat;
|
||||
this->world_to_curves = this->curves_to_world.inverted();
|
||||
|
||||
if (surface_ob != nullptr) {
|
||||
this->surface_to_world = surface_ob->obmat;
|
||||
this->world_to_surface = this->surface_to_world.inverted();
|
||||
this->surface_to_curves = this->world_to_curves * this->surface_to_world;
|
||||
this->curves_to_surface = this->world_to_surface * this->curves_to_world;
|
||||
this->surface_to_curves_normal = this->surface_to_curves.inverted().transposed();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace blender::ed::sculpt_paint
|
||||
|
||||
@@ -100,8 +100,7 @@ struct CombOperationExecutor {
|
||||
float2 brush_pos_re_;
|
||||
float2 brush_pos_diff_re_;
|
||||
|
||||
float4x4 curves_to_world_mat_;
|
||||
float4x4 world_to_curves_mat_;
|
||||
CurvesSculptTransforms transforms_;
|
||||
|
||||
CombOperationExecutor(const bContext &C) : ctx_(C)
|
||||
{
|
||||
@@ -121,9 +120,6 @@ struct CombOperationExecutor {
|
||||
brush_radius_factor_ = brush_radius_factor(*brush_, stroke_extension);
|
||||
brush_strength_ = brush_strength_get(*ctx_.scene, *brush_, stroke_extension);
|
||||
|
||||
curves_to_world_mat_ = object_->obmat;
|
||||
world_to_curves_mat_ = curves_to_world_mat_.inverted();
|
||||
|
||||
falloff_shape_ = static_cast<eBrushFalloffShape>(brush_->falloff_shape);
|
||||
|
||||
curves_id_ = static_cast<Curves *>(object_->data);
|
||||
@@ -132,6 +128,8 @@ struct CombOperationExecutor {
|
||||
return;
|
||||
}
|
||||
|
||||
transforms_ = CurvesSculptTransforms(*object_, curves_id_->surface);
|
||||
|
||||
point_factors_ = get_point_selection(*curves_id_);
|
||||
curve_selection_ = retrieve_selected_curves(*curves_id_, selected_curve_indices_);
|
||||
|
||||
@@ -225,11 +223,11 @@ struct CombOperationExecutor {
|
||||
float3 new_position_wo;
|
||||
ED_view3d_win_to_3d(ctx_.v3d,
|
||||
ctx_.region,
|
||||
curves_to_world_mat_ * old_pos_cu,
|
||||
transforms_.curves_to_world * old_pos_cu,
|
||||
new_position_re,
|
||||
new_position_wo);
|
||||
const float3 new_position_cu = brush_transform *
|
||||
(world_to_curves_mat_ * new_position_wo);
|
||||
(transforms_.world_to_curves * new_position_wo);
|
||||
positions_cu[point_i] = new_position_cu;
|
||||
|
||||
curve_changed = true;
|
||||
@@ -252,16 +250,16 @@ struct CombOperationExecutor {
|
||||
float3 brush_start_wo, brush_end_wo;
|
||||
ED_view3d_win_to_3d(ctx_.v3d,
|
||||
ctx_.region,
|
||||
curves_to_world_mat_ * self_->brush_3d_.position_cu,
|
||||
transforms_.curves_to_world * self_->brush_3d_.position_cu,
|
||||
brush_pos_prev_re_,
|
||||
brush_start_wo);
|
||||
ED_view3d_win_to_3d(ctx_.v3d,
|
||||
ctx_.region,
|
||||
curves_to_world_mat_ * self_->brush_3d_.position_cu,
|
||||
transforms_.curves_to_world * self_->brush_3d_.position_cu,
|
||||
brush_pos_re_,
|
||||
brush_end_wo);
|
||||
const float3 brush_start_cu = world_to_curves_mat_ * brush_start_wo;
|
||||
const float3 brush_end_cu = world_to_curves_mat_ * brush_end_wo;
|
||||
const float3 brush_start_cu = transforms_.world_to_curves * brush_start_wo;
|
||||
const float3 brush_end_cu = transforms_.world_to_curves * brush_end_wo;
|
||||
|
||||
const float brush_radius_cu = self_->brush_3d_.radius_cu * brush_radius_factor_;
|
||||
|
||||
|
||||
@@ -76,8 +76,7 @@ struct DeleteOperationExecutor {
|
||||
|
||||
float2 brush_pos_re_;
|
||||
|
||||
float4x4 curves_to_world_mat_;
|
||||
float4x4 world_to_curves_mat_;
|
||||
CurvesSculptTransforms transforms_;
|
||||
|
||||
DeleteOperationExecutor(const bContext &C) : ctx_(C)
|
||||
{
|
||||
@@ -101,8 +100,7 @@ struct DeleteOperationExecutor {
|
||||
|
||||
brush_pos_re_ = stroke_extension.mouse_position;
|
||||
|
||||
curves_to_world_mat_ = object_->obmat;
|
||||
world_to_curves_mat_ = curves_to_world_mat_.inverted();
|
||||
transforms_ = CurvesSculptTransforms(*object_, curves_id_->surface);
|
||||
|
||||
const eBrushFalloffShape falloff_shape = static_cast<eBrushFalloffShape>(
|
||||
brush_->falloff_shape);
|
||||
@@ -199,10 +197,10 @@ struct DeleteOperationExecutor {
|
||||
float3 brush_wo;
|
||||
ED_view3d_win_to_3d(ctx_.v3d,
|
||||
ctx_.region,
|
||||
curves_to_world_mat_ * self_->brush_3d_.position_cu,
|
||||
transforms_.curves_to_world * self_->brush_3d_.position_cu,
|
||||
brush_pos_re_,
|
||||
brush_wo);
|
||||
const float3 brush_cu = world_to_curves_mat_ * brush_wo;
|
||||
const float3 brush_cu = transforms_.world_to_curves * brush_wo;
|
||||
|
||||
const Vector<float4x4> symmetry_brush_transforms = get_symmetry_brush_transforms(
|
||||
eCurvesSymmetryType(curves_id_->symmetry));
|
||||
|
||||
@@ -247,8 +247,7 @@ struct CurvesEffectOperationExecutor {
|
||||
|
||||
eBrushFalloffShape falloff_shape_;
|
||||
|
||||
float4x4 curves_to_world_mat_;
|
||||
float4x4 world_to_curves_mat_;
|
||||
CurvesSculptTransforms transforms_;
|
||||
|
||||
float2 brush_pos_start_re_;
|
||||
float2 brush_pos_end_re_;
|
||||
@@ -290,8 +289,7 @@ struct CurvesEffectOperationExecutor {
|
||||
|
||||
falloff_shape_ = eBrushFalloffShape(brush_->falloff_shape);
|
||||
|
||||
curves_to_world_mat_ = object_->obmat;
|
||||
world_to_curves_mat_ = curves_to_world_mat_.inverted();
|
||||
transforms_ = CurvesSculptTransforms(*object_, curves_id_->surface);
|
||||
|
||||
brush_pos_start_re_ = self.last_mouse_position_;
|
||||
brush_pos_end_re_ = stroke_extension.mouse_position;
|
||||
@@ -398,16 +396,16 @@ struct CurvesEffectOperationExecutor {
|
||||
float3 brush_start_pos_wo, brush_end_pos_wo;
|
||||
ED_view3d_win_to_3d(ctx_.v3d,
|
||||
ctx_.region,
|
||||
curves_to_world_mat_ * closest_on_segment_cu,
|
||||
transforms_.curves_to_world * closest_on_segment_cu,
|
||||
brush_pos_start_re_,
|
||||
brush_start_pos_wo);
|
||||
ED_view3d_win_to_3d(ctx_.v3d,
|
||||
ctx_.region,
|
||||
curves_to_world_mat_ * closest_on_segment_cu,
|
||||
transforms_.curves_to_world * closest_on_segment_cu,
|
||||
brush_pos_end_re_,
|
||||
brush_end_pos_wo);
|
||||
const float3 brush_start_pos_cu = world_to_curves_mat_ * brush_start_pos_wo;
|
||||
const float3 brush_end_pos_cu = world_to_curves_mat_ * brush_end_pos_wo;
|
||||
const float3 brush_start_pos_cu = transforms_.world_to_curves * brush_start_pos_wo;
|
||||
const float3 brush_end_pos_cu = transforms_.world_to_curves * brush_end_pos_wo;
|
||||
|
||||
const float move_distance_cu = weight *
|
||||
math::distance(brush_start_pos_cu, brush_end_pos_cu);
|
||||
@@ -430,16 +428,16 @@ struct CurvesEffectOperationExecutor {
|
||||
float3 brush_pos_start_wo, brush_pos_end_wo;
|
||||
ED_view3d_win_to_3d(ctx_.v3d,
|
||||
ctx_.region,
|
||||
curves_to_world_mat_ * self_->brush_3d_.position_cu,
|
||||
transforms_.curves_to_world * self_->brush_3d_.position_cu,
|
||||
brush_pos_start_re_,
|
||||
brush_pos_start_wo);
|
||||
ED_view3d_win_to_3d(ctx_.v3d,
|
||||
ctx_.region,
|
||||
curves_to_world_mat_ * self_->brush_3d_.position_cu,
|
||||
transforms_.curves_to_world * self_->brush_3d_.position_cu,
|
||||
brush_pos_end_re_,
|
||||
brush_pos_end_wo);
|
||||
const float3 brush_pos_start_cu = world_to_curves_mat_ * brush_pos_start_wo;
|
||||
const float3 brush_pos_end_cu = world_to_curves_mat_ * brush_pos_end_wo;
|
||||
const float3 brush_pos_start_cu = transforms_.world_to_curves * brush_pos_start_wo;
|
||||
const float3 brush_pos_end_cu = transforms_.world_to_curves * brush_pos_end_wo;
|
||||
const float3 brush_pos_diff_cu = brush_pos_end_cu - brush_pos_start_cu;
|
||||
const float brush_pos_diff_length_cu = math::length(brush_pos_diff_cu);
|
||||
const float brush_radius_cu = self_->brush_3d_.radius_cu * brush_radius_factor_;
|
||||
|
||||
@@ -108,4 +108,17 @@ class CurvesSculptCommonContext {
|
||||
CurvesSculptCommonContext(const bContext &C);
|
||||
};
|
||||
|
||||
struct CurvesSculptTransforms {
|
||||
float4x4 curves_to_world;
|
||||
float4x4 curves_to_surface;
|
||||
float4x4 world_to_curves;
|
||||
float4x4 world_to_surface;
|
||||
float4x4 surface_to_world;
|
||||
float4x4 surface_to_curves;
|
||||
float4x4 surface_to_curves_normal;
|
||||
|
||||
CurvesSculptTransforms() = default;
|
||||
CurvesSculptTransforms(const Object &curves_ob, const Object *surface_ob);
|
||||
};
|
||||
|
||||
} // namespace blender::ed::sculpt_paint
|
||||
|
||||
@@ -66,8 +66,7 @@ struct SelectionPaintOperationExecutor {
|
||||
|
||||
float2 brush_pos_re_;
|
||||
|
||||
float4x4 curves_to_world_mat_;
|
||||
float4x4 world_to_curves_mat_;
|
||||
CurvesSculptTransforms transforms_;
|
||||
|
||||
SelectionPaintOperationExecutor(const bContext &C) : ctx_(C)
|
||||
{
|
||||
@@ -105,8 +104,7 @@ struct SelectionPaintOperationExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
curves_to_world_mat_ = object_->obmat;
|
||||
world_to_curves_mat_ = curves_to_world_mat_.inverted();
|
||||
transforms_ = CurvesSculptTransforms(*object_, curves_id_->surface);
|
||||
|
||||
const eBrushFalloffShape falloff_shape = static_cast<eBrushFalloffShape>(
|
||||
brush_->falloff_shape);
|
||||
@@ -201,10 +199,10 @@ struct SelectionPaintOperationExecutor {
|
||||
float3 brush_wo;
|
||||
ED_view3d_win_to_3d(ctx_.v3d,
|
||||
ctx_.region,
|
||||
curves_to_world_mat_ * self_->brush_3d_.position_cu,
|
||||
transforms_.curves_to_world * self_->brush_3d_.position_cu,
|
||||
brush_pos_re_,
|
||||
brush_wo);
|
||||
const float3 brush_cu = world_to_curves_mat_ * brush_wo;
|
||||
const float3 brush_cu = transforms_.world_to_curves * brush_wo;
|
||||
|
||||
const Vector<float4x4> symmetry_brush_transforms = get_symmetry_brush_transforms(
|
||||
eCurvesSymmetryType(curves_id_->symmetry));
|
||||
@@ -309,10 +307,10 @@ struct SelectionPaintOperationExecutor {
|
||||
float3 brush_wo;
|
||||
ED_view3d_win_to_3d(ctx_.v3d,
|
||||
ctx_.region,
|
||||
curves_to_world_mat_ * self_->brush_3d_.position_cu,
|
||||
transforms_.curves_to_world * self_->brush_3d_.position_cu,
|
||||
brush_pos_re_,
|
||||
brush_wo);
|
||||
const float3 brush_cu = world_to_curves_mat_ * brush_wo;
|
||||
const float3 brush_cu = transforms_.world_to_curves * brush_wo;
|
||||
|
||||
const Vector<float4x4> symmetry_brush_transforms = get_symmetry_brush_transforms(
|
||||
eCurvesSymmetryType(curves_id_->symmetry));
|
||||
|
||||
@@ -89,8 +89,7 @@ struct SnakeHookOperatorExecutor {
|
||||
Vector<int64_t> selected_curve_indices_;
|
||||
IndexMask curve_selection_;
|
||||
|
||||
float4x4 curves_to_world_mat_;
|
||||
float4x4 world_to_curves_mat_;
|
||||
CurvesSculptTransforms transforms_;
|
||||
|
||||
float2 brush_pos_prev_re_;
|
||||
float2 brush_pos_re_;
|
||||
@@ -118,15 +117,14 @@ struct SnakeHookOperatorExecutor {
|
||||
|
||||
falloff_shape_ = static_cast<eBrushFalloffShape>(brush_->falloff_shape);
|
||||
|
||||
curves_to_world_mat_ = object_->obmat;
|
||||
world_to_curves_mat_ = curves_to_world_mat_.inverted();
|
||||
|
||||
curves_id_ = static_cast<Curves *>(object_->data);
|
||||
curves_ = &CurvesGeometry::wrap(curves_id_->geometry);
|
||||
if (curves_->curves_num() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
transforms_ = CurvesSculptTransforms(*object_, curves_id_->surface);
|
||||
|
||||
curve_factors_ = get_curves_selection(*curves_id_);
|
||||
curve_selection_ = retrieve_selected_curves(*curves_id_, selected_curve_indices_);
|
||||
|
||||
@@ -210,10 +208,11 @@ struct SnakeHookOperatorExecutor {
|
||||
float3 new_position_wo;
|
||||
ED_view3d_win_to_3d(ctx_.v3d,
|
||||
ctx_.region,
|
||||
curves_to_world_mat_ * old_pos_cu,
|
||||
transforms_.curves_to_world * old_pos_cu,
|
||||
new_position_re,
|
||||
new_position_wo);
|
||||
const float3 new_position_cu = brush_transform * (world_to_curves_mat_ * new_position_wo);
|
||||
const float3 new_position_cu = brush_transform *
|
||||
(transforms_.world_to_curves * new_position_wo);
|
||||
|
||||
move_last_point_and_resample(positions_cu.slice(points), new_position_cu);
|
||||
}
|
||||
@@ -228,16 +227,16 @@ struct SnakeHookOperatorExecutor {
|
||||
float3 brush_start_wo, brush_end_wo;
|
||||
ED_view3d_win_to_3d(ctx_.v3d,
|
||||
ctx_.region,
|
||||
curves_to_world_mat_ * self_->brush_3d_.position_cu,
|
||||
transforms_.curves_to_world * self_->brush_3d_.position_cu,
|
||||
brush_pos_prev_re_,
|
||||
brush_start_wo);
|
||||
ED_view3d_win_to_3d(ctx_.v3d,
|
||||
ctx_.region,
|
||||
curves_to_world_mat_ * self_->brush_3d_.position_cu,
|
||||
transforms_.curves_to_world * self_->brush_3d_.position_cu,
|
||||
brush_pos_re_,
|
||||
brush_end_wo);
|
||||
const float3 brush_start_cu = world_to_curves_mat_ * brush_start_wo;
|
||||
const float3 brush_end_cu = world_to_curves_mat_ * brush_end_wo;
|
||||
const float3 brush_start_cu = transforms_.world_to_curves * brush_start_wo;
|
||||
const float3 brush_end_cu = transforms_.world_to_curves * brush_end_wo;
|
||||
|
||||
const float brush_radius_cu = self_->brush_3d_.radius_cu * brush_radius_factor_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user