33 float r_center_view[3],
35 const float viewmat[4][4],
36 const float center[3],
37 const float offset_angle)
39 float mat_offset[4][4];
40 float viewmat_roll[4][4];
47 mul_m4_m4m4(r_mat_view, viewmat_roll, obedit->object_to_world().ptr());
54 const float mat_view[4][4],
55 const float center_view[3],
60 const float x_ofs = (mat_view[3][0] - center_view[0]);
79 const float mat_view[4][4],
80 const float center_view[3],
86 const float angle = -angle_;
89 const float range = max -
min;
90 const float range_inv = 1.0f /
range;
91 const float min_ofs =
min + (0.5f *
range);
94 float dir_min[2], dir_max[2];
95 float imat_view[4][4];
101 const float phi = angle * 0.5f;
103 dir_max[0] =
cosf(phi);
104 dir_max[1] =
sinf(phi);
106 dir_min[0] = -dir_max[0];
107 dir_min[1] = dir_max[1];
112 float co[3], co_add[2];
127 else if (val > max) {
137 val = ((val -
min) / (max -
min)) - 0.5f;
139 val = (val - min_ofs) * range_inv;
145 co[0] = -
sinf(phi) * co[1];
146 co[1] =
cosf(phi) * co[1];
169 float mat_view[4][4];
170 float center_view[3];
260 ot->
idname =
"TRANSFORM_OT_vertex_warp";
276 "Amount to warp about the cursor",
287 "Angle to use as the basis for warping",
297 ot->
srna,
"viewmat", 4, 4,
nullptr, 0.0f, 0.0f,
"Matrix",
"", 0.0f, 0.0f);
Scene * CTX_data_scene(const bContext *C)
Object * CTX_data_edit_object(const bContext *C)
RegionView3D * CTX_wm_region_view3d(const bContext *C)
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void unit_m4(float m[4][4])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void mul_v3_m4v3(float r[3], const float mat[4][4], const float vec[3])
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
void axis_angle_to_mat4_single(float R[4][4], char axis, float angle)
MINLINE void sub_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v2_v2(float r[2], const float a[2])
MINLINE void zero_v2(float r[2])
MINLINE void mul_v2_v2fl(float r[2], const float a[2], float f)
MINLINE float dot_m4_v3_row_x(const float M[4][4], const float a[3]) ATTR_WARN_UNUSED_RESULT
Object is a sort of wrapper for general info.
bool ED_transverts_poll(bContext *C)
void ED_transverts_create_from_obedit(TransVertStore *tvs, const Object *obedit, int mode)
void ED_transverts_free(TransVertStore *tvs)
void ED_transverts_update_obedit(TransVertStore *tvs, Object *obedit)
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
static int object_warp_verts_exec(bContext *C, wmOperator *op)
bool shape_key_report_if_locked(const Object *obedit, ReportList *reports)
static void object_warp_calc_view_matrix(float r_mat_view[4][4], float r_center_view[3], Object *obedit, const float viewmat[4][4], const float center[3], const float offset_angle)
void TRANSFORM_OT_vertex_warp(wmOperatorType *ot)
static void object_warp_transverts(TransVertStore *tvs, const float mat_view[4][4], const float center_view[3], const float angle_, const float min, const float max)
static void object_warp_transverts_minmax_x(TransVertStore *tvs, const float mat_view[4][4], const float center_view[3], float *r_min, float *r_max)
float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *values)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
float RNA_float_get(PointerRNA *ptr, const char *name)
void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const float *values)
void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value)
PropertyRNA * RNA_def_float_matrix(StructOrFunctionRNA *cont_, const char *identifier, const int rows, const int columns, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_float_vector_xyz(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_subtype(PropertyRNA *prop, PropertySubType subtype)
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_event_add_notifier(const bContext *C, uint type, void *reference)