Blender V4.3
BLI_math_matrix.h File Reference
#include "BLI_compiler_attrs.h"
#include "BLI_sys_types.h"

Go to the source code of this file.

Classes

struct  SpaceTransform
 

Functions

Init
void zero_m2 (float m[2][2])
 
void zero_m3 (float m[3][3])
 
void zero_m4 (float m[4][4])
 
void unit_m2 (float m[2][2])
 
void unit_m3 (float m[3][3])
 
void unit_m4 (float m[4][4])
 
void unit_m4_db (double m[4][4])
 
void copy_m2_m2 (float m1[2][2], const float m2[2][2])
 
void copy_m3_m3 (float m1[3][3], const float m2[3][3])
 
void copy_m4_m4 (float m1[4][4], const float m2[4][4])
 
void copy_m3_m4 (float m1[3][3], const float m2[4][4])
 
void copy_m4_m3 (float m1[4][4], const float m2[3][3])
 
void copy_m3_m2 (float m1[3][3], const float m2[2][2])
 
void copy_m4_m2 (float m1[4][4], const float m2[2][2])
 
void copy_m4_m4_db (double m1[4][4], const double m2[4][4])
 
void copy_m3_m3d (float m1[3][3], const double m2[3][3])
 
void copy_m3d_m3 (double m1[3][3], const float m2[3][3])
 
void copy_m4d_m4 (double m1[4][4], const float m2[4][4])
 
void swap_m3m3 (float m1[3][3], float m2[3][3])
 
void swap_m4m4 (float m1[4][4], float m2[4][4])
 
void shuffle_m4 (float R[4][4], const int index[4])
 

Arithmetic

#define mul_m3_series(...)   VA_NARGS_CALL_OVERLOAD(_va_mul_m3_series_, __VA_ARGS__)
 
#define mul_m4_series(...)   VA_NARGS_CALL_OVERLOAD(_va_mul_m4_series_, __VA_ARGS__)
 
void add_m3_m3m3 (float R[3][3], const float A[3][3], const float B[3][3])
 
void add_m4_m4m4 (float R[4][4], const float A[4][4], const float B[4][4])
 
void madd_m3_m3m3fl (float R[3][3], const float A[3][3], const float B[3][3], float f)
 
void madd_m4_m4m4fl (float R[4][4], const float A[4][4], const float B[4][4], float f)
 
void sub_m3_m3m3 (float R[3][3], const float A[3][3], const float B[3][3])
 
void sub_m4_m4m4 (float R[4][4], const float A[4][4], const float B[4][4])
 
void mul_m3_m3m3 (float R[3][3], const float A[3][3], const float B[3][3])
 
void mul_m4_m3m4 (float R[4][4], const float A[3][3], const float B[4][4])
 
void mul_m4_m4m3 (float R[4][4], const float A[4][4], const float B[3][3])
 
void mul_m4_m4m4 (float R[4][4], const float A[4][4], const float B[4][4])
 
void mul_m3_m3m4 (float R[3][3], const float A[3][3], const float B[4][4])
 
void mul_m3_m4m3 (float R[3][3], const float A[4][4], const float B[3][3])
 
void mul_m3_m4m4 (float R[3][3], const float A[4][4], const float B[4][4])
 
void mul_m3_m3_pre (float R[3][3], const float A[3][3])
 
void mul_m3_m3_post (float R[3][3], const float B[3][3])
 
void mul_m4db_m4db_m4fl (double R[4][4], const double A[4][4], const float B[4][4])
 
void mul_m4_m4_pre (float R[4][4], const float A[4][4])
 
void mul_m4_m4_post (float R[4][4], const float B[4][4])
 
void _va_mul_m3_series_3 (float r[3][3], const float m1[3][3], const float m2[3][3]) ATTR_NONNULL()
 
void _va_mul_m3_series_4 (float r[3][3], const float m1[3][3], const float m2[3][3], const float m3[3][3]) ATTR_NONNULL()
 
void _va_mul_m3_series_5 (float r[3][3], const float m1[3][3], const float m2[3][3], const float m3[3][3], const float m4[3][3]) ATTR_NONNULL()
 
void _va_mul_m3_series_6 (float r[3][3], const float m1[3][3], const float m2[3][3], const float m3[3][3], const float m4[3][3], const float m5[3][3]) ATTR_NONNULL()
 
void _va_mul_m3_series_7 (float r[3][3], const float m1[3][3], const float m2[3][3], const float m3[3][3], const float m4[3][3], const float m5[3][3], const float m6[3][3]) ATTR_NONNULL()
 
void _va_mul_m3_series_8 (float r[3][3], const float m1[3][3], const float m2[3][3], const float m3[3][3], const float m4[3][3], const float m5[3][3], const float m6[3][3], const float m7[3][3]) ATTR_NONNULL()
 
void _va_mul_m3_series_9 (float r[3][3], const float m1[3][3], const float m2[3][3], const float m3[3][3], const float m4[3][3], const float m5[3][3], const float m6[3][3], const float m7[3][3], const float m8[3][3]) ATTR_NONNULL()
 
void _va_mul_m4_series_3 (float r[4][4], const float m1[4][4], const float m2[4][4]) ATTR_NONNULL()
 
void _va_mul_m4_series_4 (float r[4][4], const float m1[4][4], const float m2[4][4], const float m3[4][4]) ATTR_NONNULL()
 
void _va_mul_m4_series_5 (float r[4][4], const float m1[4][4], const float m2[4][4], const float m3[4][4], const float m4[4][4]) ATTR_NONNULL()
 
void _va_mul_m4_series_6 (float r[4][4], const float m1[4][4], const float m2[4][4], const float m3[4][4], const float m4[4][4], const float m5[4][4]) ATTR_NONNULL()
 
void _va_mul_m4_series_7 (float r[4][4], const float m1[4][4], const float m2[4][4], const float m3[4][4], const float m4[4][4], const float m5[4][4], const float m6[4][4]) ATTR_NONNULL()
 
void _va_mul_m4_series_8 (float r[4][4], const float m1[4][4], const float m2[4][4], const float m3[4][4], const float m4[4][4], const float m5[4][4], const float m6[4][4], const float m7[4][4]) ATTR_NONNULL()
 
void _va_mul_m4_series_9 (float r[4][4], const float m1[4][4], const float m2[4][4], const float m3[4][4], const float m4[4][4], const float m5[4][4], const float m6[4][4], const float m7[4][4], const float m8[4][4]) ATTR_NONNULL()
 
void mul_m4_v3 (const float M[4][4], float r[3])
 
void mul_v3_m4v3 (float r[3], const float mat[4][4], const float vec[3])
 
void mul_v3_m4v3_db (double r[3], const double mat[4][4], const double vec[3])
 
void mul_v4_m4v3_db (double r[4], const double mat[4][4], const double vec[3])
 
void mul_v2_m4v3 (float r[2], const float mat[4][4], const float vec[3])
 
void mul_v2_m2v2 (float r[2], const float mat[2][2], const float vec[2])
 
void mul_m2_v2 (const float mat[2][2], float vec[2])
 
void mul_mat3_m4_v3 (const float mat[4][4], float r[3])
 
void mul_v3_mat3_m4v3 (float r[3], const float mat[4][4], const float vec[3])
 
void mul_v3_mat3_m4v3_db (double r[3], const double mat[4][4], const double vec[3])
 
void mul_m4_v4 (const float mat[4][4], float r[4])
 
void mul_v4_m4v4 (float r[4], const float mat[4][4], const float v[4])
 
void mul_v4_m4v3 (float r[4], const float M[4][4], const float v[3])
 
void mul_project_m4_v3 (const float mat[4][4], float vec[3])
 
void mul_v3_project_m4_v3 (float r[3], const float mat[4][4], const float vec[3])
 
void mul_v2_project_m4_v3 (float r[2], const float mat[4][4], const float vec[3])
 
void mul_m3_v2 (const float m[3][3], float r[2])
 
void mul_v2_m3v2 (float r[2], const float m[3][3], const float v[2])
 
void mul_m3_v3 (const float M[3][3], float r[3])
 
void mul_v3_m3v3 (float r[3], const float M[3][3], const float a[3])
 
void mul_v2_m3v3 (float r[2], const float M[3][3], const float a[3])
 
void mul_transposed_m3_v3 (const float M[3][3], float r[3])
 
void mul_transposed_mat3_m4_v3 (const float M[4][4], float r[3])
 
void mul_m3_v3_double (const float M[3][3], double r[3])
 
void mul_m4_m4m4_aligned_scale (float R[4][4], const float A[4][4], const float B[4][4])
 
void mul_m4_m4m4_split_channels (float R[4][4], const float A[4][4], const float B[4][4])
 
void mul_m3_fl (float R[3][3], float f)
 
void mul_m4_fl (float R[4][4], float f)
 
void mul_mat3_m4_fl (float R[4][4], float f)
 
void negate_m3 (float R[3][3])
 
void negate_mat3_m4 (float R[4][4])
 
void negate_m4 (float R[4][4])
 
bool invert_m3_ex (float mat[3][3], float epsilon)
 
bool invert_m3_m3_ex (float inverse[3][3], const float mat[3][3], float epsilon)
 
bool invert_m3 (float mat[3][3])
 
bool invert_m2_m2 (float inverse[2][2], const float mat[2][2])
 
bool invert_m3_m3 (float inverse[3][3], const float mat[3][3])
 
bool invert_m4 (float mat[4][4])
 
bool invert_m4_m4 (float inverse[4][4], const float mat[4][4])
 
bool invert_m4_m4_fallback (float inverse[4][4], const float mat[4][4])
 
void mul_m4_v4d (const float mat[4][4], double r[4])
 
void mul_v4d_m4v4d (double r[4], const float mat[4][4], const double v[4])
 
void mul_v3_m3v3_db (double r[3], const double M[3][3], const double a[3])
 
void mul_m3_v3_db (const double M[3][3], double r[3])
 

Linear Algebra

#define PSEUDOINVERSE_EPSILON   1e-8f
 
void transpose_m3 (float R[3][3])
 
void transpose_m3_m3 (float R[3][3], const float M[3][3])
 
void transpose_m3_m4 (float R[3][3], const float M[4][4])
 
void transpose_m4 (float R[4][4])
 
void transpose_m4_m4 (float R[4][4], const float M[4][4])
 
bool compare_m4m4 (const float mat1[4][4], const float mat2[4][4], float limit)
 
void normalize_m2_ex (float R[2][2], float r_scale[2]) ATTR_NONNULL()
 
void normalize_m2 (float R[2][2]) ATTR_NONNULL()
 
void normalize_m2_m2_ex (float R[2][2], const float M[2][2], float r_scale[2]) ATTR_NONNULL()
 
void normalize_m2_m2 (float R[2][2], const float M[2][2]) ATTR_NONNULL()
 
void normalize_m3_ex (float R[3][3], float r_scale[3]) ATTR_NONNULL()
 
void normalize_m3 (float R[3][3]) ATTR_NONNULL()
 
void normalize_m3_m3_ex (float R[3][3], const float M[3][3], float r_scale[3]) ATTR_NONNULL()
 
void normalize_m3_m3 (float R[3][3], const float M[3][3]) ATTR_NONNULL()
 
void normalize_m4_ex (float R[4][4], float r_scale[3]) ATTR_NONNULL()
 
void normalize_m4 (float R[4][4]) ATTR_NONNULL()
 
void normalize_m4_m4_ex (float rmat[4][4], const float mat[4][4], float r_scale[3]) ATTR_NONNULL()
 
void normalize_m4_m4 (float rmat[4][4], const float mat[4][4]) ATTR_NONNULL()
 
void orthogonalize_m3 (float R[3][3], int axis)
 
void orthogonalize_m4 (float R[4][4], int axis)
 
void orthogonalize_m3_stable (float R[3][3], int axis, bool normalize)
 
void orthogonalize_m4_stable (float R[4][4], int axis, bool normalize)
 
bool orthogonalize_m3_zero_axes (float m[3][3], float unit_length)
 
bool orthogonalize_m4_zero_axes (float m[4][4], float unit_length)
 
bool is_orthogonal_m3 (const float m[3][3])
 
bool is_orthogonal_m4 (const float m[4][4])
 
bool is_orthonormal_m3 (const float m[3][3])
 
bool is_orthonormal_m4 (const float m[4][4])
 
bool is_uniform_scaled_m3 (const float m[3][3])
 
bool is_uniform_scaled_m4 (const float m[4][4])
 
void adjoint_m2_m2 (float R[2][2], const float M[2][2])
 
void adjoint_m3_m3 (float R[3][3], const float M[3][3])
 
void adjoint_m4_m4 (float R[4][4], const float M[4][4])
 
float determinant_m2 (float a, float b, float c, float d)
 
float determinant_m3 (float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3)
 
float determinant_m3_array (const float m[3][3])
 
float determinant_m4_mat3_array (const float m[4][4])
 
double determinant_m3_array_db (const double m[3][3])
 
float determinant_m4 (const float m[4][4])
 
void svd_m4 (float U[4][4], float s[4], float V[4][4], float A_[4][4])
 
void pseudoinverse_m4_m4 (float inverse[4][4], const float mat[4][4], float epsilon)
 
void pseudoinverse_m3_m3 (float inverse[3][3], const float mat[3][3], float epsilon)
 
bool has_zero_axis_m4 (const float matrix[4][4])
 
void zero_axis_bias_m4 (float mat[4][4])
 
void invert_m4_m4_safe (float inverse[4][4], const float mat[4][4])
 
void invert_m3_m3_safe_ortho (float inverse[3][3], const float mat[3][3])
 
void invert_m4_m4_safe_ortho (float inverse[4][4], const float mat[4][4])
 

Transformations

#define BLI_SPACE_TRANSFORM_SETUP(data, local, target)
 
typedef struct SpaceTransform SpaceTransform
 
void scale_m3_fl (float R[3][3], float scale)
 
void scale_m4_fl (float R[4][4], float scale)
 
void scale_m4_v2 (float R[4][4], const float scale[2])
 
float mat3_to_volume_scale (const float mat[3][3])
 
float mat4_to_volume_scale (const float mat[4][4])
 
float mat3_to_scale (const float mat[3][3])
 
float mat4_to_scale (const float mat[4][4])
 
float mat4_to_xy_scale (const float mat[4][4])
 
void size_to_mat3 (float R[3][3], const float size[3])
 
void size_to_mat4 (float R[4][4], const float size[3])
 
void mat3_to_size_2d (float size[2], const float M[3][3])
 
void mat3_to_size (float size[3], const float M[3][3])
 
void mat4_to_size (float size[3], const float M[4][4])
 
float mat3_to_size_max_axis (const float M[3][3])
 
float mat4_to_size_max_axis (const float M[4][4])
 
void mat4_to_size_fix_shear (float size[3], const float M[4][4])
 
void translate_m4 (float mat[4][4], float Tx, float Ty, float Tz)
 
void rotate_m4 (float mat[4][4], char axis, float angle)
 
void rescale_m4 (float mat[4][4], const float scale[3])
 
void transform_pivot_set_m4 (float mat[4][4], const float pivot[3])
 
void mat4_to_rot (float rot[3][3], const float wmat[4][4])
 
void mat3_to_rot_size (float rot[3][3], float size[3], const float mat3[3][3])
 
void mat4_to_loc_rot_size (float loc[3], float rot[3][3], float size[3], const float wmat[4][4])
 
void mat4_to_loc_quat (float loc[3], float quat[4], const float wmat[4][4])
 
void mat4_decompose (float loc[3], float quat[4], float size[3], const float wmat[4][4])
 
void mat3_polar_decompose (const float mat3[3][3], float r_U[3][3], float r_P[3][3])
 
void loc_rot_size_to_mat4 (float R[4][4], const float loc[3], const float rot[3][3], const float size[3])
 
void loc_eul_size_to_mat4 (float R[4][4], const float loc[3], const float eul[3], const float size[3])
 
void loc_eulO_size_to_mat4 (float R[4][4], const float loc[3], const float eul[3], const float size[3], short order)
 
void loc_quat_size_to_mat4 (float R[4][4], const float loc[3], const float quat[4], const float size[3])
 
void loc_axisangle_size_to_mat4 (float R[4][4], const float loc[3], const float axis[3], float angle, const float size[3])
 
void blend_m3_m3m3 (float out[3][3], const float dst[3][3], const float src[3][3], float srcweight)
 
void blend_m4_m4m4 (float out[4][4], const float dst[4][4], const float src[4][4], float srcweight)
 
void interp_m3_m3m3 (float R[3][3], const float A[3][3], const float B[3][3], float t)
 
void interp_m4_m4m4 (float R[4][4], const float A[4][4], const float B[4][4], float t)
 
bool is_negative_m3 (const float mat[3][3])
 
bool is_negative_m4 (const float mat[4][4])
 
bool is_zero_m3 (const float mat[3][3])
 
bool is_zero_m4 (const float mat[4][4])
 
bool equals_m3m3 (const float mat1[3][3], const float mat2[3][3])
 
bool equals_m4m4 (const float mat1[4][4], const float mat2[4][4])
 
void BLI_space_transform_from_matrices (struct SpaceTransform *data, const float local[4][4], const float target[4][4])
 
void BLI_space_transform_global_from_matrices (struct SpaceTransform *data, const float local[4][4], const float target[4][4])
 
void BLI_space_transform_apply (const struct SpaceTransform *data, float co[3])
 
void BLI_space_transform_invert (const struct SpaceTransform *data, float co[3])
 
void BLI_space_transform_apply_normal (const struct SpaceTransform *data, float no[3])
 
void BLI_space_transform_invert_normal (const struct SpaceTransform *data, float no[3])
 

Other

#define print_m3_id(M)   print_m3(STRINGIFY(M), M)
 
#define print_m4_id(M)   print_m4(STRINGIFY(M), M)
 
void print_m3 (const char *str, const float m[3][3])
 
void print_m4 (const char *str, const float m[4][4])
 

Macro Definition Documentation

◆ BLI_SPACE_TRANSFORM_SETUP

#define BLI_SPACE_TRANSFORM_SETUP ( data,
local,
target )
Value:
(data), (local)->object_to_world().ptr(), (target)->object_to_world().ptr())
void BLI_space_transform_from_matrices(struct SpaceTransform *data, const float local[4][4], const float target[4][4])
PointerRNA * ptr
Definition wm_files.cc:4126

Definition at line 623 of file BLI_math_matrix.h.

Referenced by BKE_shrinkwrap_remesh_target_project(), blender::ed::object::data_transfer_exec(), modify_mesh(), modify_mesh(), shrinkwrap_calc_normal_projection(), shrinkwrapGpencilModifier_deform(), shrinkwrapModifier_deform(), shrinkwrapParams_deform(), and SimpleDeformModifier_do().

◆ mul_m3_series

◆ mul_m4_series

◆ print_m3_id

#define print_m3_id ( M)    print_m3(STRINGIFY(M), M)

Definition at line 636 of file BLI_math_matrix.h.

◆ print_m4_id

#define print_m4_id ( M)    print_m4(STRINGIFY(M), M)

Definition at line 637 of file BLI_math_matrix.h.

◆ PSEUDOINVERSE_EPSILON

Typedef Documentation

◆ SpaceTransform

typedef struct SpaceTransform SpaceTransform

SpaceTransform struct encapsulates all needed data to convert between two coordinate spaces (where conversion can be represented by a matrix multiplication).

A SpaceTransform is initialized using:

After that the following calls can be used:

  • Converts a coordinate in ob1 space to the corresponding ob2 space: #BLI_space_transform_apply(&data, co);
  • Converts a coordinate in ob2 space to the corresponding ob1 space: #BLI_space_transform_invert(&data, co);

Same concept as BLI_space_transform_apply and BLI_space_transform_invert, but no is normalized after conversion (and not translated at all!):

  • #BLI_space_transform_apply_normal(&data, no);
  • #BLI_space_transform_invert_normal(&data, no);

Function Documentation

◆ _va_mul_m3_series_3()

void _va_mul_m3_series_3 ( float r[3][3],
const float m1[3][3],
const float m2[3][3] )

Definition at line 505 of file math_matrix_c.cc.

References mul_m3_m3m3().

◆ _va_mul_m3_series_4()

void _va_mul_m3_series_4 ( float r[3][3],
const float m1[3][3],
const float m2[3][3],
const float m3[3][3] )

Definition at line 509 of file math_matrix_c.cc.

References mul_m3_m3m3().

◆ _va_mul_m3_series_5()

void _va_mul_m3_series_5 ( float r[3][3],
const float m1[3][3],
const float m2[3][3],
const float m3[3][3],
const float m4[3][3] )

Definition at line 518 of file math_matrix_c.cc.

References mul_m3_m3m3().

◆ _va_mul_m3_series_6()

void _va_mul_m3_series_6 ( float r[3][3],
const float m1[3][3],
const float m2[3][3],
const float m3[3][3],
const float m4[3][3],
const float m5[3][3] )

Definition at line 530 of file math_matrix_c.cc.

References mul_m3_m3m3().

◆ _va_mul_m3_series_7()

void _va_mul_m3_series_7 ( float r[3][3],
const float m1[3][3],
const float m2[3][3],
const float m3[3][3],
const float m4[3][3],
const float m5[3][3],
const float m6[3][3] )

Definition at line 544 of file math_matrix_c.cc.

References mul_m3_m3m3().

◆ _va_mul_m3_series_8()

void _va_mul_m3_series_8 ( float r[3][3],
const float m1[3][3],
const float m2[3][3],
const float m3[3][3],
const float m4[3][3],
const float m5[3][3],
const float m6[3][3],
const float m7[3][3] )

Definition at line 560 of file math_matrix_c.cc.

References mul_m3_m3m3().

◆ _va_mul_m3_series_9()

void _va_mul_m3_series_9 ( float r[3][3],
const float m1[3][3],
const float m2[3][3],
const float m3[3][3],
const float m4[3][3],
const float m5[3][3],
const float m6[3][3],
const float m7[3][3],
const float m8[3][3] )

Definition at line 578 of file math_matrix_c.cc.

References mul_m3_m3m3().

◆ _va_mul_m4_series_3()

void _va_mul_m4_series_3 ( float r[4][4],
const float m1[4][4],
const float m2[4][4] )

Definition at line 605 of file math_matrix_c.cc.

References mul_m4_m4m4().

◆ _va_mul_m4_series_4()

void _va_mul_m4_series_4 ( float r[4][4],
const float m1[4][4],
const float m2[4][4],
const float m3[4][4] )

Definition at line 609 of file math_matrix_c.cc.

References mul_m4_m4m4().

◆ _va_mul_m4_series_5()

void _va_mul_m4_series_5 ( float r[4][4],
const float m1[4][4],
const float m2[4][4],
const float m3[4][4],
const float m4[4][4] )

Definition at line 618 of file math_matrix_c.cc.

References mul_m4_m4m4().

◆ _va_mul_m4_series_6()

void _va_mul_m4_series_6 ( float r[4][4],
const float m1[4][4],
const float m2[4][4],
const float m3[4][4],
const float m4[4][4],
const float m5[4][4] )

Definition at line 630 of file math_matrix_c.cc.

References mul_m4_m4m4().

◆ _va_mul_m4_series_7()

void _va_mul_m4_series_7 ( float r[4][4],
const float m1[4][4],
const float m2[4][4],
const float m3[4][4],
const float m4[4][4],
const float m5[4][4],
const float m6[4][4] )

Definition at line 644 of file math_matrix_c.cc.

References mul_m4_m4m4().

◆ _va_mul_m4_series_8()

void _va_mul_m4_series_8 ( float r[4][4],
const float m1[4][4],
const float m2[4][4],
const float m3[4][4],
const float m4[4][4],
const float m5[4][4],
const float m6[4][4],
const float m7[4][4] )

Definition at line 660 of file math_matrix_c.cc.

References mul_m4_m4m4().

◆ _va_mul_m4_series_9()

void _va_mul_m4_series_9 ( float r[4][4],
const float m1[4][4],
const float m2[4][4],
const float m3[4][4],
const float m4[4][4],
const float m5[4][4],
const float m6[4][4],
const float m7[4][4],
const float m8[4][4] )

Definition at line 678 of file math_matrix_c.cc.

References mul_m4_m4m4().

◆ add_m3_m3m3()

◆ add_m4_m4m4()

void add_m4_m4m4 ( float R[4][4],
const float A[4][4],
const float B[4][4] )

Definition at line 1033 of file math_matrix_c.cc.

References B, and R.

Referenced by add_weighted_dq_dq().

◆ adjoint_m2_m2()

void adjoint_m2_m2 ( float R[2][2],
const float M[2][2] )

Definition at line 1968 of file math_matrix_c.cc.

References M, and R.

Referenced by adjoint_matrix_n(), and invert_m2_m2().

◆ adjoint_m3_m3()

void adjoint_m3_m3 ( float R[3][3],
const float M[3][3] )

Definition at line 1981 of file math_matrix_c.cc.

References BLI_assert, M, and R.

Referenced by adjoint_matrix_n(), invert_m3_m3(), and invert_m3_m3_ex().

◆ adjoint_m4_m4()

void adjoint_m4_m4 ( float R[4][4],
const float M[4][4] )

Definition at line 1997 of file math_matrix_c.cc.

References determinant_m3(), M, and R.

Referenced by adjoint_matrix_n().

◆ blend_m3_m3m3()

void blend_m3_m3m3 ( float out[3][3],
const float dst[3][3],
const float src[3][3],
float srcweight )

◆ blend_m4_m4m4()

void blend_m4_m4m4 ( float out[4][4],
const float dst[4][4],
const float src[4][4],
float srcweight )

◆ BLI_space_transform_apply()

◆ BLI_space_transform_apply_normal()

◆ BLI_space_transform_from_matrices()

void BLI_space_transform_from_matrices ( struct SpaceTransform * data,
const float local[4][4],
const float target[4][4] )

Global-invariant transform.

This defines a matrix transforming a point in local space to a point in target space such that its global coordinates remain unchanged.

In other words, if we have a global point P with local coordinates (x, y, z) and global coordinates (X, Y, Z), this defines a transform matrix TM such that (x', y', z') = TM * (x, y, z) where (x', y', z') are the coordinates of P' in target space such that it keeps (X, Y, Z) coordinates in global space.

Definition at line 3203 of file math_matrix_c.cc.

References invert_m4_m4(), and mul_m4_m4m4().

Referenced by shrinkwrap_get_tarmat().

◆ BLI_space_transform_global_from_matrices()

void BLI_space_transform_global_from_matrices ( struct SpaceTransform * data,
const float local[4][4],
const float target[4][4] )

Local-invariant transform.

This defines a matrix transforming a point in global space such that its local coordinates (from local space to target space) remain unchanged.

In other words, if we have a local point p with local coordinates (x, y, z) and global coordinates (X, Y, Z), this defines a transform matrix TM such that (X', Y', Z') = TM * (X, Y, Z) where (X', Y', Z') are the coordinates of p' in global space such that it keeps (x, y, z) coordinates in target space.

Definition at line 3213 of file math_matrix_c.cc.

References invert_m4_m4(), and mul_m4_m4m4().

Referenced by BKE_mesh_remap_find_best_match_from_mesh().

◆ BLI_space_transform_invert()

◆ BLI_space_transform_invert_normal()

◆ compare_m4m4()

bool compare_m4m4 ( const float mat1[4][4],
const float mat2[4][4],
float limit )

◆ copy_m2_m2()

void copy_m2_m2 ( float m1[2][2],
const float m2[2][2] )

Definition at line 73 of file math_matrix_c.cc.

Referenced by matrix_invert_safe_internal().

◆ copy_m3_m2()

void copy_m3_m2 ( float m1[3][3],
const float m2[2][2] )

Definition at line 133 of file math_matrix_c.cc.

◆ copy_m3_m3()

void copy_m3_m3 ( float m1[3][3],
const float m2[3][3] )

Definition at line 78 of file math_matrix_c.cc.

Referenced by add_pose_transdata(), addMatrixSpace(), apply_shear_value(), applyBoneSize(), applyResize(), applySkinResize(), applyTrackballValue(), applyTransformOrientation(), armature_vert_task_with_dvert(), bezt_to_transdata(), BKE_crazyspace_build_sculpt(), BKE_object_rot_to_mat3(), build_emats_stack(), calc_initial_placement_point_from_view(), cancel_slide_point(), cloth_hair_update_bending_rest_targets(), cloth_hair_update_bending_targets(), connection_node_frames(), connection_node_mat(), copy_bone_transform(), createTransArmatureVerts(), createTransCursor_view3d(), createTransCurveVerts(), createTransEdge(), createTransGPencil_curves(), createTransGPencil_strokes(), createTransLatticeVerts(), createTransMBallVerts(), createTransSculpt(), deform_matrices(), deform_matrices_EM(), ED_transform_calc_gizmo_stats(), ED_transform_calc_orientation_from_type_ex(), ElementResize(), end_node_frames(), execute_posetree(), gizmo_axis_draw(), gizmo_mesh_extrude_refresh(), gizmo_mesh_spin_redo_setup(), invert_m3(), invert_m3_ex(), invert_m3_m3_safe_ortho(), MaskHandleToTransData(), MaskPointToTransData(), mat3_align_axis_to_v3(), mat3_from_axis_conversion(), mat3_normalized_to_quat(), mat3_to_quat_legacy(), matrix_invert_safe_internal(), Matrix_rotate(), Matrix_to_euler(), mul_m3_m3m3(), mul_m3_m3m4(), mul_m3_m4m3(), mul_v3m3_dq(), ObjectToTransData(), SB_estimate_transform(), set_prop_dist(), SIM_mass_spring_add_constraint_ndof1(), SIM_mass_spring_add_constraint_ndof2(), SIM_mass_spring_force_drag(), SIM_mass_spring_force_reference_frame(), SIM_mass_spring_force_spring_bending_hair(), SIM_mass_spring_set_rest_transform(), slide_point_customdata(), spring_hairbend_estimate_dfdv(), spring_hairbend_estimate_dfdx(), transdata_elem_shear(), transdata_elem_skin_resize(), transform_convert_mesh_crazyspace_transdata_set(), transform_orientation_matrix_get(), transform_orientations_current_set(), transformViewUpdate(), v3d_cursor_snap_update(), vcloud_estimate_transform_v3(), VertsToTransData(), view3d_interactive_add_calc_snap(), view3d_interactive_add_modal(), and world_to_root_m3().

◆ copy_m3_m3d()

void copy_m3_m3d ( float m1[3][3],
const double m2[3][3] )

◆ copy_m3_m4()

void copy_m3_m4 ( float m1[3][3],
const float m2[4][4] )

Definition at line 94 of file math_matrix_c.cc.

Referenced by add_pose_transdata(), apply_targetless_ik(), applyarmature_set_edit_position(), armature_bone_primitive_add_exec(), armature_calc_roll_exec(), armature_click_extrude_exec(), armature_finalize_restpose(), armature_transform_recurse(), armature_vert_task_with_dvert(), BKE_armature_transform(), BKE_bone_parent_transform_calc_from_matrices(), BKE_pchan_bbone_handles_compute(), BMD_mesh_intersection(), BMO_slot_mat3_get(), blender::ed::sculpt_paint::filter::cache_init(), camera_frame_fit_data_init(), contarget_get_mesh_mat(), convert_tree(), createObjectSpace(), createTransArmatureVerts(), createTransCurveVerts(), createTransEdge(), createTransEditVerts(), createTransGPencil_curves(), createTransGPencil_strokes(), createTransLatticeVerts(), createTransMBallVerts(), createTransMeshSkin(), createTransMeshVertCData(), createTransSculpt(), createTransTexspace(), createViewSpace(), curve_populate_trans_data_structs(), deformVerts_do(), do_version_bone_roll_256(), ED_armature_ebone_from_mat4(), ED_armature_edit_transform(), ed_editnurb_spin(), ED_transform_calc_gizmo_stats(), ED_transform_calc_orientation_from_type_ex(), ED_view3d_from_m4(), ED_view3d_minmax_verts(), edbm_extrude_repeat_exec(), EDBM_unified_findnearest_from_raycast(), execute_posetree(), face_dupli(), flyApply(), getTransformOrientation_ex(), gimbal_axis_object(), gimbal_axis_pose(), gizmo_3d_draw_invoke(), gizmo_axis_draw(), gizmo_mesh_extrude_draw_prepare(), gizmo_mesh_spin_init_draw_prepare(), gizmo_mesh_spin_init_refresh(), GPU_matrix_normal_get(), hair_create_input_mesh(), blender::ed::sculpt_paint::gesture::init_common(), init_curve_deform(), init_TransDataContainers(), initFlyInfo(), initResize(), interp_m4_m4m4(), is_uniform_scaled_m4(), locktrack_evaluate(), mat4_normalized_to_compatible_eulO(), mat4_normalized_to_eul(), mat4_normalized_to_eulO(), mat4_normalized_to_quat(), mat4_to_compatible_eulO(), mat4_to_dquat(), mat4_to_eul(), mat4_to_eulO(), mat4_to_loc_quat(), mat4_to_loc_rot_size(), mat4_to_quat(), Matrix_to_euler(), meshdeformModifier_do(), modify_mesh(), modify_mesh(), move3d_get_translate(), mul_v3m3_dq(), blender::ed::object::new_primitive_matrix(), nurb_bezt_direction_worldspace_get(), nurb_bpoint_direction_worldspace_get(), blender::ed::object::object_hook_recenter_exec(), blender::ed::object::object_origin_clear_exec(), blender::ed::object::object_origin_set_exec(), blender::ed::object::object_transform_axis_target_modal(), ObjectToTransData(), OVERLAY_gpencil_legacy_cache_init(), paintface_minmax(), pchan_deform_accumulate(), pivotcon_evaluate(), proj_paint_state_viewport_init(), pseudoinverse_m3_m3(), RotationBetween(), SCULPT_cursor_geometry_info_update(), blender::ed::sculpt_paint::sculpt_update_cache_invariants(), blender::io::ply::set_world_axes_transform(), similar_edge_select_exec(), similar_face_select_exec(), snap_curs_to_sel_ex(), snap_sel_to_grid_exec(), snap_selected_to_location(), solve_parenting(), blender::geometry::transform_curve_edit_hints(), transformViewUpdate(), blender::ed::sculpt_paint::vwpaint::update_cache_invariants(), uv_map_transform(), uv_select_similar_edge_exec(), uv_select_similar_face_exec(), uv_select_similar_island_exec(), uv_select_similar_vert_exec(), v3d_cursor_poject_surface_normal(), v3d_cursor_snap_update(), vfont_to_curve(), blender::ed::object::voxel_size_edit_invoke(), walkApply(), WIDGETGROUP_gizmo_draw_prepare(), WIDGETGROUP_xform_cage_draw_prepare(), WIDGETGROUP_xform_cage_refresh(), WIDGETGROUP_xform_shear_draw_prepare(), and WIDGETGROUP_xform_shear_refresh().

◆ copy_m3d_m3()

void copy_m3d_m3 ( double m1[3][3],
const float m2[3][3] )

Definition at line 171 of file math_matrix_c.cc.

Referenced by blender::bke::tests::EXPECT_M3_ORTHOGONAL().

◆ copy_m4_m2()

void copy_m4_m2 ( float m1[4][4],
const float m2[2][2] )

Definition at line 148 of file math_matrix_c.cc.

◆ copy_m4_m3()

void copy_m4_m3 ( float m1[4][4],
const float m2[3][3] )

Definition at line 109 of file math_matrix_c.cc.

Referenced by blender::ed::object::apply_objects_internal(), applyarmature_set_edit_position(), applyRotationMatrix(), applyTrackballMatrix(), axis_angle_to_mat4(), axis_angle_to_mat4_single(), BCMatrix::BCMatrix(), BKE_armature_where_is_bone(), BKE_bone_offset_matrix_get(), BKE_bone_parent_transform_calc_from_matrices(), BKE_object_to_mat4(), BKE_pchan_to_mat4(), BMO_slot_mat_set(), C_Matrix_LocRotScale(), camera_frame_fit_data_init(), blender::io::usd::convert_to_z_up(), blender::io::alembic::copy_m44_axis_swap(), blender::io::usd::USDTransformWriter::do_write(), ED_armature_ebone_to_mat4(), ED_armature_join_objects_exec(), ED_transform_calc_gizmo_stats(), ED_view3d_win_to_3d_on_plane_with_fallback(), eulO_to_mat4(), gizmo_3d_setup_default_matrix(), gizmo_axis_draw(), gizmo_mesh_placement_modal_from_setup(), GPU_shader_uniform_mat3_as_mat4(), blender::io::ply::importer_main(), blender::io::stl::importer_main(), interp_m4_m4m4(), loc_eul_size_to_mat4(), loc_eulO_size_to_mat4(), loc_quat_size_to_mat4(), loc_rot_size_to_mat4(), make_bbone_spline_matrix(), mesh_calc_eigen_matrix(), modify_mesh(), blender::ed::object::new_primitive_matrix(), ob_parvert3(), blender::ed::object::object_apply_rotation(), pseudoinverse_m3_m3(), resize_transform_matrix_fn(), splineik_evaluate_bone(), transform_gizmo_3d_model_from_constraint_and_mode_set(), blender::io::obj::transform_object(), v3d_cursor_snap_draw_fn(), view3d_ob_drop_matrix_from_snap(), where_is_ik_bone(), WIDGETGROUP_tool_generic_refresh(), WIDGETGROUP_xform_cage_refresh(), and wm_xr_fly_compute_turn().

◆ copy_m4_m4()

void copy_m4_m4 ( float m1[4][4],
const float m2[4][4] )

Definition at line 84 of file math_matrix_c.cc.

Referenced by actcon_get_tarmat(), TransformWriter::add_joint_transform(), add_weighted_dq_dq(), annotation_paint_initstroke(), annotation_session_initdata(), AnimationImporter::apply_matrix_curves(), blender::ed::object::apply_objects_internal(), arrayModifier_doArray(), blender::ed::object::bake(), base_callback(), bc_add_global_transform(), bc_bone_matrix_local_get(), bc_create_restpose_mat(), BKE_bone_parent_transform_calc_from_matrices(), BKE_camera_multiview_window_matrix(), BKE_constraint_mat_convertspace(), BKE_constraint_target_matrix_get(), BKE_constraints_clear_evalob(), BKE_constraints_make_evalob(), BKE_constraints_solve(), BKE_gpencil_layer_transform_matrix_get(), BKE_gpencil_update_layer_transforms(), BKE_grease_pencil_copy_layer_parameters(), BKE_lattice_deform_data_create(), BKE_lattice_resize(), BKE_mesh_remap_find_best_match_from_mesh(), BKE_object_apply_parent_inverse(), BKE_object_eval_parent(), BKE_object_get_parent_matrix(), BKE_object_matrix_local_get(), BKE_object_sync_to_original(), BKE_object_tfm_backup(), BKE_object_tfm_restore(), BKE_pchan_bbone_spline_params_get(), BKE_pchan_minmax(), BKE_pose_copy_pchan_result(), BKE_pose_eval_bone(), BKE_pose_where_is(), BKE_scene_base_iter_next(), BKE_tracking_camera_get_reconstructed_interpolate(), BKE_tracking_get_projection_matrix(), BLI_uvproject_camera_info(), BMO_slot_mat4_get(), BMO_slot_mat_set(), box_clip_bounds_m4(), brush_add(), bundle_midpoint(), blender::ed::sculpt_paint::filter::cache_init(), blender::ed::sculpt_paint::calc_brush_local_mat(), AnimationImporter::calc_joint_parent_mat_rest(), camera_model_matrix(), camera_stereo3d_model_matrix(), camera_view3d_reconstruction(), camerasolver_evaluate(), childof_evaluate(), clampto_evaluate(), constraint_target_to_mat4(), contarget_get_lattice_mat(), contarget_get_mesh_mat(), convert_pose(), convert_tree(), copy_bone_transform(), blender::io::alembic::create_transform_matrix(), createTransSculpt(), damptrack_do_transform(), blender::ed::object::data_xform_container_item_ensure(), deformVerts_do(), displaceModifier_do(), dist_squared_to_projected_aabb_precalc(), blender::io::usd::USDTransformWriter::do_write(), draw_axes(), draw_bone_degrees_of_freedom(), draw_bone_update_disp_matrix_default(), draw_view_matrix_state_update(), drawPropCircle(), drawSnapping(), drw_call_matrix_init(), DRW_draw_depth_object(), DRW_hair_duplimat_get(), DRW_view_persmat_get(), DRW_view_update(), DRW_view_viewmat_get(), DRW_view_winmat_get(), dvar_eval_locDiff(), dvar_eval_transChan(), dynamicPaint_brushMeshCalculateVelocity(), dynamicPaint_brushObjectCalculateVelocity(), dynamicPaint_generateBakeData(), blender::ed::sculpt_paint::dyntopo::dyntopo_detail_size_edit_invoke(), ED_curve_add_nurbs_primitive(), ED_mesh_deform_bind_callback(), ED_transform_calc_gizmo_stats(), ED_transform_snap_object_project_ray_ex(), ED_transform_snap_object_project_view3d_ex(), ED_view3d_cameracontrol_update(), ED_view3d_draw_offscreen_imbuf(), ED_view3d_draw_offscreen_imbuf_simple(), ED_view3d_mats_rv3d_backup(), ED_view3d_mats_rv3d_restore(), ED_view3d_update_viewmat(), AnimationImporter::evaluate_transform_at_frame(), execute_posetree(), followpath_evaluate(), followpath_get_tarmat(), followtrack_evaluate_using_2d_position(), followtrack_evaluate_using_3d_position_camera(), followtrack_evaluate_using_3d_position_object(), SkinInfo::get_joint_inv_bind_matrix(), TransformReader::get_node_mat(), gizmo_arrow_matrix_basis_get(), gizmo_cage2d_exit(), gizmo_cage2d_invoke(), gizmo_cage2d_modal(), gizmo_cage3d_exit(), gizmo_cage3d_invoke(), gizmo_cage3d_modal(), gizmo_modal(), gizmo_move_matrix_basis_get(), gizmo_refresh_from_matrix(), GPENCIL_draw_object(), gpencil_light_pool_populate(), GPU_matrix_model_view_get(), GPU_matrix_projection_get(), GPU_matrix_projection_set(), GPU_matrix_push(), GPU_matrix_push_projection(), GPU_matrix_set(), blender::ed::greasepencil::grease_pencil_layer_parent_clear(), blender::ed::greasepencil::grease_pencil_layer_parent_set(), i_multmatrix(), blender::ed::object::ignore_parent_tx(), init_context(), init_meta(), init_TransDataContainers(), invert_m4(), invert_m4_m4_safe(), invert_m4_m4_safe_ortho(), kinematic_get_tarmat(), blender::bke::greasepencil::Layer::Layer(), blender::bke::greasepencil::convert::legacy_gpencil_to_grease_pencil(), blender::bke::greasepencil::convert::legacy_object_modifier_hook(), lineart_create_render_buffer_v3(), lineart_main_get_view_vector(), lineart_main_try_generate_shadow_v3(), SkinInfo::link_armature(), make_dmats(), make_duplis_font(), make_duplis_particle_system(), blender::ed::object::make_object_duplilist_real(), mat4_to_dquat(), matrix_from_obj_pchan(), matrix_invert_safe_internal(), Matrix_resize_4x4(), minmax_evaluate(), modify_mesh(), motion_path_cache(), mul_m4_m3m4(), mul_m4_m4m3(), mul_m4_m4m4(), ob_parbone(), ob_parcurve(), blender::ed::object::object_apply_location(), blender::ed::object::object_warp_verts_exec(), blender::ed::object::object_xform_array_m4(), blender::ed::object::object_xform_skip_child_container_item_ensure(), objectsolver_evaluate(), ObjectToTransData(), OVERLAY_forcefield(), OVERLAY_gpencil_legacy_cache_init(), OVERLAY_image_empty_cache_populate(), OVERLAY_light_cache_populate(), OVERLAY_lightprobe_cache_populate(), OVERLAY_relationship_lines(), pack_data_in_mat4(), pack_fl_in_mat4(), blender::ed::sculpt_paint::paint_cursor_drawing_setup_cursor_space(), pose_channel_flush_to_orig_if_needed(), proj_paint_state_viewport_init(), projmat_from_subregion(), RE_GetCameraWindow(), RE_GetWindowMatrixWithOverscan(), RE_SetCamera(), AnimationImporter::read_node_transform(), reconstruct_retrieve_libmv_tracks(), remap_hair_emitter(), rotlike_evaluate(), select_cache_init(), BCMatrix::set_transform(), BCMatrix::set_transform(), setTransformViewMatrices(), shrinkwrap_evaluate(), shrinkwrap_get_tarmat(), single_axis_convert(), SkinInfo::SkinInfo(), spin_exec(), svd_m4(), target_callback(), translike_evaluate(), blender::ed::sculpt_paint::gesture::update_affected_nodes_by_clip_planes(), ArmatureBoneDrawStrategyCustomShape::update_display_matrix(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_rotate_transform_and_target_property(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_scale_transform_and_target_property(), blender::ed::view3d::geometry_nodes_gizmos::DialGizmo::update_transform(), blender::ed::view3d::geometry_nodes_gizmos::LinearGizmo::update_transform(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_translate_transform_and_target_property(), uv_from_view_exec(), uv_map_rotation_matrix_ex(), uvprojectModifier_do(), v3d_cursor_snap_update(), v3d_object_dimension_buts(), view3d_camera_to_view_selected_impl(), blender::animrig::visualkey_get_values(), what_does_obaction(), where_is_ik_bone(), WIDGETGROUP_armature_spline_refresh(), WIDGETGROUP_empty_image_refresh(), WIDGETGROUP_light_area_refresh(), WIDGETGROUP_light_spot_refresh(), blender::ed::space_node::WIDGETGROUP_node_corner_pin_draw_prepare(), WIDGETGROUP_xform_cage_refresh(), wireframe_hair_cache_populate(), WM_gizmo_calc_matrix_final_params(), wm_xr_fly_compute_turn(), wm_xr_grab_compute(), and WM_xr_session_state_viewer_pose_matrix_info_get().

◆ copy_m4_m4_db()

void copy_m4_m4_db ( double m1[4][4],
const double m2[4][4] )

◆ copy_m4d_m4()

void copy_m4d_m4 ( double m1[4][4],
const float m2[4][4] )

Definition at line 186 of file math_matrix_c.cc.

Referenced by lineart_object_load_single_instance(), and projmat_dimensions_db().

◆ determinant_m2()

float determinant_m2 ( float a,
float b,
float c,
float d )

◆ determinant_m3()

float determinant_m3 ( float a1,
float a2,
float a3,
float b1,
float b2,
float b3,
float c1,
float c2,
float c3 )

◆ determinant_m3_array()

◆ determinant_m3_array_db()

double determinant_m3_array_db ( const double m[3][3])

Definition at line 1102 of file math_matrix_c.cc.

Referenced by blender::bke::tests::EXPECT_M3_ORTHOGONAL().

◆ determinant_m4()

float determinant_m4 ( const float m[4][4])

◆ determinant_m4_mat3_array()

float determinant_m4_mat3_array ( const float m[4][4])

Definition at line 1095 of file math_matrix_c.cc.

Referenced by is_negative_m4(), and mat4_to_volume_scale().

◆ equals_m3m3()

bool equals_m3m3 ( const float mat1[3][3],
const float mat2[3][3] )

◆ equals_m4m4()

◆ has_zero_axis_m4()

bool has_zero_axis_m4 ( const float matrix[4][4])

Definition at line 3110 of file math_matrix_c.cc.

References len_squared_v3().

Referenced by object_has_zero_axis_matrix().

◆ interp_m3_m3m3()

void interp_m3_m3m3 ( float R[3][3],
const float A[3][3],
const float B[3][3],
float t )

A polar-decomposition-based interpolation between matrix A and matrix B.

Note
This code is about five times slower as the 'naive' interpolation done by blend_m3_m3m3 (it typically remains below 2 usec on an average i74700, while blend_m3_m3m3 remains below 0.4 usec). However, it gives expected results even with non-uniformly scaled matrices, see #46418 for an example.

Based on "Matrix Animation and Polar Decomposition", by Ken Shoemake & Tom Duff

Parameters
RResulting interpolated matrix.
AInput matrix which is totally effective with t = 0.0.
BInput matrix which is totally effective with t = 1.0.
tInterpolation factor.

Definition at line 2432 of file math_matrix_c.cc.

References B, interp_qt_qtqt(), interp_v3_v3v3(), is_negative_m3(), mat3_polar_decompose(), mat3_to_quat(), mul_m3_fl(), mul_m3_m3m3(), P, quat_to_mat3(), and R.

Referenced by ElementRotation_ex(), interp_m4_m4m4(), Matrix_lerp(), and TEST().

◆ interp_m4_m4m4()

void interp_m4_m4m4 ( float R[4][4],
const float A[4][4],
const float B[4][4],
float t )

Complete transform matrix interpolation, based on polar-decomposition-based interpolation from interp_m3_m3m3.

Parameters
RResulting interpolated matrix.
AInput matrix which is totally effective with t = 0.0.
BInput matrix which is totally effective with t = 1.0.
tInterpolation factor.

Definition at line 2477 of file math_matrix_c.cc.

References B, copy_m3_m4(), copy_m4_m3(), copy_v3_v3(), interp_m3_m3m3(), interp_v3_v3v3(), and R.

Referenced by BKE_constraints_solve(), blender::io::alembic::blend_matrices(), constraint_target_to_mat4(), Matrix_lerp(), and TEST().

◆ invert_m2_m2()

bool invert_m2_m2 ( float inverse[2][2],
const float mat[2][2] )

◆ invert_m3()

◆ invert_m3_ex()

bool invert_m3_ex ( float mat[3][3],
float epsilon )

Definition at line 1125 of file math_matrix_c.cc.

References copy_m3_m3(), and invert_m3_m3_ex().

◆ invert_m3_m3()

bool invert_m3_m3 ( float inverse[3][3],
const float mat[3][3] )

Definition at line 1170 of file math_matrix_c.cc.

References adjoint_m3_m3(), b, determinant_m3_array(), inverse(), and LIKELY.

Referenced by add_pose_transdata(), blender::ed::object::apply_objects_internal(), apply_shear_value(), apply_targetless_ik(), applyAlign(), applyObjectConstraintSize(), armature_bone_primitive_add_exec(), armature_click_extrude_exec(), armature_finalize_restpose(), BKE_crazyspace_api_displacement_to_original(), BKE_mask_point_parent_matrix_get(), BKE_mesh_remap_calc_faces_from_mesh(), calc_bbox(), calc_deltas(), colormanage_load_config(), contarget_get_mesh_mat(), convert_tree(), createTransArmatureVerts(), ed_editnurb_spin(), ElementMirror(), execute_posetree(), flush_pixel(), getTransformOrientation_ex(), gizmo_mesh_spin_redo_setup(), init_TransDataContainers(), invert_m3(), invert_m3_m3_safe_ortho(), locktrack_evaluate(), MaskPointToTransData(), mat3_to_quat_legacy(), mat3_vec_to_roll(), blender::ed::object::new_primitive_matrix(), object_grid_element_to_tangent_displacement(), blender::ed::object::object_hook_recenter_exec(), blender::ed::object::object_origin_set_exec(), blender::ed::object::object_transform_axis_target_modal(), pseudoinverse_m3_m3(), RE_bake_normal_world_to_tangent(), blender::io::ply::set_world_axes_transform(), similar_edge_select_exec(), snap_sel_to_grid_exec(), snap_selected_to_location(), snapsource_confirm(), transform_convert_mesh_crazyspace_transdata_set(), transform_data_ext_rotate(), tri_to_quat_ex(), vcloud_estimate_transform_v3(), and viewrotate_apply().

◆ invert_m3_m3_ex()

bool invert_m3_m3_ex ( float inverse[3][3],
const float mat[3][3],
float epsilon )

Definition at line 1134 of file math_matrix_c.cc.

References adjoint_m3_m3(), b, BLI_assert, determinant_m3_array(), fabsf, inverse(), and LIKELY.

Referenced by invert_m3_ex().

◆ invert_m3_m3_safe_ortho()

void invert_m3_m3_safe_ortho ( float inverse[3][3],
const float mat[3][3] )

◆ invert_m4()

◆ invert_m4_m4()

bool invert_m4_m4 ( float inverse[4][4],
const float mat[4][4] )

Definition at line 1277 of file math_matrix_c.cc.

References EIG_invert_m4_m4(), inverse(), and invert_m4_m4_fallback().

Referenced by action_flip_pchan(), blender::ed::object::add_hook_object(), BCMatrix::add_inverted_transform(), TransformWriter::add_joint_transform(), add_primitive_cube_gizmo_exec(), BCMatrix::add_transform(), add_vertex_exec(), annotation_session_initdata(), AnimationImporter::apply_matrix_curves(), blender::ed::object::apply_objects_internal(), BCMatrix::apply_transform(), applyarmature_fix_boneparents(), applyarmature_process_selected_recursive(), armature_bone_primitive_add_exec(), armature_calc_roll_exec(), armature_deform_coords_impl(), armature_fill_bones_exec(), armature_finalize_restpose(), armature_transform_recurse(), armdef_accumulate_bone(), arrayModifier_doArray(), blender::ed::object::bake(), base_callback(), bc_bone_matrix_local_get(), bc_rotate_from_reference_quat(), BKE_armature_mat_pose_to_delta(), BKE_armature_mat_world_to_pose(), BKE_constraint_mat_convertspace(), BKE_constraints_clear_evalob(), BKE_gpencil_layer_addnew(), BKE_gpencil_stroke_from_view_space(), BKE_lattice_deform_data_create(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), BKE_object_apply_mat4_ex(), BKE_object_apply_parent_inverse(), BKE_object_modifier_gpencil_hook_reset(), BKE_object_modifier_hook_reset(), BKE_pchan_bbone_segments_cache_compute(), BKE_pchan_bbone_spline_compute(), BKE_pchan_bbone_spline_params_get(), BKE_pose_bone_done(), BKE_pose_eval_init(), BKE_pose_where_is(), BKE_tracking_get_projection_matrix(), BLI_space_transform_from_matrices(), BLI_space_transform_global_from_matrices(), blo_do_versions_290(), BM_mesh_calc_uvs_circle(), BM_mesh_calc_uvs_cone(), BMBVH_EdgeVisible(), BMD_mesh_intersection(), bmo_transform_exec(), brush_add(), blender::ed::sculpt_paint::brush_delta_update(), brush_edit_apply(), brush_puff(), blender::ed::sculpt_paint::filter::cache_init(), blender::ed::sculpt_paint::calc_brush_local_mat(), calc_local_clipping(), camera_view3d_reconstruction(), childof_evaluate(), clip_draw_main(), cloth_to_object(), convert_pose(), convert_tree(), blender::io::alembic::create_transform_matrix(), createTransParticleVerts(), cuboid_do(), blender::ed::curves::curve_draw_event_add(), curve_draw_event_add(), curve_draw_exec(), blender::ed::curves::curves_draw_exec(), blender::ed::object::data_xform_container_update_all(), deflect_emitter_iter(), deformVerts_do(), blender::ed::sculpt_paint::do_clay_thumb_brush(), blender::ed::sculpt_paint::pose::do_pose_brush(), draw_view_matrix_state_update(), drawPropCircle(), drw_call_matrix_init(), DRW_view_update(), ED_armature_join_objects_exec(), ED_armature_origin_set(), ED_clip_point_stable_pos(), ED_transform_calc_gizmo_stats(), ED_view3d_camera_lock_sync(), ED_view3d_cameracontrol_update(), ED_view3d_clipping_calc(), ED_view3d_draw_offscreen_imbuf_simple(), ED_view3d_update_viewmat(), edbm_dupli_extrude_cursor_invoke(), edbm_extrude_edge_exclude_mirror(), edbm_polybuild_delete_at_cursor_invoke(), edbm_polybuild_face_at_cursor_invoke(), edbm_polybuild_split_at_cursor_invoke(), edbm_polybuild_transform_at_cursor_invoke(), execute_posetree(), explodeMesh(), flushTransParticles(), followtrack_evaluate_using_3d_position_object(), followtrack_project_to_depth_object_if_needed(), foreach_mouse_hit_key_iter(), generate_vert_coordinates(), get_quick_mesh(), gizmo_3d_foreach_selected(), gizmo_cage2d_modal(), gizmo_move_modal(), gizmo_window_project_2d(), gizmo_window_project_3d(), GPENCIL_render_init(), blender::ed::object::ignore_parent_tx(), init_curve_deform(), init_meta(), Freestyle::BlenderFileLoader::insertShapeNode(), invert_m4(), invert_m4_m4_safe(), invert_m4_m4_safe_ortho(), lineart_main_get_view_vector(), lineart_main_load_geometries(), lineart_main_try_generate_shadow_v3(), lineart_object_load_single_instance(), SkinInfo::link_armature(), make_child_duplis_faces_from_editmesh(), make_child_duplis_faces_from_mesh(), make_child_duplis_verts_from_editmesh(), make_child_duplis_verts_from_mesh(), make_dmats(), make_duplis_particle_system(), mat4_to_dquat(), merge_target(), mesh_bisect_exec(), meshdeformModifier_do(), minmax_evaluate(), MOD_get_texture_coords(), modify_mesh(), modify_mesh(), modify_mesh(), normalEditModifier_do_directional(), object_apply_mat4_with_protect(), blender::ed::object::object_join_exec(), blender::ed::object::object_origin_set_exec(), blender::ed::object::object_warp_transverts(), blender::ed::object::object_xform_skip_child_container_item_ensure(), blender::ed::object::object_xform_skip_child_container_update_all(), objectsolver_evaluate(), obmat_to_viewmat(), blender::ed::object::parent_set(), particle_system_minmax(), particle_system_update(), PE_mirror_particle(), pointdensity_cache_psys(), proj_paint_state_viewport_init(), psys_apply_hair_lattice(), RE_bake_normal_world_to_object(), RE_bake_pixels_populate_from_objects(), reconstruct_retrieve_libmv_tracks(), remap_hair_emitter(), BCQuat::rotate_to(), save_hair(), SCULPT_cube_tip_init(), SCULPT_cursor_geometry_info_update(), SCULPT_raycast_init(), blender::ed::sculpt_paint::sculpt_update_cache_invariants(), set_axis(), similar_face_select_exec(), similar_vert_select_exec(), snap_sel_to_grid_exec(), snap_selected_to_location(), snap_to_pipe_profile(), softbody_to_object(), sort_bmelem_flag(), sphere_do(), spin_exec(), stabilization_data_to_mat4(), surfacedeformBind(), surfacedeformModifier_do(), transform_convert_clip_mirror_modifier_apply(), blender::ed::sculpt_paint::transform_matrices_init(), blender::ed::sculpt_paint::vwpaint::update_cache_invariants(), update_location_for_2d_curve(), updateDuplicateActionConstraintSettings(), updateDuplicateLocRotConstraintSettings(), updateDuplicateTransformConstraintSettings(), uv_map_transform_center(), uvprojectModifier_do(), v3d_editvertex_buts(), blender::ed::object::vertex_parent_set_exec(), vfont_to_curve(), view3d_viewmatrix_set(), blender::ed::object::voxel_size_edit_invoke(), warpModifier_do(), and waveModifier_do().

◆ invert_m4_m4_fallback()

bool invert_m4_m4_fallback ( float inverse[4][4],
const float mat[4][4] )

Computes the inverse of mat and puts it in inverse. Uses Gaussian Elimination with partial (maximal column) pivoting.

Returns
true on success (i.e. can always find a pivot) and false on failure. Mark Segal - 1992.
Note
this has worse performance than EIG_invert_m4_m4 (Eigen), but e.g. for non-invertible scale matrices, finding a partial solution can be useful to have a valid local transform center, see #57767.

Definition at line 1205 of file math_matrix_c.cc.

References BLI_assert, double(), EIG_invert_m4_m4(), fabsf, float, inverse(), max, SWAP, and UNLIKELY.

Referenced by init_TransDataContainers(), and invert_m4_m4().

◆ invert_m4_m4_safe()

void invert_m4_m4_safe ( float inverse[4][4],
const float mat[4][4] )

◆ invert_m4_m4_safe_ortho()

void invert_m4_m4_safe_ortho ( float inverse[4][4],
const float mat[4][4] )

A safe version of invert that uses valid axes, calculating the zero'd axis based on the non-zero ones.

This works well for transformation matrices, when a single axis is zeroed.

Definition at line 3179 of file math_matrix_c.cc.

References copy_m4_m4(), inverse(), invert_m4_m4(), orthogonalize_m4_zero_axes(), unit_m4(), and UNLIKELY.

Referenced by ED_armature_join_objects_exec(), ED_curve_join_objects_exec(), and ED_mesh_join_objects_exec().

◆ is_negative_m3()

bool is_negative_m3 ( const float mat[3][3])

Return true when the matrices determinant is less than zero.

Note
This is often used to check if a matrix flips content in 3D space, where transforming geometry (for example) would flip the direction of polygon normals from pointing outside a closed volume, to pointing inside (or the reverse).

When the matrix is constructed from location, rotation & scale as matrix will be negative when it has an odd number of negative scales.

Definition at line 2498 of file math_matrix_c.cc.

References determinant_m3_array().

Referenced by axis_dominant_v3_to_m3(), axis_dominant_v3_to_m3_negate(), calc_initial_placement_point_from_view(), interp_m3_m3m3(), mat3_normalized_to_quat_fast(), mat3_to_rot_size(), mat4_to_rot(), and Matrix_is_negative_get().

◆ is_negative_m4()

◆ is_orthogonal_m3()

bool is_orthogonal_m3 ( const float m[3][3])

Definition at line 1771 of file math_matrix_c.cc.

References dot_v3v3(), and fabsf.

Referenced by is_orthonormal_m3(), and Matrix_is_orthogonal_axis_vectors_get().

◆ is_orthogonal_m4()

bool is_orthogonal_m4 ( const float m[4][4])

Definition at line 1786 of file math_matrix_c.cc.

References dot_v4v4(), and fabsf.

Referenced by is_orthonormal_m4(), and Matrix_is_orthogonal_axis_vectors_get().

◆ is_orthonormal_m3()

bool is_orthonormal_m3 ( const float m[3][3])

Definition at line 1801 of file math_matrix_c.cc.

References dot_v3v3(), fabsf, and is_orthogonal_m3().

Referenced by mat4_to_dquat(), and Matrix_is_orthogonal_get().

◆ is_orthonormal_m4()

bool is_orthonormal_m4 ( const float m[4][4])

Definition at line 1818 of file math_matrix_c.cc.

References dot_v4v4(), fabsf, and is_orthogonal_m4().

Referenced by Matrix_is_orthogonal_get().

◆ is_uniform_scaled_m3()

bool is_uniform_scaled_m3 ( const float m[3][3])

Definition at line 1835 of file math_matrix_c.cc.

References eps, fabsf, len_squared_v3(), and transpose_m3_m3().

Referenced by is_uniform_scaled_m4(), and multires_apply_smat().

◆ is_uniform_scaled_m4()

bool is_uniform_scaled_m4 ( const float m[4][4])

Definition at line 1860 of file math_matrix_c.cc.

References copy_m3_m4(), and is_uniform_scaled_m3().

Referenced by BKE_curve_transform_ex().

◆ is_zero_m3()

bool is_zero_m3 ( const float mat[3][3])

Definition at line 2510 of file math_matrix_c.cc.

References is_zero_v3().

◆ is_zero_m4()

bool is_zero_m4 ( const float mat[4][4])

◆ loc_axisangle_size_to_mat4()

void loc_axisangle_size_to_mat4 ( float R[4][4],
const float loc[3],
const float axis[3],
float angle,
const float size[3] )

Definition at line 2611 of file math_matrix_c.cc.

References axis_angle_to_quat(), loc_quat_size_to_mat4(), and R.

◆ loc_eul_size_to_mat4()

void loc_eul_size_to_mat4 ( float R[4][4],
const float loc[3],
const float eul[3],
const float size[3] )

Make a 4x4 matrix out of 3 transform components. Matrices are made in the order: scale * rot * loc

TODO: need to have a version that allows for rotation order.

Definition at line 2541 of file math_matrix_c.cc.

References copy_m4_m3(), eul_to_mat3(), mul_m3_m3m3(), R, size_to_mat3(), and unit_m4().

Referenced by BKE_gpencil_layer_addnew(), BKE_gpencil_update_layer_transforms(), blo_do_versions_290(), blender::ed::object::collection_drop_exec(), greasepencil_copy_data(), and OVERLAY_gpencil_legacy_cache_init().

◆ loc_eulO_size_to_mat4()

void loc_eulO_size_to_mat4 ( float R[4][4],
const float loc[3],
const float eul[3],
const float size[3],
short order )

Make a 4x4 matrix out of 3 transform components. Matrices are made in the order: scale * rot * loc

Definition at line 2565 of file math_matrix_c.cc.

References copy_m4_m3(), eulO_to_mat3(), mul_m3_m3m3(), R, size_to_mat3(), and unit_m4().

Referenced by bc_create_restpose_mat(), childof_evaluate(), and rotlimit_evaluate().

◆ loc_quat_size_to_mat4()

void loc_quat_size_to_mat4 ( float R[4][4],
const float loc[3],
const float quat[4],
const float size[3] )

Make a 4x4 matrix out of 3 transform components. Matrices are made in the order: scale * rot * loc

Definition at line 2587 of file math_matrix_c.cc.

References copy_m4_m3(), mul_m3_m3m3(), quat_to_mat3(), R, size_to_mat3(), and unit_m4().

Referenced by blend_m4_m4m4(), get_dupliface_transform_from_coords(), get_duplivert_transform(), and loc_axisangle_size_to_mat4().

◆ loc_rot_size_to_mat4()

void loc_rot_size_to_mat4 ( float R[4][4],
const float loc[3],
const float rot[3][3],
const float size[3] )

Make a 4x4 matrix out of 3 transform components. Matrices are made in the order: scale * rot * loc

Definition at line 2531 of file math_matrix_c.cc.

References copy_m4_m3(), copy_v3_v3(), R, rescale_m4(), and rot.

Referenced by mul_m4_m4m4_aligned_scale(), mul_m4_m4m4_split_channels(), rotlike_evaluate(), seq_image_transform_quad_get_ex(), sequencer_image_crop_transform_matrix(), and transform_evaluate().

◆ madd_m3_m3m3fl()

void madd_m3_m3m3fl ( float R[3][3],
const float A[3][3],
const float B[3][3],
float f )

Definition at line 1044 of file math_matrix_c.cc.

References B, and R.

Referenced by pchan_deform_accumulate(), and splineik_evaluate_bone().

◆ madd_m4_m4m4fl()

void madd_m4_m4m4fl ( float R[4][4],
const float A[4][4],
const float B[4][4],
float f )

Definition at line 1055 of file math_matrix_c.cc.

References B, and R.

Referenced by armdef_accumulate_matrix().

◆ mat3_polar_decompose()

void mat3_polar_decompose ( const float mat3[3][3],
float r_U[3][3],
float r_P[3][3] )

Right polar decomposition: M = UP

U is the 'rotation'-like component, the closest orthogonal matrix to M. P is the 'scaling'-like component, defined in U space.

See https://en.wikipedia.org/wiki/Polar_decomposition for more.

Definition at line 2266 of file math_matrix_c.cc.

References BLI_svd_m3(), mul_m3_m3m3(), mul_m3_series, size_to_mat3(), transpose_m3_m3(), V, and W.

Referenced by interp_m3_m3m3().

◆ mat3_to_rot_size()

void mat3_to_rot_size ( float rot[3][3],
float size[3],
const float mat3[3][3] )
Parameters
rotA 3x3 rotation matrix, normalized never negative.
sizeThe scale, negative if mat3 is negative.

Definition at line 2204 of file math_matrix_c.cc.

References is_negative_m3(), negate_m3(), negate_v3(), normalize_v3_v3(), rot, and UNLIKELY.

Referenced by blend_m3_m3m3(), mat4_to_loc_rot_size(), Matrix_to_scale(), and TransMat3ToSize().

◆ mat3_to_scale()

float mat3_to_scale ( const float mat[3][3])

This gets the average scale of a matrix, only use when your scaling data that has no idea of scale axis, examples are bone-envelope-radius and curve radius.

Definition at line 2178 of file math_matrix_c.cc.

References copy_v3_fl(), len_v3(), M_SQRT1_3, and mul_m3_v3().

Referenced by blender::ed::object::apply_objects_internal(), Matrix_median_scale_get(), and multires_apply_smat().

◆ mat3_to_size()

void mat3_to_size ( float size[3],
const float M[3][3] )

◆ mat3_to_size_2d()

void mat3_to_size_2d ( float size[2],
const float M[3][3] )

Return 2D size assuming the given matrix is a 2D affine matrix.

Definition at line 2127 of file math_matrix_c.cc.

References len_v2(), and M.

◆ mat3_to_size_max_axis()

float mat3_to_size_max_axis ( const float M[3][3])

Return the largest scale on any axis, the equivalent of calling:

mat3_to_size(size_v3, mat);
size = size_v3[max_axis_v3(size_v3)];
MINLINE int max_axis_v3(const float vec[3])
void mat3_to_size(float size[3], const float M[3][3])

.. without 2x unnecessary sqrtf calls.

Definition at line 2147 of file math_matrix_c.cc.

References len_squared_v3(), M, max_fff(), and sqrtf.

◆ mat3_to_volume_scale()

float mat3_to_volume_scale ( const float mat[3][3])

This computes the overall volume scale factor of a transformation matrix. For an orthogonal matrix, it is the product of all three scale values. Returns a negative value if the transform is flipped by negative scale.

Definition at line 2168 of file math_matrix_c.cc.

References determinant_m3_array().

◆ mat4_decompose()

◆ mat4_to_loc_quat()

◆ mat4_to_loc_rot_size()

void mat4_to_loc_rot_size ( float loc[3],
float rot[3][3],
float size[3],
const float wmat[4][4] )

◆ mat4_to_rot()

void mat4_to_rot ( float rot[3][3],
const float wmat[4][4] )
Parameters
rotA 3x3 rotation matrix, normalized never negative.

Definition at line 2216 of file math_matrix_c.cc.

References is_negative_m3(), negate_m3(), normalize_v3_v3(), rot, and UNLIKELY.

◆ mat4_to_scale()

float mat4_to_scale ( const float mat[4][4])

Definition at line 2187 of file math_matrix_c.cc.

References copy_v3_fl(), len_v3(), M_SQRT1_3, and mul_mat3_m4_v3().

Referenced by blender::ed::greasepencil::add_armature_envelope_weights(), add_verts_to_dgroups(), blender::ed::object::apply_objects_internal(), arrayModifier_doArray(), BKE_armature_transform(), BKE_curve_transform(), BKE_gpencil_point_coords_apply_with_mat4(), BKE_gpencil_transform(), BKE_grease_pencil_point_coords_apply_with_mat4(), BKE_mball_minmax_ex(), BKE_mball_transform(), BKE_shrinkwrap_project_normal(), button2d_draw_intern(), blender::ed::sculpt_paint::dyntopo::detail_size::constant_to_brush_detail(), blender::ed::sculpt_paint::dyntopo::detail_size::constant_to_detail_size(), blender::ed::sculpt_paint::dyntopo::detail_size::constant_to_relative_detail(), blender::draw::overlay::GreasePencil::draw_grease_pencil(), drw_shgroup_bone_envelope(), drw_shgroup_bone_envelope_distance(), blender::ed::sculpt_paint::dyntopo::dyntopo_detail_size_sample_from_surface(), ED_armature_edit_transform(), ED_curve_join_objects_exec(), edbm_bevel_init(), edbm_inset_init(), gizmo_arrow_test_select(), gizmo_button2d_bounds(), gpencil_object_cache_add(), gpencil_vfx_blur(), gpencil_vfx_pixelize(), gpencil_vfx_rim(), gpencil_vfx_shadow(), gpencil_vfx_swirl(), gpencil_vfx_wave(), OVERLAY_outline_grease_pencil(), paint_calc_object_space_radius(), blender::ed::sculpt_paint::dyntopo::sample_detail_dyntopo(), blender::ed::sculpt_paint::dyntopo::sculpt_detail_flood_fill_exec(), and blender::draw::statvis_calc_thickness().

◆ mat4_to_size()

◆ mat4_to_size_fix_shear()

void mat4_to_size_fix_shear ( float size[3],
const float M[4][4] )

Extract scale factors from the matrix, with correction to ensure exact volume in case of a sheared matrix.

Definition at line 2157 of file math_matrix_c.cc.

References fabsf, M, mat4_to_size(), mat4_to_volume_scale(), and mul_v3_fl().

Referenced by BKE_bone_parent_transform_calc_from_matrices().

◆ mat4_to_size_max_axis()

float mat4_to_size_max_axis ( const float M[4][4])

Only the first 3 axes are used.

Definition at line 2152 of file math_matrix_c.cc.

References len_squared_v3(), M, max_fff(), and sqrtf.

Referenced by ArmatureBoneDrawStrategyBBone::culling_test(), and ArmatureBoneDrawStrategyEnvelope::culling_test().

◆ mat4_to_volume_scale()

float mat4_to_volume_scale ( const float mat[4][4])

◆ mat4_to_xy_scale()

float mat4_to_xy_scale ( const float mat[4][4])

Return 2D scale (in XY plane) of given mat4.

Definition at line 2196 of file math_matrix_c.cc.

References float, len_v3(), M_SQRT1_2, and mul_mat3_m4_v3().

◆ mul_m2_v2()

◆ mul_m3_fl()

◆ mul_m3_m3_post()

void mul_m3_m3_post ( float R[3][3],
const float B[3][3] )

Definition at line 362 of file math_matrix_c.cc.

References B, mul_m3_m3m3(), and R.

Referenced by object_preview_camera_create().

◆ mul_m3_m3_pre()

void mul_m3_m3_pre ( float R[3][3],
const float A[3][3] )

Special matrix multiplies

  • pre: R <-- AR
  • post: R <-- RB.

Definition at line 357 of file math_matrix_c.cc.

References mul_m3_m3m3(), and R.

Referenced by ED_transform_calc_gizmo_stats(), handle_armature_parent_orientation(), and knife_constrain_axis().

◆ mul_m3_m3m3()

void mul_m3_m3m3 ( float R[3][3],
const float A[3][3],
const float B[3][3] )

Definition at line 367 of file math_matrix_c.cc.

References B, copy_m3_m3(), ELEM, mul_m3_m3m3(), and R.

Referenced by _va_mul_m3_series_3(), _va_mul_m3_series_4(), _va_mul_m3_series_5(), _va_mul_m3_series_6(), _va_mul_m3_series_7(), _va_mul_m3_series_8(), _va_mul_m3_series_9(), add_pose_transdata(), blender::nodes::node_fn_align_euler_to_vector_cc::align_rotations_auto_pivot(), blender::nodes::node_fn_align_euler_to_vector_cc::align_rotations_fixed_pivot(), blender::ed::object::apply_objects_internal(), apply_targetless_ik(), applyAlign(), applyAxisConstraintSize(), applyObjectConstraintRot(), applyObjectConstraintSize(), armature_bone_primitive_add_exec(), armature_finalize_restpose(), armature_transform_recurse(), BKE_bone_parent_transform_calc_from_matrices(), BKE_crazyspace_build_sculpt(), BKE_curve_deform_co(), BKE_object_rot_to_mat3(), BKE_object_to_mat3(), BKE_pchan_to_mat4(), blend_m3_m3m3(), cloth_parallel_transport_hair_frame(), colormanage_load_config(), blender::io::alembic::copy_m44_axis_swap(), createTransArmatureVerts(), drawObjectConstraint(), ED_armature_edit_transform(), ed_editnurb_spin(), ElementBoneSize(), ElementMirror(), ElementResize(), ElementRotation_ex(), Euler_rotate(), execute_posetree(), blender::nodes::node_fn_rotate_euler_cc::get_multi_function(), gimbal_axis_object(), gimbal_axis_pose(), gizmo_axis_draw(), gizmo_mesh_spin_redo_update_orient_axis(), interp_m3_m3m3(), legacy_vec_roll_to_mat3_normalized(), loc_eul_size_to_mat4(), loc_eulO_size_to_mat4(), loc_quat_size_to_mat4(), locktrack_evaluate(), mat3_polar_decompose(), mat3_vec_to_roll(), Matrix_rotate(), meshcache_do(), mul_m3_m3_post(), mul_m3_m3_pre(), mul_m3_m3m3(), mul_m4_m4m4_aligned_scale(), mul_m4_m4m4_split_channels(), mul_v3m3_dq(), multiresModifier_prepare_join(), blender::ed::object::new_primitive_matrix(), blender::ed::object::object_orient_to_location(), blender::ed::object::object_transform_axis_target_modal(), ObjectToTransData(), projection_matrix_calc(), Quaternion_rotate(), root_to_world_m3(), rotate_eul(), rotate_eulO(), rotlike_evaluate(), splineik_evaluate_bone(), transdata_elem_skin_resize(), transform_convert_mesh_crazyspace_transdata_set(), transform_data_ext_rotate(), transform_evaluate(), vcloud_estimate_transform_v3(), vec_roll_to_mat3_normalized(), vfont_to_curve(), and world_to_root_m3().

◆ mul_m3_m3m4()

void mul_m3_m3m4 ( float R[3][3],
const float A[3][3],
const float B[4][4] )

R = A * B, ignore the elements on the 4th row/column of A.

Definition at line 414 of file math_matrix_c.cc.

References B, copy_m3_m3(), mul_m3_m3m4(), and R.

Referenced by mul_m3_m3m4().

◆ mul_m3_m4m3()

void mul_m3_m4m3 ( float R[3][3],
const float A[4][4],
const float B[3][3] )

R = A * B, ignore the elements on the 4th row/column of B.

Definition at line 438 of file math_matrix_c.cc.

References B, copy_m3_m3(), mul_m3_m4m3(), and R.

Referenced by mul_m3_m4m3(), and transform_orientation_matrix_get().

◆ mul_m3_m4m4()

void mul_m3_m4m4 ( float R[3][3],
const float A[4][4],
const float B[4][4] )

Definition at line 488 of file math_matrix_c.cc.

References B, and R.

Referenced by gizmo_3d_draw_invoke(), snap_selected_to_location(), and splineik_evaluate_bone().

◆ mul_m3_v2()

void mul_m3_v2 ( const float m[3][3],
float r[2] )

◆ mul_m3_v3()

void mul_m3_v3 ( const float M[3][3],
float r[3] )

Definition at line 916 of file math_matrix_c.cc.

References M, and mul_v3_m3v3().

Referenced by blender::ed::object::apply_objects_internal(), applyFaceNearest(), applyFaceProject(), applyObjectConstraintVec(), armature_calc_roll_exec(), armature_click_extrude_exec(), BKE_mesh_remap_calc_faces_from_mesh(), bmesh_test_dist_add(), bmo_spin_exec(), blender::ed::sculpt_paint::filter::cache_init(), calc_bbox(), calc_distanceCurveVerts(), calc_overlap(), blender::geometry::calc_position_with_interpolation(), blender::bke::pbvh::clip_ray_ortho(), constraintTransLim(), contarget_get_mesh_mat(), convert_tree(), do_kink_spiral(), do_kink_spiral_deform(), ED_view3d_minmax_verts(), ElementMirror(), ElementResize(), ElementRotation_ex(), execute_posetree(), filter(), flyApply(), getTransformOrientation_ex(), gizmo_axis_draw(), gizmo_bisect_prop_angle_set(), gizmo_mesh_spin_redo_setup(), gizmo_spin_prop_axis_angle_set(), IMB_colormanagement_srgb_to_scene_linear_v3(), blender::ed::sculpt_paint::gesture::init_common(), initFlyInfo(), blender::io::ply::load_plydata(), mat3_to_quat_legacy(), mat3_to_scale(), mball_select_similar_type(), mball_select_similar_type_get(), meshcache_do(), meshdeform_vert_task(), move3d_get_translate(), mul_v3m3_dq(), blender::ed::object::new_primitive_matrix(), nurb_bezt_direction_worldspace_get(), nurb_bpoint_direction_worldspace_get(), blender::ed::object::object_hook_recenter_exec(), blender::ed::object::object_origin_clear_exec(), blender::ed::object::object_origin_set_exec(), blender::ed::object::object_transform_axis_target_modal(), blender::geometry::p_chart_correct_degenerate_triangle_point(), blender::geometry::p_chart_correct_degenerate_triangles2(), pivotcon_evaluate(), proj_paint_state_viewport_init(), psys_get_dupli_path_transform(), RE_bake_normal_world_to_tangent(), ResizeBetween(), blender::math::rotate_around_axis(), blender::nodes::node_geo_curve_primitive_arc_cc::rotate_vector_around_axis(), rotateflagNurb(), RotationBetween(), SCULPT_cursor_geometry_info_update(), blender::ed::sculpt_paint::sculpt_update_cache_invariants(), blender::nodes::node_shader_vector_rotate_cc::sh_node_vector_rotate_around_axis(), blender::nodes::node_shader_vector_rotate_cc::sh_node_vector_rotate_euler(), snap_curs_to_sel_ex(), snap_sel_to_grid_exec(), snap_selected_to_location(), snapsource_confirm(), transdata_elem_bend(), transdata_elem_push_pull(), transdata_elem_shear(), transdata_elem_to_sphere(), transdata_elem_translate(), transform_snap_increment_ex(), tri_to_quat_ex(), blender::ed::sculpt_paint::vwpaint::update_cache_invariants(), uv_cylinder_project(), uv_sphere_project(), Vector_rotate(), blender::ed::object::voxel_size_edit_invoke(), walkApply(), blender::compositor::warp_coord(), and WIDGETGROUP_xform_cage_refresh().

◆ mul_m3_v3_db()

void mul_m3_v3_db ( const double M[3][3],
double r[3] )

Definition at line 921 of file math_matrix_c.cc.

References M, and mul_v3_m3v3_db().

Referenced by BLI_quadric_optimize().

◆ mul_m3_v3_double()

void mul_m3_v3_double ( const float M[3][3],
double r[3] )

Definition at line 1012 of file math_matrix_c.cc.

References double(), and M.

◆ mul_m4_fl()

void mul_m4_fl ( float R[4][4],
float f )

Definition at line 957 of file math_matrix_c.cc.

References R.

Referenced by add_weighted_dq_dq(), armdef_evaluate(), and normalize_dq().

◆ mul_m4_m3m4()

◆ mul_m4_m4_post()

◆ mul_m4_m4_pre()

void mul_m4_m4_pre ( float R[4][4],
const float A[4][4] )

◆ mul_m4_m4m3()

◆ mul_m4_m4m4()

void mul_m4_m4m4 ( float R[4][4],
const float A[4][4],
const float B[4][4] )

Definition at line 265 of file math_matrix_c.cc.

References A0, A1, A2, B, copy_m4_m4(), ELEM, mul_m4_m4m4(), R, and sum().

Referenced by _va_mul_m4_series_3(), _va_mul_m4_series_4(), _va_mul_m4_series_5(), _va_mul_m4_series_6(), _va_mul_m4_series_7(), _va_mul_m4_series_8(), _va_mul_m4_series_9(), ABC_get_transform(), actcon_evaluate(), action_flip_pchan(), BCMatrix::add_inverted_transform(), TransformWriter::add_joint_transform(), add_primitive_cube_gizmo_exec(), BCMatrix::add_transform(), AnimationImporter::apply_matrix_curves(), BCMatrix::apply_transform(), applyarmature_process_selected_recursive(), applyRotationMatrix(), applyTrackballMatrix(), armature_deform_coords_impl(), armdef_accumulate_bone(), armdef_accumulate_matrix(), armdef_evaluate(), armdef_get_tarmat(), arrayModifier_doArray(), base_callback(), bc_bone_matrix_local_get(), bc_match_scale(), bc_rotate_from_reference_quat(), bc_set_parent(), BKE_armature_mat_pose_to_delta(), BKE_armature_mat_world_to_pose(), BKE_armature_where_is_bone(), BKE_bone_parent_transform_apply(), BKE_bone_parent_transform_calc_from_matrices(), BKE_bone_parent_transform_combine(), BKE_camera_object_dof_distance(), BKE_constraint_apply_for_object(), BKE_constraint_apply_for_pose(), BKE_constraint_mat_convertspace(), BKE_constraints_clear_evalob(), BKE_constraints_make_evalob(), BKE_gpencil_layer_transform_matrix_get(), BKE_gpencil_update_layer_transforms(), BKE_lattice_deform_data_create(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), BKE_object_apply_mat4_ex(), BKE_object_apply_parent_inverse(), BKE_object_eval_parent(), BKE_object_get_parent_matrix(), BKE_object_matrix_local_get(), BKE_object_modifier_gpencil_hook_reset(), BKE_object_modifier_hook_reset(), BKE_pchan_bbone_segments_cache_compute(), BKE_pchan_bbone_spline_params_get(), BKE_pose_bone_done(), BKE_pose_where_is(), BKE_texture_mapping_init(), BKE_tracking_get_projection_matrix(), BLI_space_transform_from_matrices(), BLI_space_transform_global_from_matrices(), BMD_mesh_intersection(), bundle_midpoint(), button2d_draw_intern(), blender::ed::sculpt_paint::calc_brush_local_mat(), AnimationImporter::calc_joint_parent_mat_rest(), camera_stereo3d_model_matrix(), camera_view3d_reconstruction(), camerasolver_evaluate(), clampto_evaluate(), constraint_target_to_mat4(), convert_pose(), convert_tree(), copy_dupli_context(), blender::io::alembic::copy_m44_axis_swap(), DocumentImporter::create_instance_node(), blender::io::alembic::create_transform_matrix(), cuboid_do(), blender::ed::object::data_xform_container_update_all(), deformVerts_do(), blender::ed::sculpt_paint::do_clay_thumb_brush(), blender::io::alembic::ABCTransformWriter::do_write(), blender::io::usd::USDTransformWriter::do_write(), dquat_to_mat4(), draw_bone_degrees_of_freedom(), draw_bone_update_disp_matrix_bbone(), draw_view_matrix_state_update(), DRW_hair_duplimat_get(), drw_shgroup_bone_box(), drw_shgroup_bone_octahedral(), dvar_eval_transChan(), ebone_spline_preview(), ED_armature_join_objects_exec(), ED_curve_join_objects_exec(), ED_view3d_boundbox_clip_ex(), ED_view3d_camera_lock_sync(), ED_view3d_cameracontrol_update(), ED_view3d_draw_offscreen_imbuf_simple(), ED_view3d_init_mats_rv3d(), ED_view3d_ob_project_mat_get(), ED_view3d_update_viewmat(), edbm_extrude_edge_exclude_mirror(), edit_text_cache_populate_cursor(), edit_text_cache_populate_select(), AnimationImporter::evaluate_transform_at_frame(), execute_posetree(), face_dupli(), followpath_evaluate(), followpath_get_tarmat(), followtrack_evaluate_using_2d_position(), followtrack_evaluate_using_3d_position_camera(), AnimationImporter::get_joint_rest_mat(), TransformReader::get_node_mat(), get_quick_mesh(), blender::workbench::get_world_shading_rotation_matrix(), gizmo2d_xform_draw_prepare(), gizmo_3d_foreach_selected(), gizmo_cage2d_modal(), gizmo_cage3d_modal(), gizmo_placement_prop_matrix_get(), gizmo_placement_prop_matrix_set(), gpencil_depth_plane(), gpencil_object_cache_add(), GPU_matrix_model_view_projection_get(), hair_create_input_mesh(), init_curve_deform(), Freestyle::BlenderFileLoader::insertShapeNode(), join_mesh_single(), make_child_duplis_faces_from_editmesh(), make_child_duplis_faces_from_mesh(), make_child_duplis_verts_from_editmesh(), make_child_duplis_verts_from_mesh(), make_dmats(), make_dupli(), make_duplis_collection(), make_duplis_font(), make_duplis_geometry_set_impl(), make_duplis_particle_system(), mat4_to_dquat(), matrix_from_obj_pchan(), matrix_from_obj_pchan(), meshdeformModifier_do(), minmax_evaluate(), MOD_get_texture_coords(), modify_mesh(), modify_mesh(), move3d_draw_intern(), mul_m4_m4_post(), mul_m4_m4_pre(), mul_m4_m4m4(), normalEditModifier_do_directional(), ob_parcurve(), object_apply_mat4_with_protect(), object_solver_inverted_matrix(), blender::ed::object::object_transform_to_mouse_exec(), blender::ed::object::object_warp_calc_view_matrix(), blender::ed::object::object_xform_array_m4(), blender::ed::object::object_xform_skip_child_container_update_all(), objectsolver_evaluate(), OVERLAY_bounds(), OVERLAY_texture_space(), OVERLAY_volume_extra(), pose_mirror_info_init(), pose_transform_mirror_update(), proj_paint_state_viewport_init(), psys_mat_hair_to_global(), blender::io::alembic::AbcObjectReader::read_matrix(), blender::io::usd::USDXformReader::read_matrix(), reconstruct_retrieve_libmv_tracks(), reconstructed_camera_scale_set(), remap_hair_emitter(), resize_transform_matrix_fn(), BCQuat::rotate_to(), SCULPT_cube_tip_init(), blender::ed::sculpt_paint::sculpt_init_mirror_clipping(), set_axis(), set_plane_exec(), solve_parenting(), sort_bmelem_flag(), sphere_do(), surfacedeformModifier_do(), target_callback(), transform_convert_clip_mirror_modifier_apply(), blender::ed::sculpt_paint::transform_matrices_init(), transform_pivot_set_m4(), translike_evaluate(), blender::io::usd::USD_get_transform(), uvprojectModifier_do(), vertex_dupli(), view3d_viewmatrix_set(), vpaint_stroke_update_step(), warpModifier_do(), waveModifier_do(), where_is_ik_bone(), WIDGETGROUP_armature_spline_refresh(), WIDGETGROUP_xform_cage_refresh(), wireframe_hair_cache_populate(), WM_gizmo_calc_matrix_final_params(), wm_gizmo_calculate_scale(), wm_xr_draw_matrices_create(), wm_xr_fly_compute_turn(), wm_xr_grab_compute(), wm_xr_grab_compute_bimanual(), wm_xr_navigation_fly_modal(), wm_xr_navigation_grab_apply(), wm_xr_navlocks_apply(), wm_xr_session_actions_update(), wm_xr_session_controller_pose_calc(), wm_xr_session_state_update(), and wpaint_stroke_update_step().

◆ mul_m4_m4m4_aligned_scale()

void mul_m4_m4m4_aligned_scale ( float R[4][4],
const float A[4][4],
const float B[4][4] )

Combines transformations, handling scale separately in a manner equivalent to the Aligned Inherit Scale mode, in order to avoid creating shear. If A scale is uniform, the result is equivalent to ordinary multiplication.

NOTE: this effectively takes output location from simple multiplication, and uses mul_m4_m4m4_split_channels for rotation and scale.

Definition at line 1288 of file math_matrix_c.cc.

References B, loc_rot_size_to_mat4(), mat4_to_loc_rot_size(), mul_m3_m3m3(), mul_v3_m4v3(), mul_v3_v3v3(), and R.

Referenced by actcon_evaluate(), and translike_evaluate().

◆ mul_m4_m4m4_split_channels()

void mul_m4_m4m4_split_channels ( float R[4][4],
const float A[4][4],
const float B[4][4] )

Separately combines location, rotation and scale of the input matrices.

Definition at line 1304 of file math_matrix_c.cc.

References add_v3_v3v3(), B, loc_rot_size_to_mat4(), mat4_to_loc_rot_size(), mul_m3_m3m3(), mul_v3_v3v3(), and R.

Referenced by actcon_evaluate(), and translike_evaluate().

◆ mul_m4_v3()

void mul_m4_v3 ( const float M[4][4],
float r[3] )

Definition at line 719 of file math_matrix_c.cc.

References M.

Referenced by add_vertex_exec(), add_verts_to_dgroups(), apply_curve_transform(), applyarmature_process_selected_recursive(), applyFaceNearest(), applyFaceProject(), armature_bone_primitive_add_exec(), armature_calc_roll_exec(), armature_transform_recurse(), armature_vert_task_with_dvert(), armdef_evaluate(), arrayModifier_doArray(), BKE_curve_deform_co(), BKE_curve_transform_ex(), BKE_gpencil_stroke_from_view_space(), BKE_gpencil_stroke_to_view_space(), BKE_gpencil_transform(), BKE_gpencil_update_layer_transforms(), BKE_lattice_transform(), BKE_mball_transform(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), BKE_mesh_transform(), BM_mesh_calc_uvs_circle(), BMBVH_EdgeVisible(), BMD_mesh_intersection(), bmo_create_circle_exec(), bmo_create_cone_exec(), bmo_create_cube_exec(), bmo_create_icosphere_exec(), bmo_create_monkey_exec(), bmo_create_uvsphere_exec(), bmo_transform_exec(), bone_direction_worldspace_get(), box_minmax_bounds_m4(), bpy_bmesh_transform(), brush_add(), brush_add_count_iter(), brush_puff(), blender::ed::sculpt_paint::filter::cache_init(), blender::ed::object::calc_active_center(), blender::ed::sculpt_paint::calc_brush_plane(), blender::ed::sculpt_paint::calc_local_from_screen(), calc_ortho_extent(), calc_point_from_barycentric_cage(), calc_point_from_barycentric_extrusion(), calculate_autoscale_factor(), calculateCenterActive(), camera_view3d_reconstruction(), blender::ed::sculpt_paint::face_set::change_visibility_exec(), cloth_from_object(), cloth_to_object(), cloth_update_verts(), createTransParticleVerts(), createTransSculpt(), cuboid_do(), blender::ed::sculpt_paint::cursor_draw_point_screen_space(), blender::ed::sculpt_paint::cursor_draw_point_with_symmetry(), curve_deform_coords_impl(), deflect_emitter_iter(), deform_verts(), deform_verts(), densfunc(), disconnect_hair(), blender::ed::sculpt_paint::do_brush_action(), do_guides(), do_step_cloth(), do_texture_effector(), draw_bone_name(), draw_frustum_bound_sphere_calc(), draw_frustum_boundbox_calc(), draw_marker_texts(), drw_call_culling_init(), DRW_text_cache_draw(), dvar_eval_locDiff(), dynamic_paint_brush_velocity_compute_cb(), blender::ed::sculpt_paint::dynamic_topology_update(), dynamicPaint_brushObjectCalculateVelocity(), dynamicPaint_generateBakeData(), dynamicPaint_paintMesh(), ED_armature_edit_transform(), ED_armature_join_objects_exec(), ED_armature_origin_set(), ED_curve_add_nurbs_primitive(), ED_curve_join_objects_exec(), ED_mesh_deform_bind_callback(), ED_transform_calc_gizmo_stats(), ED_view3d_clipping_calc(), ED_view3d_win_to_3d_on_plane_with_fallback(), edbm_dupli_extrude_cursor_invoke(), EDBM_mesh_knife(), edbm_polybuild_face_at_cursor_invoke(), edbm_polybuild_split_at_cursor_invoke(), EDBM_unified_findnearest_from_raycast(), edge_pos_direction_worldspace_get(), edge_slide_snap_apply(), edge_slide_transform_matrix_fn(), explodeMesh(), blender::io::stl::export_frame(), flushTransParticles(), font_cursor_text_index_from_event(), blender::draw::View::frustum_culling_sphere_calc(), get_cpa_texture(), get_effector_data(), get_quick_mesh(), gizmo_3d_calc_pos(), gizmo_arrow_test_select(), gizmo_mesh_spin_init_refresh(), gizmo_window_project_2d(), gizmo_window_project_3d(), globallen(), gpencil_object_cache_add(), gpencil_point_to_xy(), greasepencil_copy_data(), hair_create_input_mesh(), init_meta(), Freestyle::BlenderFileLoader::insertShapeNode(), join_mesh_single(), knife_bm_tri_cagecos_get_worldspace(), blender::io::ply::load_plydata(), make_duplis_font(), merge_target(), mesh_bisect_exec(), mesh_merge_transform(), MOD_get_texture_coords(), modify_mesh(), modify_mesh(), motionpaths_calc_bake_targets(), mul_project_m4_v3(), mul_v3m3_dq(), blender::ed::object::object_origin_set_exec(), blender::ed::sculpt_paint::paint_brush_stroke_add_step(), blender::ed::sculpt_paint::paint_cursor_update_pixel_radius(), paint_init_pivot(), blender::ed::sculpt_paint::paint_line_strokes_spacing(), paint_proj_begin_clone(), blender::ed::sculpt_paint::paint_space_stroke(), blender::ed::sculpt_paint::paint_stroke_curve_end(), blender::ed::sculpt_paint::paint_stroke_modal(), particles_fluid_step(), PE_lasso_select(), PE_minmax(), PE_mirror_particle(), PE_update_mirror_cache(), pointdensity_cache_object(), pointdensity_cache_psys(), precalc_guides(), precalculate_effector(), project_paint_op(), psys_apply_hair_lattice(), psys_cache_edit_paths_iter(), psys_cache_paths(), psys_get_birth_coords(), psys_get_particle_on_path(), psys_get_texture(), psys_thread_create_path(), remap_hair_emitter(), remove_doubles_exec(), save_hair(), sculpt_apply_texture(), SCULPT_cache_calc_brushdata_symm(), SCULPT_calc_vertex_displacement(), SCULPT_raycast_init(), seq_image_transform_quad_get_ex(), shrinkwrap_get_tarmat(), snap_curs_to_sel_ex(), snap_sel_to_grid_exec(), snap_selected_to_location(), snap_source_closest_fn(), snapsource_confirm(), softbody_reset(), softbody_to_object(), softbody_update_positions(), sort_bmelem_flag(), sphere_do(), spin_exec(), springs_from_mesh(), tranform_snap_target_median_calc(), transform_convert_clip_mirror_modifier_apply(), update_location_for_2d_curve(), blender::ed::sculpt_paint::update_sculpt_normal(), update_world_cos(), updateDuplicateActionConstraintSettings(), updateDuplicateLocRotConstraintSettings(), updateDuplicateTransformConstraintSettings(), uv_warp_from_mat4_pair(), v3d_cursor_plane_draw_grid(), v3d_editvertex_buts(), vert_slide_snap_apply(), vert_slide_transform_matrix_fn(), blender::io::obj::OBJCurve::vertex_coordinates(), view3d_preselect_update_preview_triangle_from_edge(), view3d_preselect_update_preview_triangle_from_vert(), view3d_viewmatrix_set(), and warpModifier_do().

◆ mul_m4_v4()

◆ mul_m4_v4d()

void mul_m4_v4d ( const float mat[4][4],
double r[4] )

Definition at line 873 of file math_matrix_c.cc.

References mul_v4d_m4v4d().

◆ mul_m4db_m4db_m4fl()

void mul_m4db_m4db_m4fl ( double R[4][4],
const double A[4][4],
const float B[4][4] )

◆ mul_mat3_m4_fl()

◆ mul_mat3_m4_v3()

void mul_mat3_m4_v3 ( const float mat[4][4],
float r[3] )

◆ mul_project_m4_v3()

◆ mul_transposed_m3_v3()

void mul_transposed_m3_v3 ( const float M[3][3],
float r[3] )

◆ mul_transposed_mat3_m4_v3()

◆ mul_v2_m2v2()

◆ mul_v2_m3v2()

void mul_v2_m3v2 ( float r[2],
const float m[3][3],
const float v[2] )

Definition at line 701 of file math_matrix_c.cc.

References copy_v2_v2(), mul_v3_m3v3(), and v.

Referenced by MaskHandleToTransData(), MaskPointToTransData(), and mul_m3_v2().

◆ mul_v2_m3v3()

◆ mul_v2_m4v3()

void mul_v2_m4v3 ( float r[2],
const float mat[4][4],
const float vec[3] )

Definition at line 759 of file math_matrix_c.cc.

Referenced by mul_v2_project_m4_v3().

◆ mul_v2_project_m4_v3()

void mul_v2_project_m4_v3 ( float r[2],
const float mat[4][4],
const float vec[3] )

Definition at line 831 of file math_matrix_c.cc.

References fabsf, mul_project_m4_v3_zfac(), mul_v2_m4v3(), and w().

Referenced by uvprojectModifier_do().

◆ mul_v3_m3v3()

void mul_v3_m3v3 ( float r[3],
const float M[3][3],
const float a[3] )

Definition at line 887 of file math_matrix_c.cc.

References copy_v3_v3(), and M.

Referenced by blender::nodes::node_fn_align_euler_to_vector_cc::align_rotations_auto_pivot(), blender::nodes::node_fn_align_euler_to_vector_cc::align_rotations_fixed_pivot(), apply_tangmat_callback(), applyNormalRotation(), applyTranslation(), applyTranslationMatrix(), assign_final_coords_from_mdisps(), assign_final_elements_from_orig_mdisps(), blender::bke::subdiv::average_read_displacement_object(), BKE_crazyspace_api_displacement_to_deformed(), BKE_crazyspace_api_displacement_to_original(), BLI_newton3d_solve(), BM_face_calc_area_with_mat3(), BM_face_calc_perimeter_with_mat3(), bmesh_test_dist_add(), bmo_create_uvsphere_exec(), calc_deltas(), cloth_hair_update_bending_targets(), correctivesmooth_modifier_do(), deformVerts_do(), edbm_extrude_repeat_exec(), blender::bke::subdiv::eval_displacement(), blender::io::stl::export_frame(), gizmo_axis_draw(), gizmo_mesh_spin_init_refresh(), gizmo_mesh_spin_redo_update_from_op(), hook_co_apply(), IMB_colormanagement_aces_to_scene_linear(), IMB_colormanagement_rec709_to_scene_linear(), IMB_colormanagement_scene_linear_to_aces(), IMB_colormanagement_scene_linear_to_rec709(), IMB_colormanagement_scene_linear_to_srgb_v3(), IMB_colormanagement_scene_linear_to_xyz(), IMB_colormanagement_xyz_to_scene_linear(), initResize(), blender::bke::mesh_init_origspace(), MOD_solidify_nonmanifold_modifyMesh(), modify_mesh(), mul_m3_v3(), mul_v2_m3v2(), multires_disp_run_cb(), multires_reshape_apply_base_update_mesh_coords(), object_grid_element_to_tangent_displacement(), blender::ed::object::object_origin_set_exec(), paintface_minmax(), prop_dist_loc_get(), root_to_world_v3(), blender::io::ply::set_world_axes_transform(), snap_selected_to_location(), track_plane_from_existing_motion(), transform_constraint_get_nearest(), and transform_point_by_tri_v3().

◆ mul_v3_m3v3_db()

void mul_v3_m3v3_db ( double r[3],
const double M[3][3],
const double a[3] )

Definition at line 897 of file math_matrix_c.cc.

References copy_v3_v3_db(), and M.

Referenced by mul_m3_v3_db().

◆ mul_v3_m4v3()

void mul_v3_m4v3 ( float r[3],
const float mat[4][4],
const float vec[3] )

Definition at line 729 of file math_matrix_c.cc.

Referenced by blender::ed::object::add_hook_object(), add_vertex_invoke(), add_verts_to_dgroups(), add_weighted_dq_dq_pivot(), annotation_stroke_convertcoords(), applyarmature_adjust_edit_position(), armature_fill_bones_exec(), armdef_accumulate_bone(), bc_add_global_transform(), bc_apply_global_transform(), BKE_bone_parent_transform_apply(), BKE_bone_parent_transform_calc_from_matrices(), BKE_boundbox_minmax(), BKE_curve_nurbs_vert_coords_apply_with_mat4(), BKE_gpencil_point_coords_apply_with_mat4(), BKE_gpencil_stroke_from_view_space(), BKE_gpencil_stroke_to_view_space(), BKE_keyblock_curve_data_transform(), BKE_keyblock_data_set_with_mat4(), BKE_lattice_deform_data_eval_co(), BKE_lattice_vert_coords_apply_with_mat4(), BKE_mball_minmax_ex(), BKE_mesh_wrapper_vert_coords_copy_with_mat4(), BKE_object_as_kdtree(), BKE_object_foreach_display_point(), BKE_object_get_parent_matrix(), BKE_object_minmax_dupli(), BKE_pchan_bbone_spline_params_get(), BKE_pchan_minmax(), BLI_space_transform_apply(), BLI_space_transform_invert(), BLI_uvproject_from_view_ortho(), BM_mesh_calc_uvs_cone(), BM_mesh_vert_coords_apply_with_mat4(), bmo_create_grid_exec(), blender::ed::sculpt_paint::brush_delta_update(), brush_puff(), bundle_midpoint(), cage3d_draw_box_interaction(), cage3d_draw_circle_handles(), calc_local_clipping(), blender::ed::sculpt_paint::calc_local_from_screen(), blender::ed::sculpt_paint::trim::calculate_depth(), calculate_profile(), calculate_profile_segments(), calculateCenterLocal(), cast_ray_highpoly(), compute_bbone_segment_boundaries(), constraint_target_to_mat4(), contarget_get_lattice_mat(), contarget_get_mesh_mat(), cuboid_do(), ArmatureBoneDrawStrategyBBone::culling_test(), blender::ed::curves::curve_draw_stroke_from_operator_elem(), curve_draw_stroke_from_operator_elem(), blender::ed::object::data_xform_by_mat4(), do_set_scale(), blender::io::alembic::ABCPointsWriter::do_write(), drawObjectConstraint(), drw_call_culling_init(), ebone_spline_preview(), ED_clip_point_stable_pos(), ED_clip_point_stable_pos__reverse(), ED_mesh_deform_bind_callback(), edbm_dupli_extrude_cursor_invoke(), edbm_extrude_edge_exclude_mirror(), edbm_polybuild_face_at_cursor_invoke(), EDBM_project_snap_verts(), edbm_screw_exec(), edbm_select_axis_exec(), EDBM_unified_findnearest_from_raycast(), edit_text_cache_populate_boxes(), extrude_points_from_selected_vertices(), face_to_plane(), followtrack_evaluate_using_2d_position(), followtrack_project_to_depth_object_if_needed(), blender::ed::sculpt_paint::trim::generate_geometry(), generate_vert_coordinates(), get_bm_knife_vert(), blender::ed::object::get_new_constraint_target(), blender::ed::sculpt_paint::trim::get_origin_and_normal(), get_vert2ob_distance(), gizmo_3d_foreach_selected(), gizmo_move_modal(), gizmo_preselect_elem_test_select(), gpencil_vfx_pixelize(), gpencil_vfx_shadow(), gpencil_vfx_swirl(), gpencil_vfx_wave(), GPU_matrix_unproject_3fv(), hook_co_apply(), kinematic_get_tarmat(), blender::ed::sculpt_paint::gesture::line_plane_from_tri(), meshdeform_vert_task(), meshdeformModifier_do(), metaball_instance_data_set(), MOD_get_texture_coords(), mul_m4_m4m4_aligned_scale(), mul_v3_project_m4_v3(), nearestVert(), blender::ed::object::object_origin_set_exec(), blender::ed::object::object_warp_calc_view_matrix(), blender::ed::object::object_warp_transverts(), OVERLAY_relationship_lines(), paint_calc_object_space_radius(), blender::ed::sculpt_paint::paint_space_stroke_spacing(), particle_system_minmax(), pchan_deform_accumulate(), pose_transform_mirror_update(), proj_paint_state_screen_coords_init(), prop_dist_loc_get(), psys_cache_paths(), raycast_all_cb(), reconstruct_retrieve_libmv_tracks(), remap_hair_emitter(), screenspace_to_worldspace(), selected_tracking_boundbox(), set_axis(), set_origin_exec(), set_plane_exec(), shape_cut(), shape_cut_test_point(), SnapData::snap_edge_points_impl(), snap_selected_to_location(), snap_to_pipe_profile(), sort_bmelem_flag(), sphere_do(), splineik_evaluate_bone(), blender::ed::curves::stroke_elem_pressure_set(), stroke_elem_pressure_set(), blender::ed::curves::stroke_elem_project_fallback(), stroke_elem_project_fallback(), surfacedeformBind(), tracking_stabilize_frame_interpolation_cb(), transdata_center_global_get(), uv_map_transform_center(), uvprojectModifier_do(), view3d_preselect_update_preview_triangle_from_vert(), blender::ed::object::voxel_size_edit_invoke(), vpaint_stroke_update_step(), warpModifier_do(), WIDGETGROUP_xform_cage_refresh(), and wpaint_stroke_update_step().

◆ mul_v3_m4v3_db()

void mul_v3_m4v3_db ( double r[3],
const double mat[4][4],
const double vec[3] )

Definition at line 739 of file math_matrix_c.cc.

Referenced by lineart_mvert_transform_task().

◆ mul_v3_mat3_m4v3()

◆ mul_v3_mat3_m4v3_db()

void mul_v3_mat3_m4v3_db ( double r[3],
const double mat[4][4],
const double vec[3] )

Definition at line 800 of file math_matrix_c.cc.

Referenced by lineart_load_tri_task().

◆ mul_v3_project_m4_v3()

void mul_v3_project_m4_v3 ( float r[3],
const float mat[4][4],
const float vec[3] )

◆ mul_v4_m4v3()

void mul_v4_m4v3 ( float r[4],
const float M[4][4],
const float v[3] )

Definition at line 878 of file math_matrix_c.cc.

References M, and v.

Referenced by GPU_matrix_project_2fv(), and GPU_matrix_project_3fv().

◆ mul_v4_m4v3_db()

◆ mul_v4_m4v4()

◆ mul_v4d_m4v4d()

void mul_v4d_m4v4d ( double r[4],
const float mat[4][4],
const double v[4] )

Definition at line 857 of file math_matrix_c.cc.

References double(), v, and z().

Referenced by mul_m4_v4d().

◆ negate_m3()

◆ negate_m4()

◆ negate_mat3_m4()

void negate_mat3_m4 ( float R[4][4])

Definition at line 990 of file math_matrix_c.cc.

References R.

Referenced by gizmo_placement_prop_matrix_set().

◆ normalize_m2()

void normalize_m2 ( float R[2][2])

Definition at line 1875 of file math_matrix_c.cc.

References normalize_v2(), and R.

◆ normalize_m2_ex()

void normalize_m2_ex ( float R[2][2],
float r_scale[2] )

Definition at line 1867 of file math_matrix_c.cc.

References normalize_v2(), and R.

◆ normalize_m2_m2()

void normalize_m2_m2 ( float R[2][2],
const float M[2][2] )

Definition at line 1890 of file math_matrix_c.cc.

References M, normalize_v2_v2(), and R.

Referenced by Vector_rotate().

◆ normalize_m2_m2_ex()

void normalize_m2_m2_ex ( float R[2][2],
const float M[2][2],
float r_scale[2] )

Definition at line 1883 of file math_matrix_c.cc.

References M, normalize_v2_v2(), and R.

◆ normalize_m3()

◆ normalize_m3_ex()

void normalize_m3_ex ( float R[3][3],
float r_scale[3] )

Definition at line 1898 of file math_matrix_c.cc.

References normalize_v3(), and R.

◆ normalize_m3_m3()

◆ normalize_m3_m3_ex()

void normalize_m3_m3_ex ( float R[3][3],
const float M[3][3],
float r_scale[3] )

Definition at line 1913 of file math_matrix_c.cc.

References M, normalize_v3_v3(), and R.

◆ normalize_m4()

◆ normalize_m4_ex()

void normalize_m4_ex ( float R[4][4],
float r_scale[3] )

Definition at line 1928 of file math_matrix_c.cc.

References normalize_v3(), and R.

Referenced by BKE_bone_parent_transform_calc_from_matrices(), and stretchto_evaluate().

◆ normalize_m4_m4()

◆ normalize_m4_m4_ex()

void normalize_m4_m4_ex ( float rmat[4][4],
const float mat[4][4],
float r_scale[3] )

Definition at line 1949 of file math_matrix_c.cc.

References copy_v4_v4(), and normalize_v3_v3().

◆ orthogonalize_m3()

void orthogonalize_m3 ( float R[3][3],
int axis )

Make an orthonormal matrix around the selected axis of the given matrix.

Parameters
axisAxis to build the orthonormal basis around.

Definition at line 1429 of file math_matrix_c.cc.

References BLI_assert_unreachable, cross_v3_v3v3(), dot_v3v3(), mat3_to_size(), mul_v3_fl(), normalize_v3(), and R.

Referenced by v3d_cursor_poject_surface_normal(), and v3d_cursor_snap_update().

◆ orthogonalize_m3_stable()

void orthogonalize_m3_stable ( float R[3][3],
int axis,
bool normalize )

Make an orthonormal matrix around the selected axis of the given matrix, in a way that is symmetric and stable to variations in the input, and preserving the value of the determinant, i.e. the overall volume change.

Parameters
axisAxis to build the orthonormal basis around.
normalizeNormalize the matrix instead of preserving volume.

Definition at line 1650 of file math_matrix_c.cc.

References BLI_assert_unreachable, normalize(), orthogonalize_stable(), and R.

◆ orthogonalize_m3_zero_axes()

bool orthogonalize_m3_zero_axes ( float m[3][3],
float unit_length )

Definition at line 1758 of file math_matrix_c.cc.

References orthogonalize_m3_zero_axes_impl().

Referenced by invert_m3_m3_safe_ortho(), and ObjectToTransData().

◆ orthogonalize_m4()

void orthogonalize_m4 ( float R[4][4],
int axis )

Make an orthonormal matrix around the selected axis of the given matrix.

Parameters
axisAxis to build the orthonormal basis around.

Definition at line 1513 of file math_matrix_c.cc.

References BLI_assert_unreachable, cross_v3_v3v3(), dot_v3v3(), mat4_to_size(), mul_v3_fl(), normalize_v3(), and R.

Referenced by gizmo_refresh_from_matrix(), gpencil_object_cache_add(), and mat4_to_dquat().

◆ orthogonalize_m4_stable()

void orthogonalize_m4_stable ( float R[4][4],
int axis,
bool normalize )

Make an orthonormal matrix around the selected axis of the given matrix, in a way that is symmetric and stable to variations in the input, and preserving the value of the determinant, i.e. the overall volume change.

Parameters
axisAxis to build the orthonormal basis around.
normalizeNormalize the matrix instead of preserving volume.

Definition at line 1668 of file math_matrix_c.cc.

References BLI_assert_unreachable, normalize(), orthogonalize_stable(), and R.

Referenced by armdef_accumulate_matrix(), BKE_bone_parent_transform_calc_from_matrices(), BKE_object_apply_parent_inverse(), rotlike_evaluate(), rotlimit_evaluate(), stretchto_evaluate(), and translike_evaluate().

◆ orthogonalize_m4_zero_axes()

bool orthogonalize_m4_zero_axes ( float m[4][4],
float unit_length )

Definition at line 1763 of file math_matrix_c.cc.

References orthogonalize_m3_zero_axes_impl().

Referenced by invert_m4_m4_safe_ortho().

◆ print_m3()

void print_m3 ( const char * str,
const float m[3][3] )

Definition at line 2621 of file math_matrix_c.cc.

References printf, and str.

◆ print_m4()

void print_m4 ( const char * str,
const float m[4][4] )

Definition at line 2630 of file math_matrix_c.cc.

References printf, and str.

Referenced by armature_finalize_restpose().

◆ pseudoinverse_m3_m3()

◆ pseudoinverse_m4_m4()

void pseudoinverse_m4_m4 ( float inverse[4][4],
const float mat[4][4],
float epsilon )

◆ rescale_m4()

◆ rotate_m4()

◆ scale_m3_fl()

void scale_m3_fl ( float R[3][3],
float scale )

◆ scale_m4_fl()

◆ scale_m4_v2()

void scale_m4_v2 ( float R[4][4],
const float scale[2] )

Definition at line 2303 of file math_matrix_c.cc.

References R.

◆ shuffle_m4()

void shuffle_m4 ( float R[4][4],
const int index[4] )

Build index shuffle matrix.

Definition at line 253 of file math_matrix_c.cc.

References R, and zero_m4().

Referenced by modify_mesh().

◆ size_to_mat3()

◆ size_to_mat4()

◆ sub_m3_m3m3()

◆ sub_m4_m4m4()

void sub_m4_m4m4 ( float R[4][4],
const float A[4][4],
const float B[4][4] )

Definition at line 1077 of file math_matrix_c.cc.

References B, and R.

◆ svd_m4()

void svd_m4 ( float U[4][4],
float s[4],
float V[4][4],
float A_[4][4] )

Compute the Single Value Decomposition of an arbitrary matrix A That is compute the 3 matrices U,W,V with U column orthogonal (m,n) ,W a diagonal matrix and V an orthogonal square matrix s.t.A = U.W.Vt. From this decomposition it is trivial to compute the (pseudo-inverse) of A as Ainv = V.Winv.transpose(U).

Definition at line 2640 of file math_matrix_c.cc.

References b, copy_m4_m4(), e, eps, fabsf, hypotf, max_ff(), max_ii(), min_ii(), powf, sqrtf, V, zero_m4(), and zero_v4().

Referenced by pseudoinverse_m4_m4().

◆ swap_m3m3()

void swap_m3m3 ( float m1[3][3],
float m2[3][3] )

Definition at line 225 of file math_matrix_c.cc.

◆ swap_m4m4()

void swap_m4m4 ( float m1[4][4],
float m2[4][4] )

Definition at line 239 of file math_matrix_c.cc.

Referenced by vpaint_stroke_update_step(), and wpaint_stroke_update_step().

◆ transform_pivot_set_m4()

void transform_pivot_set_m4 ( float mat[4][4],
const float pivot[3] )

Scale or rotate around a pivot point, a convenience function to avoid having to do inline.

Since its common to make a scale/rotation matrix that pivots around an arbitrary point.

Typical use case is to make 3x3 matrix, copy to 4x4, then pass to this function.

Definition at line 2365 of file math_matrix_c.cc.

References copy_v3_v3(), mul_m4_m4m4(), negate_v3(), and unit_m4().

Referenced by applyRotationMatrix(), applyTrackballMatrix(), bmo_rotate_exec(), ED_view3d_win_to_3d_on_plane_with_fallback(), gizmo_cage2d_modal(), gizmo_cage3d_modal(), resize_transform_matrix_fn(), seq_image_transform_quad_get_ex(), and sequencer_image_crop_transform_matrix().

◆ translate_m4()

◆ transpose_m3()

◆ transpose_m3_m3()

void transpose_m3_m3 ( float R[3][3],
const float M[3][3] )

Definition at line 1337 of file math_matrix_c.cc.

References BLI_assert, M, and R.

Referenced by calc_deltas(), execute_posetree(), is_uniform_scaled_m3(), and mat3_polar_decompose().

◆ transpose_m3_m4()

void transpose_m3_m4 ( float R[3][3],
const float M[4][4] )
Note
Seems obscure but in-fact a common operation.

Definition at line 1352 of file math_matrix_c.cc.

References BLI_assert, M, and R.

Referenced by psys_get_dupli_path_transform().

◆ transpose_m4()

◆ transpose_m4_m4()

void transpose_m4_m4 ( float R[4][4],
const float M[4][4] )

◆ unit_m2()

void unit_m2 ( float m[2][2])

Definition at line 40 of file math_matrix_c.cc.

Referenced by matrix_identity_internal(), and matrix_invert_safe_internal().

◆ unit_m3()

void unit_m3 ( float m[3][3])

Definition at line 47 of file math_matrix_c.cc.

Referenced by blender::ed::object::apply_objects_internal(), apply_shear_value(), armature_bone_primitive_add_exec(), axis_angle_to_mat3(), BKE_bone_parent_transform_calc_from_matrices(), BKE_curve_deform_co(), BKE_mask_point_parent_matrix_get(), bm_vert_pair_to_matrix(), bmo_scale_exec(), BMO_slot_mat3_get(), calc_tangent_loop(), blender::compositor::PlaneDistortWarpImageOperation::calculate_corners(), convert_tree(), blender::io::alembic::copy_m44_axis_swap(), blender::io::alembic::create_swapped_rotation_matrix(), blender::ed::transform::create_transform_data_for_node(), createTransCursor_2D_impl(), createTransCursor_view3d(), createTransGPencil_strokes(), createTransGraphEditData(), createTransNlaData(), createTransParticleVerts(), deformVerts_do(), ed_editnurb_spin(), ED_getTransformOrientationMatrix(), ED_transform_calc_gizmo_stats(), ED_transform_calc_orientation_from_type_ex(), edbm_dupli_extrude_cursor_invoke(), ElementMirror(), ElementRotation_ex(), execute_posetree(), blender::io::stl::export_frame(), gizmo2d_xform_invoke_prepare(), gizmo_mesh_extrude_refresh(), gizmo_mesh_spin_redo_setup(), handle_object_parent_orientation(), blender::io::ply::importer_main(), blender::io::stl::importer_main(), initTransform(), initTransInfo(), invert_m3_m3_safe_ortho(), legacy_vec_roll_to_mat3_normalized(), locktrack_evaluate(), markerToTransCurveDataInit(), markerToTransDataInit(), MaskHandleToTransData(), MaskPointToTransData(), mat3_from_axis_conversion(), mat3_from_axis_conversion_single(), mat3_normalized_to_quat_with_checks(), matrix_identity_internal(), matrix_invert_safe_internal(), mesh_calc_eigen_matrix(), meshcache_do(), ObjectToTransData(), PaintCurveConvertHandle(), PaintCurvePointToTransData(), planeMarkerToTransDataInit(), projection_matrix_calc(), restoreTransObjects(), rotation_between_vecs_to_mat3(), SeqToTransData(), SeqToTransData(), SeqToTransData(), blender::io::ply::set_world_axes_transform(), SIM_mass_spring_clear_constraints(), SIM_mass_spring_set_rest_transform(), SIM_mass_spring_set_vertex_mass(), softbody_reset(), spring_hairbend_estimate_dfdv(), spring_hairbend_estimate_dfdx(), blender::bke::tests::TEST(), blender::io::alembic::TEST(), blender::io::alembic::TEST(), blender::io::alembic::TEST(), blender::io::alembic::TEST(), TEST(), TEST(), to_scene_linear_matrix(), transdata_elem_translate(), transform_convert_mesh_islands_calc(), transform_data_ext_rotate(), blender::io::obj::transform_object(), transform_orientation_matrix_get(), transform_orientations_create_from_axis(), ui_draw_but_WAVEFORM(), uv_map_transform(), UVsToTransData(), v3d_cursor_snap_update(), vcloud_estimate_transform_v3(), vec_roll_to_mat3_normalized(), and vectomat().

◆ unit_m4()

static void unit_m4 ( float m[4][4])

Definition at line 1127 of file rct.c.

Referenced by actcon_get_tarmat(), action_flip_pchan(), blender::ed::object::add_hook_object(), annotation_session_initdata(), AnimationImporter::apply_matrix_curves(), applyarmature_process_selected_recursive(), blender::ed::object::armature_coords_and_quats_apply(), armdef_get_tarmat(), arrayModifier_doArray(), axis_angle_to_mat4(), blender::draw::image_engine::ImageEngine< DrawingMode >::begin_sync(), BKE_armature_loc_pose_to_bone(), BKE_armature_loc_world_to_pose(), BKE_armature_mat_pose_to_bone_ex(), BKE_bone_parent_transform_calc_from_matrices(), BKE_bone_parent_transform_clear(), BKE_constraint_custom_object_space_init(), BKE_constraint_target_matrix_get(), BKE_constraint_targets_for_solving_get(), BKE_constraints_make_evalob(), BKE_gpencil_layer_transform_matrix_get(), BKE_gpencil_update_layer_transforms(), BKE_lattice_resize(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), BKE_object_calc_parent(), BKE_object_get_parent_matrix(), BKE_object_obdata_size_init(), BKE_pose_channel_ensure(), BKE_pose_where_is_bone(), BKE_texture_mapping_default(), BKE_texture_mapping_init(), BKE_tracking_camera_get_reconstructed_interpolate(), blo_do_versions_260(), blo_do_versions_270(), blo_do_versions_pre250(), BMO_slot_mat4_get(), bmo_translate_exec(), brush_puff(), C_Matrix_LocRotScale(), C_Matrix_Translation(), AnimationImporter::calc_joint_parent_mat_rest(), camera_stereo3d_model_matrix(), blender::ed::object::childof_clear_inverse_exec(), childof_new_data(), clampto_evaluate(), clampto_get_tarmat(), clip_draw_main(), blender::ed::object::collection_drop_exec(), constraintTransLim(), convert_pose(), blender::io::usd::convert_to_z_up(), convert_tree(), blender::io::alembic::copy_m44_axis_swap(), createTransParticleVerts(), blender::ed::sculpt_paint::cursor_draw_point_with_symmetry(), TransformReader::dae_translate_to_mat4(), damptrack_do_transform(), default_get_tarmat(), default_get_tarmat_full_bbone(), blender::ed::sculpt_paint::pose::do_pose_brush(), draw_bone_degrees_of_freedom(), draw_unit_state_create(), drawPropCircle(), DRW_hair_duplimat_get(), drw_manager_init(), ED_armature_join_objects_exec(), ED_curve_add_nurbs_primitive(), ED_transform_calc_gizmo_stats(), blender::ed::object::edit_armature_coords_and_quats_apply(), AnimationImporter::evaluate_transform_at_frame(), execute_posetree(), external_cache_image_add(), followpath_get_tarmat(), foreach_mouse_hit_key_iter(), FRS_do_stroke_rendering(), TransformReader::get_node_mat(), gizmo2d_xform_draw_prepare(), gizmo_axis_draw(), gizmo_cage2d_modal(), gizmo_cage3d_modal(), gizmo_calc_matrix_final_no_offset(), gizmo_empty_image_prop_matrix_get(), gizmo_render_border_prop_matrix_get(), gizmo_window_project_2d(), gizmo_window_project_3d(), gpencil_depth_plane(), gpencil_object_cache_add(), gpencil_uv_transform_get(), gpencil_vfx_shadow(), GPU_matrix_identity_projection_set(), GPU_matrix_identity_set(), GPU_matrix_reset(), GPU_matrix_translate_2f(), GPU_matrix_translate_3f(), blender::ed::greasepencil::grease_pencil_layer_parent_set(), image_camera_background_matrix_get(), blender::io::ply::importer_main(), blender::io::stl::importer_main(), init_context(), init_meta(), blender::draw::image_engine::SpaceImageAccessor::init_ss_to_texture_matrix(), blender::draw::image_engine::SpaceNodeAccessor::init_ss_to_texture_matrix(), invert_m4_m4_safe(), invert_m4_m4_safe_ortho(), kinematic_get_tarmat(), blender::bke::greasepencil::Layer::Layer(), loc_eul_size_to_mat4(), loc_eulO_size_to_mat4(), loc_quat_size_to_mat4(), lookat_m4(), make_duplis_collection(), make_duplis_geometry_set_impl(), matrix_identity_internal(), matrix_invert_safe_internal(), Matrix_resize_4x4(), mesh_calc_eigen_matrix(), blender::ed::object::metaball_coords_and_quats_apply(), minmax_evaluate(), modify_mesh(), modify_mesh(), motion_path_cache(), blender::ed::object::new_primitive_matrix(), blender::ed::space_node::node_gizmo_calc_matrix_space(), blender::ed::space_node::node_gizmo_calc_matrix_space_with_image_dims(), ob_parbone(), ob_parcurve(), ob_parvert3(), object_solver_inverted_matrix(), blender::ed::object::object_warp_verts_exec(), blender::ed::object::object_xform_array_m4(), blender::ed::object::objectsolver_clear_inverse_exec(), objectsolver_new_data(), orthographic_m4(), OVERLAY_edit_uv_cache_init(), OVERLAY_grid_cache_init(), OVERLAY_relationship_lines(), OVERLAY_texture_space(), blender::ed::object::parent_clear(), blender::ed::object::parent_noinv_set_exec(), blender::ed::object::parent_set(), blender::ed::object::parent_set(), particle_system_minmax(), PE_lasso_select(), PE_minmax(), polarview_m4(), pose_mirror_info_init(), pose_transform_mirror_update(), psys_face_mat(), psys_get_dupli_path_transform(), psys_get_particle_on_path(), psys_get_particle_state(), psys_mat_hair_to_object(), pycon_get_tarmat(), blender::io::alembic::AbcObjectReader::read_matrix(), blender::io::usd::USDXformReader::read_matrix(), reconstruct_retrieve_libmv_tracks(), blender::ed::sculpt_paint::SCULPT_layer_brush_height_preview_draw(), set_axis(), set_plane_exec(), setTransformViewMatrices(), shrinkwrap_get_tarmat(), blender::ed::sculpt_paint::cloth::simulation_limits_draw(), snapsource_confirm(), spin_exec(), splineik_evaluate_init(), splineik_get_tarmat(), stabilization_data_to_mat4(), TEST(), tool_generic_create_gizmo(), blender::ed::sculpt_paint::transform_matrices_init(), blender::io::obj::transform_object(), transform_pivot_set_m4(), ui_search_menu_create_tooltip(), UI_view2d_view_to_region_m4(), UnitConverter::UnitConverter(), blender::ed::view3d::geometry_nodes_gizmos::TransformGizmos::update_translate_style(), updateDuplicateActionConstraintSettings(), updateDuplicateLocRotConstraintSettings(), updateDuplicateTransformConstraintSettings(), uv_map_rotation_matrix_ex(), uvprojectModifier_do(), v2_quad_corners_to_mat4(), vfont_to_curve(), blender::ed::object::voxel_size_edit_invoke(), warpModifier_do(), WIDGETGROUP_camera_refresh(), WIDGETGROUP_camera_view_draw_prepare(), WIDGETGROUP_light_target_draw_prepare(), WIDGETGROUP_xform_cage_refresh(), wireframe_hair_cache_populate(), WM_gizmo_calc_matrix_final_no_offset(), wm_gizmo_create(), wm_software_cursor_draw_bitmap(), wm_xr_fly_compute_move(), wm_xr_grab_compute(), wm_xr_grab_compute_bimanual(), wm_xr_navigation_fly_modal(), and WM_xr_session_state_viewer_pose_matrix_info_get().

◆ unit_m4_db()

◆ zero_axis_bias_m4()

void zero_axis_bias_m4 ( float mat[4][4])

Fix any zero scale axis adding a small bias orthogonal to the other valid axis.

Definition at line 3116 of file math_matrix_c.cc.

References cross_v3_v3v3(), len_squared_v3(), and mul_v3_fl().

◆ zero_m2()

void zero_m2 ( float m[2][2])

Definition at line 25 of file math_matrix_c.cc.

◆ zero_m3()

◆ zero_m4()