|
Blender V5.0
|
Go to the source code of this file.
Typedefs | |
| typedef struct Dial | Dial |
Functions | |
| Dial * | BLI_dial_init (const float start_position[2], float threshold) |
| void | BLI_dial_free (Dial *dial) |
| float | BLI_dial_angle (Dial *dial, const float current_position[2]) |
They just are initialized with the center of the dial and a threshold value as input.
When the distance of the current position of the dial from the center exceeds the threshold, this position is used to calculate the initial direction. After that, the angle from the initial direction is calculated based on current and previous directions of the digit, and returned to the user.
Usage examples:
Definition in file BLI_dial_2d.h.
| typedef struct Dial Dial |
Definition at line 36 of file BLI_dial_2d.h.
Definition at line 52 of file BLI_dial_2d.cc.
References angle(), atan2f, Dial::center, copy_v2_v2(), cross_v2v2(), dot_v2v2(), fabsf, float, Dial::initial_direction, Dial::initialized, Dial::last_angle, len_squared_v2(), M_PI, M_PI_2, normalize_v2(), Dial::rotations, sub_v2_v2v2(), and Dial::threshold_squared.
Referenced by gizmo_cage2d_modal(), radial_control_modal(), blender::ed::sculpt_paint::sculpt_update_cache_variants(), and viewroll_apply().
| void BLI_dial_free | ( | Dial * | dial | ) |
Definition at line 47 of file BLI_dial_2d.cc.
References MEM_freeN().
Referenced by ViewOpsData::end_navigation(), gizmo_cage2d_exit(), radial_control_cancel(), radial_control_modal(), and blender::ed::sculpt_paint::StrokeCache::~StrokeCache().
Definition at line 37 of file BLI_dial_2d.cc.
References Dial::center, copy_v2_v2(), MEM_callocN(), and Dial::threshold_squared.
Referenced by gizmo_cage2d_modal(), radial_control_modal(), blender::ed::sculpt_paint::sculpt_update_cache_invariants(), and viewroll_invoke().