46 #define GIZMO_PRECISION_FAC 0.05f
54 return inverted ? (range_fac * (
min + range - value) / range) : (range_fac * (value / range));
63 return inverted ? (
min + range - (value * range / range_fac)) : (value * range / range_fac);
68 const bool constrained,
73 data->range_fac,
data->min,
data->range, value, inverted);
82 const bool constrained,
84 const bool use_precision)
100 data->range_fac,
data->min,
data->range, ofs_new, inverted);
107 if (
data->is_custom_range_set) {
117 const bool constrained,
134 if (
data->is_custom_range_set ==
false) {
137 data->range = range[1] - range[0];
138 data->min = range[0];
145 data->range_fac,
data->min,
data->range, value, inverted);
148 data->offset = value;
187 float mat_identity[4][4];
189 if (use_offset ==
false) {
191 params.matrix_offset = mat_identity;
201 float plane[4], co[3];
208 r_co[0] = co[(axis + 1) % 3];
209 r_co[1] = co[(axis + 2) % 3];
215 float co[3] = {mval[0], mval[1], 0.0f};
224 bContext *
C,
const struct wmGizmo *gz,
const float mval[2],
bool use_offset,
float r_co[3])
228 float mat_identity[4][4];
230 if (use_offset ==
false) {
232 params.matrix_offset = mat_identity;
248 float co[3] = {mval[0], mval[1], 0.0f};
struct View3D * CTX_wm_view3d(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
void plane_from_point_normal_v3(float r_plane[4], const float plane_co[3], const float plane_no[3])
bool invert_m4(float R[4][4])
void unit_m4(float m[4][4])
bool invert_m4_m4(float R[4][4], const float A[4][4])
void mul_m4_v3(const float M[4][4], float r[3])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void copy_v2_v2(float r[2], const float a[2])
bool ED_view3d_win_to_3d_on_plane(const struct ARegion *region, const float plane[4], const float mval[2], const bool do_clip, float r_out[3])
void ED_view3d_win_to_3d(const struct View3D *v3d, const struct ARegion *region, const float depth_pt[3], const float mval[2], float r_out[3])
Group RGB to Bright Vector Camera CLAMP
bool gizmo_window_project_3d(bContext *C, const struct wmGizmo *gz, const float mval[2], bool use_offset, float r_co[3])
#define GIZMO_PRECISION_FAC
BLI_INLINE float gizmo_value_from_offset_constr(const float range_fac, const float min, const float range, const float value, const bool inverted)
BLI_INLINE float gizmo_offset_from_value_constr(const float range_fac, const float min, const float range, const float value, const bool inverted)
float gizmo_value_from_offset(GizmoCommonData *data, GizmoInteraction *inter, const float offset, const bool constrained, const bool inverted, const bool use_precision)
void gizmo_property_data_update(wmGizmo *gz, GizmoCommonData *data, wmGizmoProperty *gz_prop, const bool constrained, const bool inverted)
void gizmo_color_get(const wmGizmo *gz, const bool highlight, float r_col[4])
bool gizmo_window_project_2d(bContext *C, const struct wmGizmo *gz, const float mval[2], int axis, bool use_offset, float r_co[2])
float gizmo_offset_from_value(GizmoCommonData *data, const float value, const bool constrained, const bool inverted)
void gizmo_property_value_reset(bContext *C, const wmGizmo *gz, GizmoInteraction *inter, wmGizmoProperty *gz_prop)
eWM_GizmoFlagGroupTypeFlag flag
struct wmGizmoGroupType * type
wmGizmoPropertyFnGet value_get_fn
struct wmGizmoProperty::@1149 custom_func
struct wmGizmoGroup * parent_gzgroup
void WM_gizmo_calc_matrix_final_params(const wmGizmo *gz, const struct WM_GizmoMatrixParams *params, float r_mat[4][4])
void WM_gizmo_target_property_float_set(bContext *C, const wmGizmo *gz, wmGizmoProperty *gz_prop, const float value)
float WM_gizmo_target_property_float_get(const wmGizmo *gz, wmGizmoProperty *gz_prop)
bool WM_gizmo_target_property_float_range_get(const wmGizmo *gz, wmGizmoProperty *gz_prop, float range[2])