27 float r_center_view[3],
29 const float viewmat[4][4],
31 const float offset_angle)
33 float mat_offset[4][4];
34 float viewmat_roll[4][4];
48 const float mat_view[4][4],
49 const float center_view[3],
54 const float x_ofs = (mat_view[3][0] - center_view[0]);
55 float min = FLT_MAX,
max = -FLT_MAX;
73 const float mat_view[4][4],
74 const float center_view[3],
80 const float angle = -angle_;
83 const float range =
max -
min;
84 const float range_inv = 1.0f / range;
85 const float min_ofs =
min + (0.5f * range);
88 float dir_min[2], dir_max[2];
89 float imat_view[4][4];
95 const float phi =
angle * 0.5f;
97 dir_max[0] =
cosf(phi);
98 dir_max[1] =
sinf(phi);
100 dir_min[0] = -dir_max[0];
101 dir_min[1] = dir_max[1];
106 float co[3], co_add[2];
121 else if (val >
max) {
131 val = ((val -
min) / (
max -
min)) - 0.5f;
133 val = (val - min_ofs) * range_inv;
139 co[0] = -
sinf(phi) * co[1];
140 co[1] =
cosf(phi) * co[1];
163 float mat_view[4][4];
164 float center_view[3];
250 ot->
idname =
"TRANSFORM_OT_vertex_warp";
266 "Amount to warp about the cursor",
277 "Angle to use as the basis for warping",
287 ot->
srna,
"viewmat", 4, 4,
NULL, 0.0f, 0.0f,
"Matrix",
"", 0.0f, 0.0f);
291 ot->
srna,
"center", 3,
NULL, -FLT_MAX, FLT_MAX,
"Center",
"", -FLT_MAX, FLT_MAX);
struct Scene * CTX_data_scene(const bContext *C)
struct Object * CTX_data_edit_object(const bContext *C)
struct 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])
bool invert_m4_m4(float R[4][4], const float A[4][4])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
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.
void ED_transverts_update_obedit(TransVertStore *tvs, struct Object *obedit)
void ED_transverts_create_from_obedit(TransVertStore *tvs, const struct Object *obedit, int mode)
bool ED_transverts_poll(struct bContext *C)
void ED_transverts_free(TransVertStore *tvs)
NSNotificationCenter * center
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
static int object_warp_verts_exec(bContext *C, wmOperator *op)
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)
void TRANSFORM_OT_vertex_warp(struct wmOperatorType *ot)
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)
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)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
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(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
PropertyRNA * RNA_def_float_matrix(StructOrFunctionRNA *cont_, const char *identifier, int rows, int columns, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
PropertyRNA * RNA_def_float_vector_xyz(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_subtype(PropertyRNA *prop, PropertySubType subtype)
struct TransVert * transverts
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
void WM_event_add_notifier(const bContext *C, uint type, void *reference)