Blender V2.61 - r43446
Classes | Defines | Typedefs | Enumerations | Functions

BLI_math_rotation.h File Reference

Go to the source code of this file.

Classes

struct  DualQuat

Defines

#define RAD2DEG(_rad)   ((_rad)*(180.0/M_PI))
#define DEG2RAD(_deg)   ((_deg)*(M_PI/180.0))
#define RAD2DEGF(_rad)   ((_rad)*(float)(180.0/M_PI))
#define DEG2RADF(_deg)   ((_deg)*(float)(M_PI/180.0))

Typedefs

typedef enum eEulerRotationOrders eEulerRotationOrders
typedef struct DualQuat DualQuat

Enumerations

enum  eEulerRotationOrders {
  EULER_ORDER_DEFAULT = 1, EULER_ORDER_XYZ = 1, EULER_ORDER_XZY, EULER_ORDER_YXZ,
  EULER_ORDER_YZX, EULER_ORDER_ZXY, EULER_ORDER_ZYX
}

Functions

void unit_axis_angle (float axis[3], float *angle)
void unit_qt (float q[4])
void copy_qt_qt (float q[4], const float a[4])
void mul_qt_qtqt (float q[4], const float a[4], const float b[4])
void mul_qt_v3 (const float q[4], float r[3])
void mul_qt_fl (float q[4], const float f)
void mul_fac_qt_fl (float q[4], const float f)
void sub_qt_qtqt (float q[4], const float a[4], const float b[4])
void invert_qt (float q[4])
void invert_qt_qt (float q1[4], const float q2[4])
void conjugate_qt (float q[4])
float dot_qtqt (const float a[4], const float b[4])
float normalize_qt (float q[4])
float normalize_qt_qt (float q1[4], const float q2[4])
int is_zero_qt (float q[4])
void interp_qt_qtqt (float q[4], const float a[4], const float b[4], const float t)
void add_qt_qtqt (float q[4], const float a[4], const float b[4], const float t)
void quat_to_mat3 (float mat[3][3], const float q[4])
void quat_to_mat4 (float mat[4][4], const float q[4])
void mat3_to_quat (float q[4], float mat[3][3])
void mat4_to_quat (float q[4], float mat[4][4])
void tri_to_quat (float q[4], const float a[3], const float b[3], const float c[3])
void vec_to_quat (float q[4], const float vec[3], short axis, const short upflag)
void rotation_between_vecs_to_quat (float q[4], const float v1[3], const float v2[3])
void rotation_between_quats_to_quat (float q[4], const float q1[4], const float q2[4])
void mat3_to_quat_is_ok (float q[4], float mat[3][3])
void print_qt (const char *str, const float q[4])
void axis_angle_to_quat (float r[4], const float axis[3], float angle)
void axis_angle_to_mat3 (float R[3][3], const float axis[3], const float angle)
void axis_angle_to_mat4 (float R[4][4], const float axis[3], const float angle)
void quat_to_axis_angle (float axis[3], float *angle, const float q[4])
void mat3_to_axis_angle (float axis[3], float *angle, float M[3][3])
void mat4_to_axis_angle (float axis[3], float *angle, float M[4][4])
void single_axis_angle_to_mat3 (float R[3][3], const char axis, const float angle)
void vec_rot_to_quat (float quat[4], const float vec[3], const float phi)
void vec_rot_to_mat3 (float mat[3][3], const float vec[3], const float phi)
void vec_rot_to_mat4 (float mat[4][4], const float vec[3], const float phi)
void eul_to_quat (float quat[4], const float eul[3])
void eul_to_mat3 (float mat[3][3], const float eul[3])
void eul_to_mat4 (float mat[4][4], const float eul[3])
void quat_to_eul (float eul[3], const float quat[4])
void mat3_to_eul (float eul[3], float mat[3][3])
void mat4_to_eul (float eul[3], float mat[4][4])
void compatible_eul (float eul[3], const float old[3])
void mat3_to_compatible_eul (float eul[3], const float old[3], float mat[3][3])
void rotate_eul (float eul[3], const char axis, const float angle)
void eulO_to_quat (float quat[4], const float eul[3], const short order)
void eulO_to_mat3 (float mat[3][3], const float eul[3], const short order)
void eulO_to_mat4 (float mat[4][4], const float eul[3], const short order)
void eulO_to_axis_angle (float axis[3], float *angle, const float eul[3], const short order)
void eulO_to_gimbal_axis (float gmat[3][3], const float eul[3], const short order)
void quat_to_eulO (float eul[3], const short order, const float quat[4])
void mat3_to_eulO (float eul[3], const short order, float mat[3][3])
void mat4_to_eulO (float eul[3], const short order, float mat[4][4])
void axis_angle_to_eulO (float eul[3], const short order, const float axis[3], const float angle)
void mat3_to_compatible_eulO (float eul[3], float old[3], short order, float mat[3][3])
void mat4_to_compatible_eulO (float eul[3], float old[3], short order, float mat[4][4])
void rotate_eulO (float eul[3], short order, char axis, float angle)
void copy_dq_dq (DualQuat *r, DualQuat *dq)
void normalize_dq (DualQuat *dq, float totw)
void add_weighted_dq_dq (DualQuat *r, DualQuat *dq, float weight)
void mul_v3m3_dq (float r[3], float R[3][3], DualQuat *dq)
void mat4_to_dquat (DualQuat *r, float base[4][4], float M[4][4])
void dquat_to_mat4 (float R[4][4], DualQuat *dq)
void quat_apply_track (float quat[4], short axis, short upflag)
void vec_apply_track (float vec[3], short axis)
float focallength_to_fov (float focal_length, float sensor)
float fov_to_focallength (float fov, float sensor)
float angle_wrap_rad (float angle)
float angle_wrap_deg (float angle)

Detailed Description

Definition in file BLI_math_rotation.h.


Define Documentation

#define DEG2RAD (   _deg)    ((_deg)*(M_PI/180.0))
#define DEG2RADF (   _deg)    ((_deg)*(float)(M_PI/180.0))
#define RAD2DEG (   _rad)    ((_rad)*(180.0/M_PI))

Definition at line 37 of file BLI_math_rotation.h.

Referenced by buildNavMesh(), draw_uvs_stretch(), and flyApply_ndof().

#define RAD2DEGF (   _rad)    ((_rad)*(float)(180.0/M_PI))

Typedef Documentation

typedef struct DualQuat DualQuat

Enumeration Type Documentation

Enumerator:
EULER_ORDER_DEFAULT 
EULER_ORDER_XYZ 
EULER_ORDER_XZY 
EULER_ORDER_YXZ 
EULER_ORDER_YZX 
EULER_ORDER_ZXY 
EULER_ORDER_ZYX 

Definition at line 134 of file BLI_math_rotation.h.


Function Documentation

void add_qt_qtqt ( float  q[4],
const float  a[4],
const float  b[4],
const float  t 
)

Definition at line 584 of file math_rotation.c.

Referenced by pose_slide_apply_quat(), and Quaternion_add().

void add_weighted_dq_dq ( DualQuat r,
DualQuat dq,
float  weight 
)
float angle_wrap_deg ( float  angle)

Definition at line 1712 of file math_rotation.c.

References mod_inline().

float angle_wrap_rad ( float  angle)

Definition at line 1707 of file math_rotation.c.

References M_PI, and mod_inline().

Referenced by C_Matrix_Rotation(), Quaternion_angle_set(), Quaternion_new(), and Rotation().

void axis_angle_to_eulO ( float  eul[3],
const short  order,
const float  axis[3],
const float  angle 
)
void axis_angle_to_mat3 ( float  R[3][3],
const float  axis[3],
const float  angle 
)
void axis_angle_to_mat4 ( float  R[4][4],
const float  axis[3],
const float  angle 
)
void axis_angle_to_quat ( float  r[4],
const float  axis[3],
float  angle 
)
void compatible_eul ( float  eul[3],
const float  old[3] 
)
void conjugate_qt ( float  q[4])
void copy_dq_dq ( DualQuat r,
DualQuat dq 
)

Definition at line 1613 of file math_rotation.c.

Referenced by b_bone_deform().

void copy_qt_qt ( float  q[4],
const float  a[4] 
)
float dot_qtqt ( const float  a[4],
const float  b[4] 
)
void dquat_to_mat4 ( float  R[4][4],
DualQuat dq 
)
void eul_to_mat3 ( float  mat[3][3],
const float  eul[3] 
)
void eul_to_mat4 ( float  mat[4][4],
const float  eul[3] 
)

Referenced by drawRBpivot(), and envmap_transmatrix().

void eul_to_quat ( float  quat[4],
const float  eul[3] 
)
void eulO_to_axis_angle ( float  axis[3],
float *  angle,
const float  eul[3],
const short  order 
)
void eulO_to_gimbal_axis ( float  gmat[3][3],
const float  eul[3],
const short  order 
)

Referenced by gimbal_axis().

void eulO_to_mat3 ( float  mat[3][3],
const float  eul[3],
const short  order 
)
void eulO_to_mat4 ( float  mat[4][4],
const float  eul[3],
const short  order 
)

Definition at line 1276 of file math_rotation.c.

References copy_m4_m3(), eulO_to_mat3(), and normalize_m3().

Referenced by constraintob_from_transdata().

void eulO_to_quat ( float  quat[4],
const float  eul[3],
const short  order 
)
float focallength_to_fov ( float  focal_length,
float  sensor 
)

Definition at line 1691 of file math_rotation.c.

References atanf.

Referenced by CamerasExporter::operator()(), and project_camera_info().

float fov_to_focallength ( float  fov,
float  sensor 
)

Definition at line 1696 of file math_rotation.c.

References tanf.

Referenced by DocumentImporter::writeCamera().

void interp_qt_qtqt ( float  q[4],
const float  a[4],
const float  b[4],
const float  t 
)
void invert_qt ( float  q[4])
void invert_qt_qt ( float  q1[4],
const float  q2[4] 
)
int is_zero_qt ( float  q[4])
void mat3_to_axis_angle ( float  axis[3],
float *  angle,
float  M[3][3] 
)
void mat3_to_compatible_eul ( float  eul[3],
const float  old[3],
float  mat[3][3] 
)
void mat3_to_compatible_eulO ( float  eul[3],
float  old[3],
short  order,
float  mat[3][3] 
)
void mat3_to_eul ( float  eul[3],
float  mat[3][3] 
)
void mat3_to_eulO ( float  eul[3],
const short  order,
float  mat[3][3] 
)
void mat3_to_quat ( float  q[4],
float  mat[3][3] 
)
void mat3_to_quat_is_ok ( float  q[4],
float  mat[3][3] 
)
void mat4_to_axis_angle ( float  axis[3],
float *  angle,
float  M[4][4] 
)

Definition at line 762 of file math_rotation.c.

References mat4_to_quat(), and quat_to_axis_angle().

Referenced by constraintRotLim(), and visualkey_get_value().

void mat4_to_compatible_eulO ( float  eul[3],
float  old[3],
short  order,
float  mat[4][4] 
)

Definition at line 1335 of file math_rotation.c.

References copy_m3_m4(), mat3_to_compatible_eulO(), and normalize_m3().

Referenced by rotlike_evaluate().

void mat4_to_dquat ( DualQuat r,
float  base[4][4],
float  M[4][4] 
)
void mat4_to_eul ( float  eul[3],
float  mat[4][4] 
)
void mat4_to_eulO ( float  eul[3],
const short  order,
float  mat[4][4] 
)
void mat4_to_quat ( float  q[4],
float  mat[4][4] 
)
void mul_fac_qt_fl ( float  q[4],
const float  f 
)

Referenced by game_blend_poses().

void mul_qt_fl ( float  q[4],
const float  f 
)
void mul_qt_qtqt ( float  q[4],
const float  a[4],
const float  b[4] 
)
void mul_qt_v3 ( const float  q[4],
float  r[3] 
)
void mul_v3m3_dq ( float  r[3],
float  R[3][3],
DualQuat dq 
)

Referenced by armature_deform_verts().

void normalize_dq ( DualQuat dq,
float  totw 
)
float normalize_qt ( float  q[4])
float normalize_qt_qt ( float  q1[4],
const float  q2[4] 
)
void print_qt ( const char *  str,
const float  q[4] 
)

Definition at line 636 of file math_rotation.c.

void quat_apply_track ( float  quat[4],
short  axis,
short  upflag 
)

Definition at line 1619 of file math_rotation.c.

References assert, and mul_qt_qtqt().

Referenced by calc_curve_deform(), followpath_get_tarmat(), and ob_parcurve().

void quat_to_axis_angle ( float  axis[3],
float *  angle,
const float  q[4] 
)
void quat_to_eul ( float  eul[3],
const float  quat[4] 
)
void quat_to_eulO ( float  eul[3],
const short  order,
const float  quat[4] 
)
void quat_to_mat3 ( float  mat[3][3],
const float  q[4] 
)
void quat_to_mat4 ( float  mat[4][4],
const float  q[4] 
)
void rotate_eul ( float  eul[3],
const char  axis,
const float  angle 
)
void rotate_eulO ( float  eul[3],
short  order,
char  axis,
float  angle 
)

Definition at line 1346 of file math_rotation.c.

References assert, eulO_to_mat3(), mat3_to_eulO(), and mul_m3_m3m3().

Referenced by Euler_rotate_axis(), and rotlike_evaluate().

void rotation_between_quats_to_quat ( float  q[4],
const float  q1[4],
const float  q2[4] 
)
void rotation_between_vecs_to_quat ( float  q[4],
const float  v1[3],
const float  v2[3] 
)
void single_axis_angle_to_mat3 ( float  R[3][3],
const char  axis,
const float  angle 
)

Definition at line 774 of file math_rotation.c.

References assert, cosf, and sinf.

Referenced by C_Matrix_Rotation().

void sub_qt_qtqt ( float  q[4],
const float  a[4],
const float  b[4] 
)

Definition at line 139 of file math_rotation.c.

References mul_qt_qtqt().

Referenced by explodeMesh(), pose_slide_apply_quat(), and set_crazy_vertex_quat().

void tri_to_quat ( float  q[4],
const float  a[3],
const float  b[3],
const float  c[3] 
)
void unit_axis_angle ( float  axis[3],
float *  angle 
)
void unit_qt ( float  q[4])
void vec_apply_track ( float  vec[3],
short  axis 
)

Definition at line 1648 of file math_rotation.c.

References assert, and copy_v3_v3().

Referenced by calc_curve_deform().

void vec_rot_to_mat3 ( float  mat[3][3],
const float  vec[3],
const float  phi 
)
void vec_rot_to_mat4 ( float  mat[4][4],
const float  vec[3],
const float  phi 
)
void vec_rot_to_quat ( float  quat[4],
const float  vec[3],
const float  phi 
)
void vec_to_quat ( float  q[4],
const float  vec[3],
short  axis,
const short  upflag 
)