41 #include "../gizmo_geometry.h"
42 #include "../gizmo_library_intern.h"
44 #define MVAL_MAX_PX_DIST 12.0f
81 #define DIAL_RESOLUTION 32
88 const int draw_options)
90 #ifdef USE_GIZMO_CUSTOM_DIAL
126 const float radius_diag =
M_SQRT1_2 * radius;
151 const float xy_delta[2] = {
152 event->mval[0] - inter->
init.
mval[0],
153 event->mval[1] - inter->
init.
mval[1],
163 float matrix_space_inv[3][3];
172 const bool highlight)
178 float matrix_final[4][4];
179 float matrix_align[4][4];
188 float matrix_final_unit[4][4];
252 float mval_proj_init[2], mval_proj_curr[2];
255 C, gz, (
const float[2]){
UNPACK2(event->
mval)}, 2,
false, mval_proj_curr) ==
false)) {
258 sub_v2_v2v2(prop_delta, mval_proj_curr, mval_proj_init);
262 prop_delta[2] = 0.0f;
285 .use_occlusion_test =
true,
293 float matrix_space_inv[4][4];
319 bool use_reset_value =
false;
320 const float *reset_value =
NULL;
325 use_reset_value =
true;
330 if (use_reset_value) {
355 inter->
init.
mval[0] =
event->mval[0];
356 inter->
init.
mval[1] =
event->mval[1];
372 switch (
area->spacetype) {
391 float point_local[2];
431 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])
@ SCE_SNAP_MODE_FACE_RAYCAST
@ 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)
eSnapMode ED_transform_snap_object_project_view3d(struct SnapObjectContext *sctx, struct Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const eSnapMode snap_to, const struct SnapObjectParams *params, const float init_co[3], const float mval[2], const float prev_co[3], float *dist_px, float r_loc[3], float r_no[3])
SnapObjectContext * ED_transform_snap_object_context_create(struct Scene *scene, int flag)
void ED_transform_snap_object_context_destroy(SnapObjectContext *sctx)
void ED_view3d_win_to_delta(const struct ARegion *region, const float xy_delta[2], float zfac, float r_out[3])
float ED_view3d_calc_zfac(const struct RegionView3D *rv3d, const float co[3])
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.
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 a value between a minimum and a maximum Vector Perform vector math operation Invert a color
eWM_GizmoFlagTweak
Gizmo tweak flag. Bit-flag passed to gizmo while tweaking.
@ WM_GIZMO_STATE_HIGHLIGHT
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
SyclQueue void void size_t num_bytes void
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, 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::@348 prev
struct MoveInteraction::@347 init
eWM_GizmoFlagTweak tweak_flag
struct SnapObjectContext * snap_context_v3d
wmGizmoFnMatrixBasisGet matrix_basis_get
wmGizmoFnTestSelect test_select
wmGizmoFnCursorGet cursor_get
wmGizmoFnDrawSelect draw_select
wmGizmoFnPropertyUpdate property_update
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 *))