55 #include "../gizmo_geometry.h"
56 #include "../gizmo_library_intern.h"
58 #define MVAL_MAX_PX_DIST 12.0f
95 #define DIAL_RESOLUTION 32
100 const float color[4],
102 const int draw_options)
104 #ifdef USE_GIZMO_CUSTOM_DIAL
139 const float radius_diag =
M_SQRT1_2 * radius;
164 const float mval_delta[2] = {
165 event->mval[0] - inter->
init.
mval[0],
166 event->mval[1] - inter->
init.
mval[1],
176 float matrix_space_inv[3][3];
185 const bool highlight)
191 float matrix_final[4][4];
192 float matrix_align[4][4];
201 float matrix_final_unit[4][4];
265 float mval_proj_init[2], mval_proj_curr[2];
268 C, gz, (
const float[2]){
UNPACK2(event->
mval)}, 2,
false, mval_proj_curr) ==
false)) {
271 sub_v2_v2v2(prop_delta, mval_proj_curr, mval_proj_init);
275 prop_delta[2] = 0.0f;
295 .use_object_edit_cage =
true,
296 .use_occlusion_test =
true,
303 float matrix_space_inv[4][4];
329 bool use_reset_value =
false;
330 const float *reset_value =
NULL;
335 use_reset_value =
true;
340 if (use_reset_value) {
365 inter->
init.
mval[0] =
event->mval[0];
366 inter->
init.
mval[1] =
event->mval[1];
382 switch (
area->spacetype) {
402 float point_local[2];
442 gzt->
idname =
"GIZMO_GT_move_3d";
struct ScrArea * CTX_wm_area(const bContext *C)
struct Scene * CTX_data_scene(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct RegionView3D * CTX_wm_region_view3d(const bContext *C)
void mul_m3_v3(const float M[3][3], float r[3])
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void copy_m3_m4(float m1[3][3], const float m2[4][4])
bool invert_m4_m4(float R[4][4], const float A[4][4])
void normalize_m4_m4(float R[4][4], const float M[4][4]) ATTR_NONNULL()
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])
bool invert_m3(float R[3][3])
void transpose_m4(float R[4][4])
void mul_v3_mat3_m4v3(float r[3], const float M[4][4], const float v[3])
MINLINE float len_squared_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void zero_v3(float r[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
#define SCE_SNAP_MODE_FACE
#define SCE_SNAP_MODE_VERTEX
#define SCE_SNAP_MODE_EDGE
@ ED_GIZMO_MOVE_STYLE_CROSS_2D
@ ED_GIZMO_MOVE_STYLE_RING_2D
@ ED_GIZMO_MOVE_DRAW_FLAG_FILL_SELECT
@ ED_GIZMO_MOVE_DRAW_FLAG_FILL
@ ED_GIZMO_MOVE_DRAW_FLAG_ALIGN_VIEW
void ED_region_tag_redraw_editor_overlays(struct ARegion *region)
SnapObjectContext * ED_transform_snap_object_context_create_view3d(struct Scene *scene, int flag, const struct ARegion *region, const struct View3D *v3d)
bool ED_transform_snap_object_project_view3d(struct SnapObjectContext *sctx, struct Depsgraph *depsgraph, const unsigned short snap_to, const struct SnapObjectParams *params, const float mval[2], const float prev_co[3], float *dist_px, float r_loc[3], float r_no[3])
void ED_transform_snap_object_context_destroy(SnapObjectContext *sctx)
void ED_view3d_win_to_delta(const struct ARegion *region, const float mval[2], float out[3], const float zfac)
float ED_view3d_calc_zfac(const struct RegionView3D *rv3d, const float co[3], bool *r_flip)
void GPU_matrix_pop(void)
#define GPU_matrix_mul(x)
void GPU_matrix_push(void)
bool GPU_select_load_id(unsigned int id)
@ GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR
@ GPU_SHADER_3D_UNIFORM_COLOR
void GPU_blend(eGPUBlend blend)
void GPU_viewport_size_get_f(float coords[4])
Read Guarded memory(de)allocation.
eWM_GizmoFlagTweak
Gizmo tweak flag. Bitflag passed to gizmo while tweaking.
@ WM_GIZMO_STATE_HIGHLIGHT
void wm_gizmo_geometryinfo_draw(const GizmoGeomInfo *info, const bool UNUSED(select), const float color[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])
void gizmo_color_get(const struct wmGizmo *gz, const bool highlight, float r_color[4])
void *(* MEM_callocN)(size_t len, const char *str)
void ED_gizmotypes_move_3d(void)
static int gizmo_move_test_select(bContext *C, wmGizmo *gz, const int mval[2])
static void gizmo_move_exit(bContext *C, wmGizmo *gz, const bool cancel)
static void gizmo_move_property_update(wmGizmo *gz, wmGizmoProperty *gz_prop)
static void gizmo_move_draw_select(const bContext *C, wmGizmo *gz, int select_id)
static int gizmo_move_modal(bContext *C, wmGizmo *gz, const wmEvent *event, eWM_GizmoFlagTweak tweak_flag)
struct MoveGizmo3D MoveGizmo3D
static void GIZMO_GT_move_3d(wmGizmoType *gzt)
static void move_geom_draw(const wmGizmo *gz, const float color[4], const bool select, const int draw_options)
static void gizmo_move_draw(const bContext *C, wmGizmo *gz)
static int gizmo_move_cursor_get(wmGizmo *UNUSED(gz))
static void move3d_draw_intern(const bContext *C, wmGizmo *gz, const bool select, const bool highlight)
static void gizmo_move_matrix_basis_get(const wmGizmo *gz, float r_matrix[4][4])
static int gizmo_move_invoke(bContext *C, wmGizmo *gz, const wmEvent *event)
static void move3d_get_translate(const wmGizmo *gz, const wmEvent *event, const ARegion *region, float co_delta[3])
struct MoveInteraction MoveInteraction
static void area(int d1, int d2, int e1, int e2, float weights[2])
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_enum_flag(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
struct MoveInteraction::@323 init
eWM_GizmoFlagTweak tweak_flag
struct SnapObjectContext * snap_context_v3d
struct MoveInteraction::@324 prev
const struct ARegion * region
wmGizmoFnMatrixBasisGet matrix_basis_get
wmGizmoFnTestSelect test_select
wmGizmoFnCursorGet cursor_get
wmGizmoFnDrawSelect draw_select
wmGizmoFnPropertyUpdate property_update
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
void WM_gizmo_calc_matrix_final(const wmGizmo *gz, float r_mat[4][4])
wmGizmoProperty * WM_gizmo_target_property_find(wmGizmo *gz, const char *idname)
bool WM_gizmo_target_property_is_valid(const wmGizmoProperty *gz_prop)
void WM_gizmo_target_property_float_get_array(const wmGizmo *gz, wmGizmoProperty *gz_prop, float *value)
void WM_gizmotype_target_property_def(wmGizmoType *gzt, const char *idname, int data_type, int array_length)
void WM_gizmo_target_property_float_set_array(bContext *C, const wmGizmo *gz, wmGizmoProperty *gz_prop, const float *value)
void WM_gizmo_target_property_anim_autokey(bContext *C, const wmGizmo *UNUSED(gz), wmGizmoProperty *gz_prop)
void WM_gizmotype_append(void(*gtfunc)(struct wmGizmoType *))