Blender V4.3
BLI_dial_2d.h File Reference

Go to the source code of this file.

Typedefs

typedef struct Dial Dial
 

Functions

DialBLI_dial_init (const float start_position[2], float threshold)
 
float BLI_dial_angle (Dial *dial, const float current_position[2])
 

Detailed Description

Note
dials act similar to old rotation based phones and output an angle.

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:

float start_position[2] = {0.0f, 0.0f};
float current_position[2];
float threshold = 0.5f;
float angle;
Dial *dial;
dial = BLI_dial_init(start_position, threshold);
angle = BLI_dial_angle(dial, current_position);
MEM_freeN(dial);
Dial * BLI_dial_init(const float start_position[2], float threshold)
Definition BLI_dial_2d.c:37
float BLI_dial_angle(Dial *dial, const float current_position[2])
Definition BLI_dial_2d.c:47
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
Definition IK_Math.h:125
void MEM_freeN(void *vmemh)
Definition mallocn.cc:105

Definition in file BLI_dial_2d.h.

Typedef Documentation

◆ Dial

typedef struct Dial Dial

Definition at line 40 of file BLI_dial_2d.h.

Function Documentation

◆ BLI_dial_angle()

◆ BLI_dial_init()

Dial * BLI_dial_init ( const float start_position[2],
float threshold )