34 #define GIZMO_PRECISION_FAC 0.05f
42 return inverted ? (range_fac * (
min + range - value) / range) : (range_fac * (value / range));
51 return inverted ? (
min + range - (value * range / range_fac)) : (value * range / range_fac);
56 const bool constrained,
61 data->range_fac,
data->min,
data->range, value, inverted);
70 const bool constrained,
72 const bool use_precision)
88 data->range_fac,
data->min,
data->range, ofs_new, inverted);
95 if (
data->is_custom_range_set) {
105 const bool constrained,
122 if (
data->is_custom_range_set ==
false) {
125 data->range = range[1] - range[0];
126 data->min = range[0];
133 data->range_fac,
data->min,
data->range, value, inverted);
136 data->offset = value;
169 float mat[4][4], imat[4][4];
171 float mat_identity[4][4];
173 if (use_offset ==
false) {
175 params.matrix_offset = mat_identity;
182 "Gizmo \"%s\" of group \"%s\" has matrix that could not be inverted "
183 "(projection will fail)",
193 float plane[4], co[3];
198 r_co[0] = co[(axis + 1) % 3];
199 r_co[1] = co[(axis + 2) % 3];
205 float co[3] = {mval[0], mval[1], 0.0f};
212 bContext *
C,
const struct wmGizmo *gz,
const float mval[2],
bool use_offset,
float r_co[3])
214 float mat[4][4], imat[4][4];
216 float mat_identity[4][4];
218 if (use_offset ==
false) {
220 params.matrix_offset = mat_identity;
227 "Gizmo \"%s\" of group \"%s\" has matrix that could not be inverted "
228 "(projection will fail)",
243 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])
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])
#define CLOG_WARN(clg_ref,...)
bool ED_view3d_win_to_3d_on_plane(const struct ARegion *region, const float plane[4], const float mval[2], 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 Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position 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)
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
eWM_GizmoFlagGroupTypeFlag flag
struct wmGizmoGroupType * type
wmGizmoPropertyFnGet value_get_fn
struct wmGizmoProperty::@1185 custom_func
struct wmGizmoGroup * parent_gzgroup
const struct wmGizmoType * type
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])