|
Blender
V2.93
|
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) |
| 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.
Definition at line 1 of file BLI_dial_2d.h.
Definition at line 58 of file BLI_dial_2d.c.
References angle(), atan2f, Dial::center, copy_v2_v2(), cosval, 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, sinval, sub_v2_v2v2(), and Dial::threshold_squared.
Referenced by gizmo_cage2d_modal(), radial_control_modal(), and sculpt_update_cache_variants().
Definition at line 48 of file BLI_dial_2d.c.
References Dial::center, copy_v2_v2(), MEM_callocN, and Dial::threshold_squared.
Referenced by gizmo_cage2d_modal(), radial_control_modal(), and sculpt_update_cache_invariants().